DEV Community

Lucia Velasco
Lucia Velasco

Posted on

Things My Trainer Told Me Not To Do

When I went to Mayden Academy I was inducted into the wondrous world of software development. Sometimes what you're taught to do doesn't stick with you as much as what you're taught not to do. That's a good thing!

Here are some sage nuggets of wisdom. Whatever you do, just remember not to...

Skip Ahead

No! You really ought to know what a function is before you try to unit testing... And no, you'll find out about OOP in a few weeks. I don't care that your older brother told you it's faster in jQuery, we're learning VanillaJS first. No! Put. The. Dollar. Sign. Down!

Bodge it

Hm... it's a good thing you all did your browser testing! After all, we're using VMs for a reason! You did do your browser testing, right? Okay, good. So now explain to me why only half the site is actually on the screen in IE11... And is there a reason you're running a loop that does nothing? 40 times?

You might feel the temptation to...

  • Skip code review
  • Skimp on code review
  • Ignore accessibility

Don't.

Make it work... no matter the cost

$ git push --force

Where are everyone else's branches, Lucia? DESTROYED. BY YOU.

!important

Lucia. You just spent thirty minute trying to figure out why your red text wouldn't turn blue. You know why that was, Lucia? It's because you used bang important. What did I tell you to never, ever do (unless you're me) in css, Lucia? I TOLD YOU NEVER TO USE !IMPORTANT, LUCIA.

sudo [all the things]

Okay look. I don't know what you did, or how it broke everything, but even though we turned it on and off again, uninstalled all the things, wiped your laptop twice, reinstalled some of the things... in the end we just had to burn it. Everything was broken all the time.

Burning...

Change history

$ git rebase

$ git reset --hard

Just use $ git revert!

When you're new to git I guarantee you will lose something to $ git reset --hard.

A transparent, thorough commit history is your friend. It's also your team's friend - they need to learn from your mistake, too! And doesn't it feel better to have zero chance of losing all your work forever because you didn't run that git reset (and didn't know about git reflog)?

Select all the things

SELECT *

$ git add .

DO YOU KNOW WHAT'S IN THAT DOT?! NO, LUCIA, YOU DON'T. Congratulations, you just committed the file you made to jot down the wifi details while I was talking. That could have been patient data, Lucia. PATIENT DATA. Why would you do that to those patients, Lucia? Why?

Ignore the inspector

Your button isn't doing anything on click? Okay. What's in the console? You haven't checked?!

Why do I bother...

Do what I did; get really fast at opening that inspector and pretending it had been there all along.

Ignore basic security

Your queries are unparameterised, your validation is missing, your password's hashed but not salted... and you're using sha-1? Seriously peeps, bcrypt, I told you it was the only way to go. Aaaaand now I have admin access to your CMS. Look who's about to publish a blog post on how awesome I am!

Top comments (7)

Collapse
 
pkristiancz profile image
Patrik Kristian

I imagine that guy screaming behind your shoulder πŸ˜‚
But generally: do it only when you know what you are doing :)
I think you will not like me, because I often:

  • push β€”force
  • use linux as root
  • rebase
  • reset

πŸ€ͺ

Collapse
 
luciavelasco profile image
Lucia Velasco

Haha, definitely! If you can understand what it does and how it will work, you can use it.

But rebasing will always make me shudder ;)

Collapse
 
pkristiancz profile image
Patrik Kristian

If you habe talent for git, you will get used to it. If not (like most devs), use basic 5 commands and be glad to be glad πŸ˜‚ :)

Thread Thread
 
luciavelasco profile image
Lucia Velasco • Edited

Mm, I would say I have a talent for git. This article is based on my experiences training years ago :)

I also have a talent for keeping a comprehensive history... people have preferences, mine is for merge, and it's an informed decision, not one stemming from a lack of talent or experience.

Thread Thread
 
pkristiancz profile image
Patrik Kristian

so good for you :) i got into rebase way, at my first job it was this way and it sticks. plus i like linear history :)
and Lucia! never do sudo rm -rf β€”no-preserve-root unless you want to discart machine. (Scorched earth) πŸ˜‚

but anyway, nice sum-up

Collapse
 
guneyozsan profile image
Guney Ozsan

The moment I realized Lucia was actually you at the end:) Anyway, nice one, thanks.

Collapse
 
jakedohm_34 profile image
Jake Dohm

Haha, this cracked me up! GREAT JOB, LUCIA!