Imperative Programming vs Functional Programming

While I was first learning how to build web apps, I was learning object oriented design using Ruby. This programming paradigm was easy for me to grasp. I took real world models and replicated these situations via code. For example, my first Rails app was a Yoga class tracker. Through my code I demonstrated that a yoga class has a class plan, and belongs to both a client and a teacher. This app also exemplified Imperative programming. When I first started to learn JavaScript, I first learned the language through the lens of imperative programming. Imperative programming is writing a simple script “do this then this”. Imperative programming consists of loops and conditional statements

Alternatively, functional programming deals with how inputs are transformed into outputs. Functional programming is pure meaning the output only depends on the input of the function. Therefore, functional programming does not have side effects. Also, functional programming does not have a “state” like imperative programming. For flow control, functional programming uses function calls and recursion.

The original inspiration for this blog post was to answer a question I had originally come up with. I wish I had a post like this when I first started to learn Functional Programming. Especially since I started to learn Functional Programming from the perspective of Imperative Programming.

Feel free to re-read this article as many times as you like. I re-read my resources repetitively to get clear about the differences between the two styles of programming.

My First Tech Meetup!

Tuesday was an exciting day for me. I went to my first Tech Meetup! The Meetup was for a group called Jersey Shore Women in Tech. The Meetup was in a local co-working space called Cowerks in the “city by the sea”, Asbury Park, New Jersey. The space had ample natural light, an open office layout, and large windows overlooking a lake.

There were probably 20 women there, so it was easy to mingle and strike up conversation. As a self diagnosed introvert, starting conversations with strangers isn’t exactly my idea of fun, but I know it’s a skill I’ll continue to improve upon. My go to conversation starter was asking if it was someone’s first Jersey Shore Women in Tech meetup. I learned that for a good amount of women, it was their first Meetup!

The Meetup itself was entitled “A Study: Pathways Women Use to Enter the Technology Sector” in which two researchers shared how women in New Jersey have entered the tech field. This topic interested me because as someone who didn’t study CS or IT during undergrad, I was curious to see if my path was similar to other women who wound up in tech. The researchers interviewed 24 women throughout New Jersey and shared the results with us. One of the researchers, Elaine Zundl, concluded that the most common path for women in tech in New Jersey is the non-linear path. She found that most women had humanities degrees but still found their way to tech. This exposed the question of the night- if women are interested and succeeding in the tech field, why aren’t they studying it during undergrad (women only make up ~17% of CS degrees in NJ, for example)? It’s a tough question to answer, but the researchers and the audience alike agreed that it has to do with exposure. Personally, growing up I had no idea what coding was and it wasn’t until my first full-time job that I understood the context and started to gain interest in the craft. Another dev in the room said she started to code only because her dad was a Software Engineer and thought that she would like it.

Elaine shared some policies she had come with in order to expose younger girls to code and to encourage women to improve their technical skills. She thinks having a mandatory Computer Science class would even the playing field. Just like students have to take English and Math, all students should be required to take a Computer Science class. Currently, most students can only get hands on instruction if their parents have the money to send them to a coding camp, which does not reflect an even playing field. She explained a road block would be getting teachers trained for a curriculum. As for adults, Elaine is advocating for a website which would serve as a centralized resource for learning resources in the field, because right now the resources are dispersed throughout the web.

The most interesting part of the night was learning how Harvey Mudd College leveled the playing field for CS graduates. 50% of CS degrees are awarded to women at the college. We didn’t discuss the details of how college president Maria Klawe and the rest of the college achieved this goal, so after the Meetup I set out on my own to discover the how. I learned that Harvey Mudd College splits CS majors into three groups; those who have programming experience, those who do not, and those who are beginners and are interested in the intersection of biology and CS. The intermediate group is challenged by complex topics, but do not get “ahead” of the other groups because the topics they learn are different than those learned in the curriculum’s 2nd CS class. Professors are also told to encourage students to work together on assignments, to frame problems as real world scenarios, and to discourage “macho” behavior such as one student asking/ answering a majority of the questions. This makes CS relatable and more welcoming.

