In the 20-plus years I've been at it, I've seen it all. But mostly I've seen the same mistakes over and over again
Coders are gonna code and newbies are gonna noob. Sometimes, even experienced coders make newbie mistakes. In the 20-plus years Iโve been at it, Iโve seen it all. But mostly Iโve seen the same mistakes over and over again.
These common mistakes are of the tactical variety. You should also do good hygiene like use revision control, but even if you do good hygiene you may be making these other tactical mistakes, and suffering as a result.
Noob mistake 1: Use Make or Shell as a build tool
If youโre not writing C or C++, Make is probably not your friend. Make launches another compiler process for each file. Most modern languages are not designed to have a separate process launched for each file. Also resolving dependencies in a language like Java using Make is nearly impossible.
I once worked at a large network equipment company and shortened its build process from three hours to like 20 seconds by converting its build to Ant (a Java build tool, modern at the time).
A shell script is also usually a bad move in the end. I recently wrote a shell build for a lab because I didnโt want everyone to have to download a whole Java tool set to run one little lab. I thought it was a good move, but it was a noob mistake (as always) because the next version of the software it depended on broke everything (as always). Had I sucked it up and provided a modern build tool, it would have been able to update the dependencies.
Noob mistake 2: Use an IDE as a build tool
Most IDEs have some magic build/deploy thing. These seem nice at first, and indeed they are great for just testing your own simple code. But eventually you have dependencies and other people working on your code. Then you just donโt know why it builds on one machine and not the other. You need a repeatable build that can be run in a continuous integration tool and outside of your IDE. Something that can be staged and done as part of a release process.
Noob mistake 3: Terminate an AWS instance
โTerminateโ in AWS means โdelete everythingโโnot the โend processโ meaning it has in most other tools.
The first major Amazon Web Services project I was on, a developer had assumed that a tool to read attributes would be safe to run. Unfortunately there was a terminate attribute where, if read, actually terminated the instance. He ran it on everything and terminated more than 100 instances. AWS has made it harder to make these kinds of mistakes, but frankly โterminateโ should have been called โdestroy permanentlyโ because developers terminate processes with glee knowing they can relaunch them. But if you terminate an AWS instance, you lose everything!
Noob mistake 4: Test on something you care about
The aforementioned developer made another noob mistake: He tested on everything we cared about. Instead, he should have tested on a single instance that he created just for testing. Even if you think what youโre doing is harmless, test that assumption safely.
Noob mistake 5: Seek absolute data integrity
Iโve seen more than one developer use READ_SERIALIZED and use table locks because they wanted really, really good data integrity. There are other lock-producing obsessive-compulsive disorders. They all amount to bad schema design and unrealistic understandings of data, concurrency, and risk.
Noob mistake 6: Put code in your HTML or HTML in your code
Whether it is ASP, JSP, PHP, CGI, or straight code, there is nearly always some way to shove code in the middle of HTML, and thereโs nearly always a way to do something like out.println(โ
This is a terrible idea
โ);. There was a time and a place for thisโand that time was like 1995.
Yet there are more modern permutations. Iโve seen some gross stuff people are doing with JavaScript that is pretty dรฉjร vu. There is always a better way: a tag library, an event handler, โฆ really anything but HTML code.
Noob mistake 7: Use the almighty list
I admit to doing this in prototype code when Iโm not sure how the data is shaped, but I quickly abandon this practice once I know. People who started in high-level languages are the most guilty of this. What is โthisโ? Basically, instead of using a map, a tree, or a set, you stick everything in a list and sort it yourself too. Worse, you pick an array back list and keep inserting somewhere near the center.
The trouble with this kind of code is it tends to make it to production. Though, I guess itโs good to load-test the garbage collector or memory management in the operating system some of the time. !!!
Noob mistake 8: I
Woohoo! You took a class on decomposition. You decided that your first best step was to totally organize everything into perfect class hierarchies. You forgot about just containing stuff or making your program functionalโno, youโre going to make everyone learn how your brain works first and keep in mind an ugly set of parallel class structures. Oh my gosh, just go work for the DMTF now.
In other words, you can put out trash standards to give everyone headaches. Donโt!
Noob mistake 9: I
You just learned all about functional programming. You think object-oriented programming was a big mistake and that everything should be stateless and functional. Good for you.
Except if I need to add one more thing to the code, if I have to unravel every single function call to add it, you have failed. You have failed miserably.
Noob mistake 10: I
Coding is hard, thinking is hard, and deciding the scope of something is hard. But you decided not to bother and just use the most public scope you could. You killed memory, your code canโt be parallelized, and there are thread conflicts. But, hey, donโt put yourself out!
Noob mistake 11: Use big mega-objects
Once when I hanging out on a gig with a new trainee, I told him that the gig would go one of a few ways. One was that theyโd throw the โbig mega-objectโ into the session and wonder why โclustering doesnโt workโ and why they ran out of memory.
Sure enough, when we arrived we found that they had a class file with hundreds of state variables and methods to permute them. Of course, they were shoving it into the session. Most of those things didnโt really need to go in the session and were there essentially for formation of a second-level database cache written poorly by hand. It was a huge waste of memory and replicating it was both thrashing memory and causing needless costly session replication.
Noob mistake 12: Death by a thousand objects
Just like you can have too few, you can have too many. Death by a thousand objects tends to come with noob mistake 8, I
Noob mistake 13: I can haz threading?
Most application code can be written with a single threaded view of the world. Although that breaks down when you start writing application servers, databases, or other infrastructure, most business software can be written using such infrastructureโso you donโt need to write those and thus go all multithreaded.
So donโt. Especially now that itโs getting easier to not write threaded code yet distribute and take advantage of threads. Look at how Spark works: You donโt go around constructing thread objects.
Noob mistake 14: Use of row locks
This really is a problem for SQL Server and DB2 users. The default database settings are for row locks on most platforms (DB2 does page locks on other platforms, which is worse). Oracle has less-stupid defaults. There used to be a debate about row locks vs snapshot isolation. Theoretically row locks are more efficientโuntil you have even one more thread with any possibility of contention (that is, nearly any modern piece of software).
Most developers donโt know what โsnapshot isolationโmeans let alone, how to turn it on. So things start mysteriously hanging in production under load because theyโre using row locks b. Learn about snapshot isolation and how to use it properly. Avoid row locks.
Noob mistake 15: Use of sequences
Repeat after me: I will not use database sequences for unique keys unless I actually need sequential values. (Which is very rare.) Therein lies locking and remoting in one โconvenientโ painful package.
Instead of single-threading everything through the database sequence generator, you can use a 128-bit UUID backed by a secure random generator. If youโre afraid of duplicates, either youโre bad at math or you donโt value your life as much as your data. You have a far better chance of being hit in the head by a meteoroid even after youโve generated a trillion IDs.
Hopefully, you respect yourself, your profession, and whomever has to maintain stuff after you. So donโt do this stuff. Even though you probably are: After all, even experienced developers sometimes make noob mistakes. Go forth and sin no more.


