Home » Articles » Why is it so hard to write code?

Why is it so hard to write code?

Tue Jul 5, 2016

Master things that don’t change, like the underlying technologies have been around for 20 years. When you understand the core principles, you can learn anything. - Chris Lee

It seems nowadays, beginner programmers and developers are enjoying reading books, watching tutorials and going to conferences without even writing a single line of code. Hell, I’ve seen conferences where people gather to listen to some dude explaining how to build software when he hasn’t written a single line of code. Why is it so hard today to just fire up a text editor and write a “hello world” utility/program? Or, in the age of the feature-full web browsers, to just drop to the browser console and test your Javascript skills?

You don’t need npn or node.js or jQuery, gulp or bower or Composer, you don’t need Cloudflare, Github, some fancy DigitalOcean droplet or Amazon instance, you don’t even need to know git or subversion (or that god-forsaken CVS). All you need is a pen, a piece of paper (you’ll see later why), a text editor (all operating systems have one of those installed by default), your brain (let’s not get there, shall we?) and depending on the language you want to learn, a compiler or interpreter. Oh, and the most important thing actually, a working computer.

And, you need to think in small steps in order to get the bigger picture.

Editors

And don’t even get me started on the whole text editor debate: “Sublime Text is good, Notepad++ is bad, Atom is godly, Visual Studio Code is so good it makes Vim look like Visual Basic (do not hate the man, hate the message), Vim is what real developers use”, etc. Use the editor you find it complements your skills best and move on from this endless debate. You need to open 100Mb files fast? Sublime. You’re a big fan of Open Source? Atom. You dislike Electron and Electron-alike frameworks? Sublime. You like Microsoft? Visual Studio. You hate Microsoft? Atom. Linux? Vim or Emacs. You’re stuck on Windows and all other editors look like aliens to you? Notepad for f**k’s sake. See how easy it is to make a choice? And move on to actually creating something.

As a side note, you never heard about Picasso bitching about the brushes he used (as a side-side note, on Wikipedia you won’t even find information about what brushes he was using), mainly because it’s not about the tools, it’s mostly about the bigger picture (let’s call it masterpiece), the artwork, the feeling you get when you’ve completed something and you call it yours (and maybe even sign it).

<INSERT NAME OF EDITOR HERE> is not what real developers use, real developers WRITE stuff. Real developers work their mind into solving issues found in actual code or implement the said code according to specifications. Real developers couldn’t care less what is the newest trend in text editors, IDEs or languages is in <INSERT CURRENT YEAR>. Real developers use the language(s) they know and see fit for the project they are currently working on. If the project requires a new language they do not know/master, they will learn it and maybe, just maybe, bitch on their blog because stuff is not implemented the way they’re used to.

Now you have a text editor (or an IDE, whatever floats your boat) and hopefully a working computer running a working Operating System, let’s see how the usual 2015-2016 developer mind works.

Tutorials and videos

Do not, and I beg of you, do not start by watching Youtube videos about how to write code. Writing code is very easy and usually starts with … surprise, actual code. Start with declaring a variable. Follow with a constant. Create a function. Alter the variable. Alter the constant (now you should see your first error). And so on. You do not need someone to show you how he’s writing code in his favorite language, in his favorite editor, on his favorite beach in his favorite country. Not to mention his favorite freaking notebook! Watching some dude writing code is as helpful to you, as a beginner, as much as colon cleaners when you had a heart attack: It makes you feel better, but did it help in the end?

Everywhere on social media (Twitter, Facebook, Google+ <does it still exist?>) I see people recommending videos. “Hey dude, check out this video of this dude that explains how to rub your neck using just your pinky finger!!” or “Check out this dude, he’s got a bajillion Facebook/Twitter fans/followers, he must know what he’s talking about.” Chances are he knows shit (unless he’s Anders Hejlsberg, Rasmus Lerdorf, Yukihiro Matsumoto, such people. Geniuses. Or David Heinemeier Hansson and he’s talking about his Le Mans races) and he’s a software marketer (or, how we, developers, like to call them, leeches, because we write the software and they teach us how we should sell the software and get a 10% profit out of it. It’s a joke dude!)

It’s amazing and very saddening to see people that might be brilliant programmers wasting themselves in an endless circle chasing their tail while endlessly watching tutorials and reading books and never getting to the point where you create a new file in a text editor and … just start writing code. That’s how you learn, from your mistakes, not some book’s errata.

Methodologies (TDoTDN - to do or to do not)

Another thing that is very common among seasoned developers is to recommend beginners to start with acronyms. You gotta do TDD dude, you’re not a developer if you don’t! If you don’t speak Agile, you’re just a peon! SemVer? Yes, but stirred or shaken? To Scrum or not to Scrum, that is the question! TSP! DDD! LSD!(not the drug dude, not the drug) MTD! ATDD!! XP! BDD! WTF! RTFM! And so on.

And all this is gonna give you ADHD if you actual pay attention to this crap as a beginner. (don’t get me wrong and read what I’ve said as “I do not need to learn any software methodologies.”, because you do. God knows you definitely do. But probably you will need them after you get hired by a big company, not when you’re writing Avada (all common Wordpress theme that everybody loves or hates, it’s a tough decision) theme-variations for a one-bedroom company that has a lot of coding-mill contracts.

Suggestions?

I don’t have many of those, except start writing code. Start with a pen and blank piece of paper (or a Moleskine) and sketch down the structure of your idea. Separate it in small milestones and work on them separately. When you’re bored of writing database abstractions, work on the User Interface and you’ll learn new stuff. Bored of UI-related stuff? Learn what an API is and think like an external user that will have to interface with your application/software/utility: how can it be done, what does an API imply, security, privacy, etc. Soon, from a variable definition you will have a small project that you enjoyed building and, who knows, might get you hired by Google. Or Volkswagen, if you’re into software that cheats gas emissions. If not, it will look great on your resume.

Be that programmer that I love to meet, don’t be that one that always posts videos on various forums/social media without any explaining thinking everybody has a Flash-player installed. Or has high-speed internet always available. Be that programmer who, when asked, can think of at least one program/application/utility he loved to build and feels really proud of.

For millions of years mankind lived just like the animals, then something happened which unleashed the power of our imagination: We learned to talk write code. - (as a variation of Pink Floyd’s song, Keep Talking)


  « Previous: Next: »