Overall, it was a great Meetup to attend. It was really cool to see that there are local studies and resources going towards helping women and girls lean into tech. Also, learning about how Harvey Mudd College is leveling the playing field was very inspiring! I’m looking forward to attending more Meetups in the future!

Source: https://www.inc.com/kimberly-weisul/how-harvey-mudd-college-achieved-gender-parity-computer-science-engineering-physics.html

I Finished a Coding Bootcamp, Now What?

6 months ago I left my full time job as an Operations Analyst to pursue learning how to code full time with Flatiron’s Online Software Engineering course. I’ll write about my review on the program in a different post, but for now I want to talk about how I plan on moving forward on my coding journey. I can’t describe how good it felt to hear my instructor say I graduated. This was the hardest thing I’ve ever done and not solely because of the content. Yes, learning how to code is HARD work, but the more challenging part of the program was coming up against myself to move forward. There were times when I thought “I’m not cut out for this” or “There’s no way I’ll be able to figure this out” but as time went on and I progressed more into the program I started to prove that voice wrong. I had to make short term sacrifices (a reduced monthly budget, social life, free weekends and travel plans to name a few) but now that I’m on the other side it was well worth it. I have a strong foundation and have a clear direction with how I want to move forward.

I’m Moving!

A couple of months ago I realized my graduation time was coinciding with the end of my lease here in Philly. I didn’t want to renew the lease without a job lined up, so I decided it was best for me to move back in with my parents so I can do the job search from a centered place. It also doesn’t hurt that they live in Long Beach Island, New Jersey. I’m looking forward to spending my summer at my favorite place, the beach! Another note: looking for a job while I was still doing my coding bootcamp seemed unfathomable for me. I wanted to focus on learning how to code while I was in the program and had the resources (i.e. access to instructors) because looking for a job and technical interviews are a beast of their own. Speaking of which…

The Job Search

I’m putting off the job search for a few weeks until after I move, spiff up my personal projects, and work on my resume. Even though I won’t be actively applying to jobs, I will still be working daily towards landing a job by…

Continue to Blog

Blogging has been one of the most enjoyable aspects of my coding journey thus far. I enjoy learning in public and sharing what I know. It can be intimidating to blog as a newbie, but similar to how there’s always someone who knows more than you, there’s always someone who knows less than you. You never know who your post is inspiring or helping out! My goal is to post once a week!

Working on Personal Projects

I plan on styling my websites so they look modern and professional. Our project requirements were not focused on styling and design, so during project weeks I put those aspects on the back burner to focus on project requirements. I have some experience with CSS and bootstrap so I’m looking forward to the visually creative side of programming! Also, once I complete styling, I’m looking forward to deploying the projects on Heroku. Aside from existing projects I have some other project ideas in the pipeline to keep me busy- a tarot app build with React and Redux or a yoga class plan generator using Rails. My personal projects are built to encourage self reflection or to organize and simplify a task.

Continue Learning

One of the reasons why I decided to enroll in a bootcamp was because I needed structure to my learning. Now, with a strong foundation, I know where I need to improve. Currently, I’m taking a Udemy course with Stephen Grider on React and Redux which reenforces concepts I learned with Flatiron, but it also exploring Redux Form and hooks within React. From there, I plan on taking Udemy’s Object Oriented Javascript course. After that, I plan on taking Stephen Grider’s Udemy course on Algorithms and data structures in order to prep for interviews. One of the things that attracted me to programming the most was the limitless ceiling of learning, so I’m excited to learn more!

Freelance

While I was in my program I had friends reach out to me about setting up websites and I had to politely turn them away because I felt like I was busy enough with being in school full time on top of having a part time job. This freelance work is mostly around setting up a WordPress site for blogging, similar to my own.

For the time being I’ll be working part time at a local beachy bohemian store called How To Live, working on my portfolio, blogging, and taking on freelance requests. Let me know if you have any tips for a recent coding bootcamp grad!

The Only Way Out of Coding Bootcamp is Through React and Redux

