From the Blog
-
Using Spaced Repetition to Learn Programming
Do you ever wish that you could memorize an entire programming language and all of the libraries and APIs that you use constantly? Want to become as fluent in the technical concepts and jargon as you are in your native language? Well, that is what spaced repetition is for. Spaced repetition will help you efficiently…
-
Organizing large Rails projects
Do you have a Rails app that has gotten so big it is getting hard to know what is going on? When you have a new Rails app it is easy to tell what the app does by looking at the files in the models’ folder, but as the app gets bigger you often lose…
-
Using Rails form objects
Update: User MelissaLiberty from Reddit pointed out how they would improve the form object and some of it faults. This post has been updated to reflect their excellent points. Often, when we start a new Rails app we start with simple controllers, and we start by generating everything with scaffolding. There is nothing wrong with…
-
Killing dead Rails controllers
So you’ve inherited an app. It is pretty well tested and doesn’t throw too many errors but the app is big enough that it is hard to tell what is going on most of the time. The original developers are long gone and you need to build new, mission-critical features into the app but writing…
-
What is a good first programming language?
There are loads of ways to get into programming and I think I have tried all of them. The first language I tried was Visual Basic because my father had an instructional book laying around and I was bored. Later I taught myself HTML and then JavaScript because I wanted to make websites on Geocities.…
-
Should you add Gemfile.lock to Git?
TLDR: Yes for apps. Yes for Gems. Do you use version control to keep track of changes to your codebase? Or do you think version control is for the cowardly and just change files in a shared team folder and hope no one else is changing it at the same time? Of course not. You…
-
Rails Benchmarking
So, you want to know fast your Rails app is going? If you just want to see how fast a bit of code is you can use the Benchmark module which is part of the Ruby Standard Library. If you want to compare two or more bits of Ruby code that do the same thing…
-
Cleaning up a messy Gemfile
Maintaining a clean and organized Gemfile is crucial for the long-term health and readability of your Rails application. As applications age, their Gemfiles can accumulate complexities and messiness. In this guide, we’ll explore some rules and best practices for crafting a clean, readable Gemfile that fosters maintainability. 1. Group Gems Effectively Divide your gems into…
-
Keyword (Named) Parameters
Introduced in Ruby 2.0, keyword parameters provide a way to pass arguments to a method by explicitly specifying parameter names and their corresponding values. This feature proves valuable, especially in scenarios involving methods with numerous parameters, as it significantly enhances code readability and clarity. Example Usage: Definition: When defining a method, keyword parameters can be…
-
Arrays in Ruby
Arrays are ordered collections of objects. They can hold any type of Ruby object: numbers, strings, other arrays, hashes, classes and methods. Here is what a basic array looks like and is used for: Arrays are created by placing a list of objects between square brackets. Accessing arrays The data in these arrays can be…