You want to become a great Ruby developer, but there are lots to learn! Follow me and I’ll help you write professional code.
What should you do when you get tired of coding?
Someone asked me: âWhat should you do when you lose the enthusiasm for coding?â I got tired of working as a software developer 3 or 4 times in my career. Maybe more. I had burnouts as well, and I didnât even know what burnout was until a couple of years ago. đ Losing the enthusiasm for coding can be normal: itâs hard to do the same thing, day in day out, and not get sick of it after so many years....
New job, new codebase. How do you even get started?
One of my readers asked: How do you get started when you join a new company? How do you add features to a codebase that is massive, scary, and completely new to you? The first day at your new developer job is just like the first day at a new school. đ¸ A sea of strangerâs faces watching your every move. Unfamiliar smells in the hallway. Every chair is uncomfortable and makes weird noises when you sit....
How to Learn the Syntax of a Programming Language When You Know How to Code
Are you having a hard time picking up the syntax of a new programming language, even though you know how to code? Youâre new to Ruby, and people say itâs an easy language, but you find the syntax difficult to understand. You know a bit of Javascript, Python, Java, or any other language. But Ruby seems like alien technology to you. By the end of this post, youâll have a tool to help you transfer your knowledge of [INSERT PROGRAMMING LANGUAGE HERE] to Ruby....
Learn Ruby on Rails Best Practices With One Exercise
You want to write smooth professional-looking code. Youâre craving some squeaky-clean code. But all you have for lunch every day is a big bowl of legacy spaghetti code. You consider yourself a decent developer, but youâre never sure how to organize a project. How to name things. Where some piece of business logic should live. How can you become a Ruby on Rails expert if the code you read every day stinks?...
How to Write a Clean Order By Case Query with Arel on Rails
Youâre working on a feature and someone tells you that one of your models needs to be ordered based on some complicated rule. You realize youâll need to write a complex order by query⌠Hereâs how it usually goes: You think to yourself: âShould I write an order by case when statement? Maybe Iâll just add a little bit of SQLâŚ" Two minutes later, you end up with a bunch of nested case when statements, subqueries, common table expressions, angry statements, shouting, and a whole lot of tears....
What's the Best Way to Learn Webpack?
If youâre feeling lost whenever you have to add some javascript library to your Rails application, this post is for you! I see a lot of people battling against Webpacker whenever they need to add a new javascript library or have to fix a bug on the asset pipeline. I suffered from the same problems, too. I talked about why this happens on a previous post: âAdding Bootstrap or Javascript Sprinkles to Rails breaks everything....
Adding Bootstrap or Javascript Sprinkles to Rails breaks everything. What should you do?
Did you spend a billion hours trying to add jQuery, or Bootstrap, or Tailwind to your Rails project, but now everything on the frontend is broken? Or worse: you canât even tell whether the frontend is broken or not. Itâs in a unkown state of brokenness. Maybe you just want some javascript sprinkles, but Webpacker makes things so much harder and frustrating. Do you wait until an angry customer complains about the checkout button not working anymore to know which page to fix?...
Move From Sprockets to Webpacker On Small to Large Rails Apps
Rails 6 comes with Sprockets and Webpacker by default. Confusing, right? The default configuration is Webpacker for Javascript while Sprockets takes care of all the rest (CSS, images, fontsâŚ). Let me tell you a secret: You donât need both. Just use Webpacker. Legacy applications and older gems still use Sprockets to serve assets. This was done to add backwards compatibility. If you donât have a good reason to keep Sprockets around, donât....
How to pick your first Rails Issue and start contributing to Open-Source
Did you always want to help an open-source project like Ruby on Rails, but never got started? Many people have the interest of contributing to open-source, myself included. Iâve done a couple of small contributions, but nothing fancy. Itâs a little intimidating, right? Youâre not part of the group of contributors and you donât really know where to start. You see 800 open issues, which one is a good one to pick?...
How should I change production data on a new Rails application?
You need to change production data. You know that doing it manually is unsafe and will definetely cause lots of trouble, like corrupting all you customerâs data. How else should you do it? You might be spending a lot of time asking yourself these questions: Is there a proper rails way to change data in production? Should I run data and schema modifications in one database migration? Should I run rake scripts in production to modify data?...