- Ben Goldstein
Sure, learning to code can help you land a great job. But the real value is in understanding memes. Right?
I love memes. They're a succinct, modern way of expressing meaning, and of course, they're fun.
One of the best parts of learning to code for me has been slowly understanding more programming memes. As you develop, you'll be able to understand more memes, and maybe create your own (or write some meme-worthy code 😱).
In this post, which will be a recurring series, I attempt to do something particularly unfunny. I'm going to explain memes. Here's a handful from this week that I thought were good, and can maybe help you get a better understanding of software engineering.
1. Bandaids Last Forever
Sometimes the perfect is the enemy of the good. And sometimes the hack lives on forever.
If you're learning to code, you may be focused on 'doing things the right way.' And, that's noble, and you should totally focus on understanding best practices.
But when you get into a job, you'll find that sometimes...priorities change. And certain things that could be done the right way, aren't -- for various reasons. Usually time.
That's what this meme is about. Often, spending the extra time -- potentially months or even years -- to get something done the 'right way' can mean the difference between your company living or dying.
And so, we live with hacks. Often, for a really, really long time. Why? Because once they're up and running in production, they can be very hard to remove.
2. The Google Problem
Sure, it sounds cool. But when I frantically google for Django answers, I don't want to watch Django Unchained. Unless things are really bad.
Some software languages have names that are very unique, and sound very 'software engineer-y.' Stuff like COBOL, Fortran, Erlang, and C++.
And then you have some languages that are named after pretty everyday things. Like Python, Java, Ruby. These are all fun when you come across them.
But! Once you start using any language a good amount, you'll find that you inevitably have to google answers to your questions. Like a lot.
And sometimes, you don't want to wade through a bunch of results about snakes (Python), coffee (Java), or precious stones (Ruby).
3. More Code = More Better?
So called 'one-liners' can sometimes be hard to read, but sometimes it's also just good to be succinct.
The code in both sides of this meme is basically equivalent; it determines if a number is even, and will return True if it's even, and False if it's odd.
Both pieces of code actually use the same key method for determining this, which is called a modulo function. Basically, a modulo is division wih remainder. So if you modulo 2 something, and there is no remainder, it's even. For example,
4 % 2 = 0, and
5 % 2 = 1. 4 divided by 2 has no remainder, so it's even. 5 divided by 2 has a remainder of 1, so it's odd.
In the code on the left, however, all of this is wrapped in a function
isEven, and then includes another variable
even before finally running through an if/else block to return true or false.
It's actually, in my opinion, not the end of the world to write code like the left side. It is, however, a lot more succinct to do what's going on in the right.
4. What's easy, what's hard - who knows!?
A scarf is impossible. But a hat...?
Once you have a codebase up and running, or say you join an existing project, many things may already be done for you.
This can be great! You don't have to implement things from scratch, you can just build on top of what's already there.
However, sometimes the existing code can cause a bit of a 'lock-in' effect, where doing certain new things becomes very difficult.
That, to me, is the spirit of this meme. Something that seems like it should be hard -- the lava -- is actually really easy, because it's all been set up for that. And conversely, something that should be really easy, like the scarf, ends up being a big, oof-y question mark. So it goes.