The final project for Flatiron’s Online Web Development Bootcamp is a React Redux project with a Rails backend. This project cumulates all of what we have learned in the course – Ruby, JS, HTML, CSS, AJAX, React, Rails, and Redux. React and Redux was tough for me to grasp. In addition to Flatiron’s curriculum I used Stephen Grider’s course on React and Redux: https://www.udemy.com/react-redux/. Stephen uses diagrams and analogies to help explain concepts, I highly recommend this course as he walks through building several projects from scratch.

The app that I built is called Daily Code Log in which you can document your daily coding progress. As a self proclaimed code newbie, I realize how important it is to document learnings, especially being aware of what you don’t know. Over time, as you seek out answers to your own questions, you will look back on answered questions and realize how much knowledge you’ve accumulated.

Now that I am on the other side, here are a few quick tips and pointers if you are thinking about tackling a similar project.

Map Out Requirements and a Schedule

The task at hand seemed daunting, so I decided to break the project into smaller parts. Here is my 9 day plan:

Saturday: Map project out- define relationships amongst objects and be clear about the question “What is the point of my app?”

Sunday: Create seed data, setup Rails backend of project.

Monday: Create entire (mockup) UI of project.

Tuesday: Hookup fetch get requests to fetch internal API data.

Wednesday: Hookup fetch post requests so API endpoint could be updated.

Thursday: Set up React routes.

Friday: Final touches/ squash bugs.

Saturday: Record video walkthrough of App/ write blog post on learnings.

Sunday: …Submit project!!!!

Setting a goal for myself each day was very helpful because each morning I knew exactly what I wanted to get accomplished. If I met my goal earlier in the day, I would move on to my next goal.

Use Semantic UI

I used Semantic UI for the web design of my app. Instead of a template, Semantic UI has many different elements- think buttons, cards, icons- that you can use in your app. Semantic gives you the different building blocks, but ultimately the final product can look original and custom made. In order to reference Semantic UI within your application you simply have to import the following link into the client/public/index.html within the <head> tag:

<link rel="stylesheet" href="<https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css>">

I then used some CSS to reposition and style the elements further.

Here are some screenshots of the simple design of the app:

Form to create a Code Log
Display of all Code Logs

More Than One Way to do the Same Thing…

The trickiest part of the project for me was submitting forms to update my internal API endpoint. Doing a quick google search, most people suggested I use https://redux-form.com/, but my instructor helped me post data to my API without Redux Form. Instead, we used vanilla javascript. In the form’s handleOnSubmit function, we called on an action call addLog which made a post request to the API endpoint:

export const addLog = (log) => {
  return dispatch => {
    return fetch('/logs', {
      method: "POST",
      headers: {'Content-Type':'application/json'},
      body: JSON.stringify({log})
    }).then(resp => resp.json())
      .then(log => dispatch({type: "ADD_LOG", log}))
  }
}

The reducer, “ADD_LOG”, then adds the form’s data to the Redux store.

I’m looking forward to diving into Redux Form but it was worthwhile to learn the vanillas JS way. Now, when I learn Redux Form, I’ll have a solid idea of what Redux Form is doing behind the scenes.

I did it!

I am very proud of the way the project turned out. I have used the app daily to track my coding progress, and once I add authentication, I hope others use the app for their learning benefit as well.

P.S. Here’s a walkthrough of my project!

What’s an API?

Before attending Flatiron’s online coding bootcamp, I worked as an Operations Analyst for a clean tech company. Although writing SQL queries were the closest I got to actual coding, I was constantly surrounded by tech jargon. I remember hearing lots about API’s. They seemed fragile, complex, hard to define. However, after adding Javascript onto an existing rails project, and enabling internal API use, I have a clearer understanding of what an API is and its use.

What’s an API?

An API is an end point to request data. The data is typically in JSON (Javascript Object Notation) format, reading like a dictionary with its key value pairs, making it very intuitive to read. Data is processed from the endpoint through the browser and can be viewed in the console before it is added to the desired destination, or page. Viewing the data in the console is very helpful because you can play around with the data with Javascript in the browser’s console— testing code to access the points of data that are important to your application.

Internal vs External API’s:

I always thought as API’s as exclusively external. My goto example of an external API is Google Maps. For example, my local pizza shop has Google Maps embedded into the user interface of their website. Luigi’s connects to Google Map’s API so pizza lovers can see the restaurant location when they go onto the site.

