DEV Community


Posted on


Next time you say "complex code", come back here...

What is complex code?

It is just two words complex code, no rocket science involved. Or, Am I overthinking it?
It is easy to understand code complexity and programming complexity. There are studies and theory about computational complexity.
But it is all different.

Why is it easy to picture complex code as bloated software like these hello world examples? One step more and it will transition to pure art - increase the complexity of a simple instruction to a maximum power level which completely vanishing original idea.

Here is another example of complex code, which is in fact, well made satire.

It is not only about a piece of code, but you can take it all way up (or down) to language level like brainfuck does.

What about real-world examples? Current project?

Have you ever put a label on somebody's else works thinking that the code is very complex? Could it be that these feelings radiated over yourself, night after the last deadline? Like, something feels fishy about that iteration over a multidimensional list of lists. Or, maybe, during a source code review of a popular library everyone uses but finding it hell confusing...

Does it affect us?

Have you ever blamed complex code for a missed estimate? Was there a feeling like "please not me" because you knew the code? What is your emotion when you hear "legacy application"? Do you smile and eager to start a new project?

So why there is no clear definition of a thing which makes us feel uneasy?
Is it because this thing is complex?

Let me know your thoughts and especially feelings.
Share your story, your perception, your view, your examples.

Oldest comments (0)

50 CLI Tools You Can't Live Without

The top 50 must-have CLI tools, including some scripts to help you automate the installation and updating of these tools on various systems/distros.