DEV Community

Cover image for Quick Tips
agandaur-ii
agandaur-ii

Posted on • Edited on

Quick Tips

As I am sure many of you can relate, teaching yourself to code is hard. Even with going to a bootcamp, it's just a start. The farther away I get from my graduation date the clearer it becomes that I still have so much to learn.

Thankfully, I have some developer friends in the industry that have been giving me some tips and tricks to help me hone my new skills. But for anyone out there that may not have that luxury, here are a few things I have picked up from them along the way.

1. Always save

This seems almost ridiculous to mention, but it has caused me countless headaches. Why is this page not behaving the way I am expecting it to? I followed the tutorial exactly... What could I have possibly done wrong?? It just wasn't saved.

2. Make sure new changes are pushed/deployed

In a similar vein to the first point, your code may be working locally just fine, but if those new last minute changes weren't deployed, your app is going to look the same as it did yesterday.

3. Don't add things to the end of your host link

Speaking of deploying, make sure your host link doesn't have any hanging /'s or additional text. This cost me a number of hours of scouring the internet only to discover that a single "/" was the source of all my problems. If you are using an api controller structure (like api/v1) make sure you leave that off of your host link as well.

4. Find where your methods are coming from

Have you ever misplaced one of your methods in your rails app? Look no further than this:

MyClass.method(:method_i_am_confused_about).source_location

It'll point you right down to the line number where that sucker is located.

5. Did I add this method?

Can't remember if this method is one that you added or one that came out of the box? Give this a try:

MyClass.new.method - Object.new.method

6. Stop using git commit -m "My commit message"

Your git commits should be telling a story of how you write your code. It should be like writing a short, professional email to your future self and/or the team you are working with that describes exactly what you did. Check out this article to level up your git commits.

7. Fix mistakes in your git commits

It's a story now, and a professional one at that. But we are all human; we make mistakes. Lean on git commit --amend for when that happens.

8. Check out git rebase

Following along with the story, merging can make things murky. Check out the documentation for git rebase to find out when it is best to merge or best to rebase.

Top comments (0)