However, in the context of my project, I wasn’t in need of external API’s, I wanted to render data that was available within my application. The theme of the project was to render data via AJAX. For example, after a user click ‘View Class Plan’ the class plan will be rendered from the API endpoint, and there will not be a page refresh.

The API endpoint looked like this:

I then wrote the following code in order to render the data from: http://localhost:3000/yoga_classes/6/yoga_class_data and append it to the yoga_classes index page: http://localhost:3000/yoga_classes

$(function() {
    $(".js-more").on('click', function(){
        let id = $(this).data("id");
        $.getJSON("/yoga_classes/" + id + "/yoga_class_data", function(data) {
        $("#body-" + id).append("<p>" + data["class_plan"] + "</p><p> Created by: " + data["user"]["email"] + "</p>")
      });
    });
  });

Breaking down the code:

  • Line 2: is saying for class “js-more”, which was assigned to the “View Class Plan” button, when the user clicks the button the following should happen…
  • Line 3: assigns a variable id to the yoga_class id so that in line 4 the yoga_class_data URL can be dynamic.
  • Line 4: is where the magic happens. The JQuery method $.getJSON takes two arguments the, the dynamic /yoga_class_data url and a function…
  • Line 5: that function takes in data (which represents JSON data of a yoga_class) as an argument and appends (adds) the class plan and user to the class ID body-[id], this case body-6, which is located underneath the yoga class title on the page http://localhost:3000/yoga_classes.

Note: I also used Active Model Serializers gem which grants the backend ability to serialize data with the necessary attributes and relationships. .

When Learning and Applying Something New, Pace Yourself:

At the end of each module for Flatiron’s Online Software Engineering Immersion course we are required to build a project which culminates everything we learned the 3 works prior. We cover so much material in 3 weeks that when project time comes around I don’t feel comfortable with the material initially. Each project week I look over the scope of the project and immediately the requirements seem daunting. The Javascript, APIs, and AJAX section was no different. Instead of remaining in a state of resistance I decided to breakdown the project. We had 5 requirements, so my goal was to complete a requirement per day, leaving two extra days for pesty bug fixes or more time in case a certain spec took longer to tackle. This proved to be a great method. I managed to finish my project in 4 days. If I was able to meet my requirement for the day, I continued working. I find that learning happens best when spread out over multiple sessions, so working on a requirement (each requirement tackles a slightls different concept) over 2 separate days solidified my learnings.

Learning a second language was tough, but I learned why it’s necessary. AJAX requests make it quicker for a user to interact with my app. It gives the user the ability to request more data without having to load a new page, which is the modern experience of the web. I’m looking forward to how the concepts of AJAX apply to Redux and React, the last module for the coding bootcamp!

P.S. here’s a walkthrough of the app described above!

Blending Wellness & Tech

When I socialized my decision to attend a coding bootcamp, colleagues, friends and family alike asked me, “So, what’s the similarity between yoga and tech?” To the external world these were two evident interests of mine, however, personally, I couldn’t articulate what those similarities were. So I began asking myself, what are the similarities between wellness and tech? Over the past few months as I have been maintaining a coding, yoga, meditation and reiki practice, I have come to find some common threads amongst these seemingly different topics.

Let Curiosity Lead the Way

Often times I find myself following my curiosity, not trying to force anything out of a given interest. For example, while I was going through my yoga teacher training, I didn’t put the pressure on myself to become a yoga teacher. Instead, my yoga teacher training served as a catalyst of exploration into other wellness practices which were exposed to me during the training, such as mediation, reiki, and journaling. If I had been fixated on becoming a yoga teacher, I may have been all consumed and not given space to deeply explore related and complementary interests.

Similarly, I often get asked what my plans are after Flatiron’s coding bootcamp.I am keeping an open mind. Right now, I am fixated on learning the art of code, building projects, and having fun with being a beginner. I am keeping myself open as to what can come along the way.

Discipline

Every morning before I leave my apartment, I meditate for 15 minutes. This has been a daily routine of mine for a year and a half, and honestly, I meet resistance most days. “I’m too tired”, “My mind is too scattered”, or “I have to get going, I don’t have time”. I feed myself excuses, yet I still sit in order to show up for myself. Daily practice is so important because the benefits of meditation cumulate after many sessions.

