Skills, languages, and packages covered in this post:
Code examples in this post:
The goal of this project was to use React to create a user interface for visually analyzing up to four Twitter feeds as a dynamically-created wordcloud. To accomplish this goal, three main steps had to be completed:
To create a monorepo, start with a single folder for the entire project. Following convention to name folders and files based on their content, I called the housing folder for the example application ‘seedata-visualizer.’
Within the folder, create a new Rails API from the terminal…
Scope methods in Rails are special class methods enabled by the ActiveRecord query interface, which allows the programmer to write SQL queries without delving into full SQL.
Why would a developer want to use scope methods, or scopes?
Scopes are fast.
Compared to class methods written in Ruby, scope methods are incredibly fast. They can execute queries on the database and return desired results in a fraction of the time. While this might not make a difference during the development phase, it certainly does when an application is brought to scale. …
I set out to write a gradebook app teachers could use to manage students, course information, and of course, grades. A gradebook is a relatively simple item, I thought. Each course is essentially a table of students and assignments, at the intersection of which is their grades.
To accurately represent a gradebook, I decided four model classes were necessary: Teacher, Student, Course, and Assignment. These models all inherit from ActiveRecord::Base, since I have used ActiveRecord to manage my database.
Relationships Among Models
I was a teacher before I began coding, so I used that knowledge to structure my models. …
The biggest temptation, for me, during the first draft of a coding project is to put everything into a giant, tangled, single method. It comes from the way I like to write, which is to think about the logic I will use first and then write in a long, uninterrupted session until all of my ideas are on the paper. After that, I will edit several times for clarity, precision, and maximum effectiveness.
I have just started a software engineering program through the Flatiron School, and the school materials have been very clear about writing code in small, concise methods…
I have always been jealous of people who know exactly what they want to do in life. I have a friend who told me in elementary school that she wanted to be a zookeeper. That isn’t really so unusual; children love animals and often select exotic careers when they’re asked what they want to be someday. The thing is, she actually became one. Her social media is full of pictures and video with the animals she handles on a daily basis. She rescues opossums in her spare time. It’s fascinating, cool, and utterly unlike me.
So maybe it isn’t very…