My job is to write code that solves business problems.

Let’s talk about code complexity.

As a senior developer with 30 years in the industry I’ve see some beautiful terse one-line code snippets that amaze me what can be done in a single line. I see this in all the languages that I currently work in in: PowerShell, JavaScript, C#, F#, VB.Net, Java, Linq, and SQL. These are the ones I’ve worked with lately, but I’ve seen these terse code type construct in every language I every come across, and I’ve worked with quite a bit in my long career: ActionScript, IBM RPG, Swift, Basic, C, C++, Fortran, and Cobol. I list these not to humble brag on those languages I’ve used before but only to point out that poor constructs can be created in any language.

Some of my examples (and I welcome rebuttals on these.)

·        Powershell with its many chained command chained together using piping. Sometime this is OK but most of the time my task is to add a pipeline or change a where. Sometimes this is easy sometimes not. Also, Aliases should not be used in production scripts. The person maintaining that script may not know that alias.

·        The first thing I usually have to do with a complicated linq query is take it apart and see where I need to make my change. There is nothing wrong with linq and it can be used without continual chaining of the methods.

·        Javascript implicit type conversion can be a nasty source of bugs. Using Let instead of Var should be mandatory. A complete understanding of the keyword “this” is imperative especially when dealing with arrow, and regular functions.

My final point here is we as seniors are supposed to set examples to those, we work with that may not be experienced as we are. Another more important point is that my job is not to write fancy code that takes advantage of all the latest features. My job is to write code that solves business problems in such a way that my team members can come behind me, instantly understand the code, and make changes that directly affect business goals.

To view or add a comment, sign in

Others also viewed

Explore content categories