Similarly, with coding, on days I don’t feel sharp it’s easy to try and procrastinate and think, “Oh, I’ll do it tomorrow when I feel better.” But the truth is, we can’t control the ebbs and flows of how we feel, we have to work towards our goals even when we aren’t feeling our best. One day I was lamenting to my friend Mary about how I didn’t complete all of the coding lessons I had set out to do that day. In response, she quoted Morgan Harper Nichols, “If today was one of those days, that’s okay. Whether you accomplished everything or not, you are well on your way.” I go back to his quote when I come up short on my learning goals, or if I had a scattered meditation session, to remind myself that I did make progress.

They Depend on One Another

Why wellness needs tech…

For yoga, specifically, I’ve thought of several projects to build that would make my life as a yoga teacher easier. For example, a web application that has all of my yoga class plans which I can refer back to for inspiration. Because currently, all of my class plans are in various journals stacked in my closet which is very inefficient and takes me 15 minutes to find a specific class plan, if I’m lucky.

Why tech needs wellness…

In tech the term ‘burnout’ pops up a lot. I believe wellness practices offsets stress, and improves the overall quality of one’s life. My personal wellness practices ‘fills my cup’ and allows me to show up in the world to be my best self. In the context of Flatiron’s full-time bootcamp, I’ve had to prioritize my wellness practice in order to handle the load of the program.

In all, I don’t think I’ll ever have a concise answer to “What are the similarities between wellness and tech?” , because the answer will continue to evolve as I move through my coding and wellness journeys. I’m looking forward to asking myself this question in a few months or in a few years, to see how my answers have changed.

Let me know your thoughts on the overlap of wellness and tech, I would love to hear from you!

What is a Framework?

While I was learning Javascript on my own, I began exposing myself to all the resources I could. Using FreeCodeCamp as my guide, I browsed the internet for other supplemental resources to add context to what I was learning. Eventually, I began reading about Javascript frameworks “Learn Angular vs. Vue”, I couldn’t wrap my head around what a framework actually was. I was under the impression that frameworks would make learning how to code “easier”.

Fast forward 2.5 months into my coding bootcamp, and I am learning the ropes of Rails. So, now that I’ve learned and built a project using a framework, how would I define a framework to a total code newbie? Frameworks, and in this case Rails, didn’t make learning how to code any easier, but it did lay out a lot of groundwork so I could hit the ground running with building my web application. Frameworks use abstraction (high level code) in order to provide a foundation to build off of. For example, typing rails new unicorn creates a directory which provides a standard layout of how to organize the files within your application named unicorn. Also, Rails comes with generators in which you can create tables from the command line, instead of having to create a file in your text editor and write out the code in the file in order to create a table. Not to mention, the infamous scaffold generator, which creates CRUD functions for a model by typing out one line in the command line!

In short, you can think of a framework as a piece of software built because someone identified that there was similar code/ patterns that had to get built out each time a new application is built. In the context of Rails, David Heinemeier Hansson put in the legwork in order to make it more efficient for other developers to build an application. There’s even extensive and fantastic documentation to demonstrate how to use the framework https://guides.rubyonrails.org/.

I remember bringing this topic of “What is a framework?” up with one of my instructors. I first told him what my initial idea of a framework was— training wheels, since frameworks do a lot of the work for you. However, this setup is not trivial. It’s important to understand Ruby well before jumping into Rails, so you are able to understand and have context with the magic (really abstraction) of Rails. My instructor opposed my analogy, and instead, he said think of using frameworks as standing on the shoulders of giants. Well said.

Back to the Drawing (White) Board

The project I built using Ruby on Rails is a private group class tracker for a yoga studio.

Sounds like a mouthful, I know, but I noticed that the yoga studio I work for has a niche problem. Local organizations such as universities, non-profits, corporations etc. request for a yoga teacher to come onsite to teach a class. Most of the time, these requests are inconsistent. For example, an organization will want a class for their “Wellness Week” which only happens a couple of times per year. Since requests are inconsistent, the same client will have a different teacher each time. The teacher assigned for this offsite class has no idea what kind of class to plan. What kind of practice do the participants want? What is the space like? It would be nice if they could take a look at the class plan from the previous class, that was perhaps taught by a different teacher! That’s where my web application comes into play!

My enthusiasm for my idea fueled the creation of the project, however this was the toughest project yet. Here’s what I learned:

The importance of having a clear vision for your project before you get started.

I had to restart my project twice! I had to restart my project because both times my domain was not clearly defined from the get-go, which made building complicated (lesson learned!). However, each iteration of my project led to my final product, which I’m very proud of. While I shared with my friends and family about my tribulations, I compared my process to something they were familiar with, writing a thesis paper.

The first step is to clearly construct a thesis statement, in coding world this would be constructing our domain models and defining relationships. The thesis statement steers the ship as you’re writing the paper. Similarly, your models and relationships can create the backbone of your Ruby on Rails application. If you write a thesis paper without properly researching a topic, as you’re writing, you may have a change of heart with your beloved thesis statement. Now that you’re reading additional sources and are really diving into the topic, perhaps you want to change your stance. So you go back to the drawing board and rewrite a thesis statement that better represents your positioning now that you have new information. You have to start your paper all over again. Similarly, as I began to bring my project to life, I realized there was a better way to represent my project— different from the models and relationships than what I had set up. Since I wanted to change the infrastructure of my project, I had to restart my project.

Knowing when to let go if a certain idea isn’t working out.

It’s tough to abandon a project after spending a lot of time on it. I spent 4 days on my first iteration, knowing most of the time that I wanted to restart it and take it in a different direction. I was so resistant to restarting, but once I took action and restarted, I felt a surge of momentum because I knew it was aligned with my vision. To make myself feel better about my situation, I thought about how artists record entire albums that never get released and fall to the wayside. Authors write novels that never get published. Although these pieces never make it to the public, I bet these creative pursuits influenced other pieces that eventually did reach a broader audience. Similarly, my failed projects influenced the success of the final version of my project.

Get to know the gems you’re using.

Since I restarted my project twice, I can now set up Devise and enable Omniauth using Facebook with confidence. This was my first time using both Devise and Facebook Omniauth. Typically when I use a gem for the first time I find a blog or video to guide me through step by step. The downside of this method is that I blindly follow step my step without internalizing or completely understanding what’s happening. For this project I was able to set up Devise and enable Facebook’s Omniauth three times, so now it’s solidified in my brain. It got me thinking, that for future projects when I’m using a new gem I should make sure I really know what the gem is doing, so when if I run into a bug I’m better equipped to resolve the issue.

Nested resource show page

A feature of the app I was excited to implement was to view the history of classes by client. This would help the user zoom in on which templates to research and take ideas from.

Each class would be represented by a link that would then take the user to a nested resource show page, which would have all the available information about the class.

The code behind this feature was fairly simple, yet important to break down.

<p>History of Classes:</p>
<% @client.yoga_classes.each do |yoga_class| %>
  <%= link_to yoga_class.title, client_yoga_class_path(@client, yoga_class)%>
<% end %>

In my client model I defined the relationship that a client has_many yoga_classes. This then gave me access to call on an instance of a client and a list of their associated yoga_class objects which are assorted in an array. Then, I called an iteration on each yoga_class to create a link for the specific yoga_class. With link_to, the first part of the link is what the name of the link is, and the second piece is the path the link takes. So, I named each link the title of the yoga_class. Then, I used the route helper (route helpers are a piece of magic given by Rails) client_yoga_class_path(@client, yoga_class) so that a specific class would be nested underneath the client. @client was the first argument of the path because the helper needs to know which client_id will have all of its associated yoga_classes listed. Then, the url needs to know which yoga_class to route to based on the yoga_class id attribute. This helper is constructing the following template of the url: /clients/:client_id/yoga_classes/:id. As you can see in the screenshot above, the yoga_class has a client_id of 5 and an id of 4.

Just getting started….

Building the private group class tracker application taught me A LOT. I have a lot of ideas about what kind of future implementations I want to build for the app- like duplicating a template, since there should be a template representing each time a teacher taught a yoga class. Also, I’m looking forward to learning JavaScript and React to enhance the UI of my application. This is just the beginning!

The Halfway Mark!

Last week marked the halfway point for completing Flatiron’s Online Software Engineering program. The program moves so quickly that it’s hard to stop myself and think, wow, I can build entire web applications when two and a half months ago I was learning the elementary basics of Ruby. The minimal coding experience I had coming into the program (I have taken some courses on HTML, CSS and began teaching myself Javascript) as well as previously working on the tech team of a startup gave me sufficient context as to what I was getting myself into. However, the program’s curriculum is so curated that what I’ve learned in the past 2.5 months probably would have taken me years to learn on my own. Since I’m at the halfway mark, I thought I would share the obstacles I faced and my method of overcoming them.

When to Stop Working

I love the flexibility of learning on my own terms. However, with this comes an undefined start and stop time. You can never be finished with learning how to code. This concept of limitless knowledge is what attracted me to the subject, but as a human being who has relationships, other responsibilities, and a desire for a hefty self-care practice, I had to draw a line with when to stop coding. I make sure to stop learning by 8 p.m. each night. I drew this line because I am unable to sleep well if I have screen time late into the night. I have found that when I cross this boundary, I wake up several times throughout the night and I don’t feel as well rested for the next day. I also set boundaries for when I start in the morning as well. I don’t start coding until 9 a.m. after I have my morning routine of activities that sustain my coding practice— like meditation, yoga, and journaling.

Getting into a Routine and Schedule

This is related to my learnings above, but it’s important to identify when and where you get your most work done. When I first started the program, I stuck with the 9-5 routine I was familiar with. This was problematic because I was rushing to get to my computer by 9 a.m. to begin learning for the day (note: a racy mindset is not good for learning…) and some lectures were getting scheduled post 5 p.m. I learned I had to be less rigid with my schedule. I learn best during the day, so I made sure to do schoolwork for 11 a.m.-4 p.m., and threw in learning time at other parts of the evening depending upon when the live lectures were or how I was feeling.

Also, I learned to be less rigid with where I decided to do my schoolwork. As part of the program, Flatiron gives you access to a WeWork space. I take full advantage, I spend 30 hours a week there. However, if I have an hour and a half lecture to watch or am feeling unwell, it doesn’t make sense to force myself to remain in an environment that isn’t supportive to my learning. Also, on weekends I got to coffeeshops to work as a change of environment and to be around different people.

Meeting with Others to Talk About Code

Flatrion gives you great resources to meet with others. 1:1’s with your cohort lead, pair programming sessions, and organized Study Groups. However, it’s up to you, as the student, to take advantage of these resources. I was on top of creating agendas for my cohort 1:1’s to best make use of the time and was meeting with my partner for pair programming. However, in the beginning of the program, I wasn’t attending Study Groups live. Since the Study Groups were recorded, I figured I could learn just as much at a time that was more convenient for me. But as I was watching the recorded versions I realized I wasn’t experiencing the ‘magic’ of a live lecture. The possibility of getting called on to answer a question, or having an opportunity to ask questions you have are components of what makes a Study Group truly special. This type of interaction helps cement concepts. I stopped perceiving Study Groups as optional and started fitting them into my daily schedule. To enhance my communication with code, I also began meeting with a classmate outside of who I was paired with for Pair Programming. Having additional practice with sharing what I was learning has been super helpful since this program is primarily self-driven.

I’m motivated to take on the second half of this rigorous program. I’d like to think that I’m a bit wiser about my plan of attack to finish up the program strong. Whenever I feel stuck and like I’m going nowhere (I feel this AT LEAST several times a week…) I watch this video by Flatiron’s CEO and founder Avi Flombaum:

I love this video because he doesn’t believe his bootcamp is an easy quick fix to learn how to code (wouldn’t that be nice if that actually existed??) but he does believe that continuous small steps will lead to progress and success.

My First Sinatra Application

I built my first web application! That other people can log into and use! Our project’s requirement was to build a web application using Sinatra as our Framework. I felt like a baby taking their first steps on their own. I was slow and wobbly, but with my earnest attitude I persisted.

My application is named My Book Collection. With My Book Collection you can view all of your books in one application. If you’re anything like me, you have books in different places. I have books in my living room, in my bedroom, and even at my friends’ houses. It can be tough to keep track of where all my books are, especially if I loaned them to a friend. You can view all of your books on a single page with My Book Collection and click on a book to review the book’s status (if it’s on loan, read, unread etc), as well as the book’s author and genre.

My Process:

Before I started coding, I wrote out user stories in my journal. How I expected the app to function, what I wanted the app to accomplish etc. This gave me a clear vision and limited the decision making I had to make while coding. Specifically, I only wanted users to interact with the app if they were logged in. Similarly, I knew I wanted users to have the capability to edit their own book collection.

Main Takeaways:

How to deploy an app on Heroku.

Heroku is a platform where users can deploy their web applications on the web so other people can use it. It took some time to successfully connect my GithHub account with Heroku. When I use a new platform I tend to take the process very slowly to ensure I’m not just mimicking steps but rather understand the process. I envision myself using Heroku for many projects in the future, so understanding how to upload a web application this time around is helped out my future self.

Taste of Ux/UI.

Although my main focus with this project was to understand the backend and how my objects interacted with each other, I had some moments of considering the user experience of my application which was new for me. When I am working on my labs, I’m not as focused on the Ux because my name isn’t tied to the project. However, My Book Collection is completely my own! For example, initially, I had a delete button too close to the edit button. I imagine users will want to edit their books often, it would be frustrating to delete a book when all you wanted to do was update its status! Therefore, I increased the white space between the edit and delete button.

ActiveRecord CRUD.

ActiveRecord comes with many helpful methods to call on objects in order to create, read, update, and destroy objects. This documentation here https://guides.rubyonrails.org/active_record_basics.html was a great reference. I ran the rubygem Tux so I could create and play around with objects in my terminal to test my application’s onjects to make sure they were interacting with one another correctly. Alternatively, I could have created seed data to have for my app, but I wanted to play around with ActiveRecord’s CRUD methods to get more comfortable with them since I was planning to include them in my code. The method that was the most fun to use was the .where method. Calling .where on an object is the SQL equivalent to saying:

Select * from table where column_name = 'condition'

This was helpful because I only wanted users only see their own books. I then added the .each method in order to iterate over each book so it could be listed separately on the user’s page.

<h1>Here are all of your books:</h1>
<%Book.where(user_id: current_user.id).each do |book|%> 
<ul>
  <li>Title: <a href="books/<%=book.id%>"><%=book.title%></a>
    <p>Author: <%=book.author%><br>
    Genre: <%=book.genre%></p>
  </li>
</ul>
<%end%>

Don’t be intimidated by errors.

The instructors at Flatiron try to reinforce the fact that most of the time code is going to be broken. For the most part, I’ve embraced this and this mentality helps when other things besides code aren’t working projects. For example, I ran into an error with Shotgun, which is a RubyGem that let’s you run your application on your local server and updates changes you make in your code in real time, so you don’t have to stop, code, save, and run the application.

The error caused my browser to look like this:

This was in my terminal:

Set SINATRA_ACTIVESUPPORT_WARNING=false in the environment to hide this warning.
objc[1464]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called.
objc[1464]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

Luckily, I googled my error and found that other people had the same issue and there was a Issue thread on Shotgun’s GitHub repository, link here: https://github.com/rtomayko/shotgun/issues/69. I ran through all of the suggested resolutions, and ultimately I had to update my Mac’s software to Mojave and then install macOs’ Xcode which added components to get Shotgun up and running. It probably took me 3 hours to resolve this issue, between the software updates, trying out different resolutions, and talking to my fellow cohorts to see if they had any ideas. However, this experience taught me that I’m not alone with the issues I experience. There are very generous people out there who have run into the same error and decided to write about it! Also, I was proud of myself for remaining level headed and persisting in order to solve my problem.

As always, I learned a TON about ActiveRecord and Sinatra by building my app. It reinforced my foundation which is important for our next section… Rails!

P.S. here’s a walkthrough of the app!