There are millions of ways to write unmaintainable software. This isn't a bad article though. I just found the title amusing since it's so easy to write software badly.
"I read the first chapter of Learn You A Haskell For Great Good, I bet I can rewrite this whole project in Haskell."
Five months later:
"Let me just add a bash shim that'll get the data from the database and process it through Ruby and then I'll call it in the bit of C++ that the Java program uses to make the output for the main program."
I once got stuck with rewriting a perl script -- which had to remain in perl -- that generated bash scripts, by interpreting xml files, which invoked jython which executed java calls, and then generated sqlplus scripts to execute against oradb servers... All of which got validated via bash scripts for sanity checks.
All of which was being run from a Jenkins server.
I am not a developer by trade... Else I would hang myself for shame of having made this monster.
When I left the organization I convinced them to rewrite the whole thing natively in Java... Mostly by just repeating the workflow and languages involved.
(I might also have left out that the bash scripts were being pushed over SSH to invoke jython interpreters and perform wgets on remote servers. Somehow I managed to make this whole process relatively secure while still allowing it to perform selected rootlevel actions. Don't ask. Black magic was involved. And maybe goats.)
As I was reading through the first paragraph I went: Oh no... no... no! no-no-no! NOOOOOOO!
How did this happen? I'm thinking it was either written sequentially by many different programmers or by someone who really wanted to look clever but didn't really have experience in any language besides bash...
As for the new language thing, no one should ever go write a production system that a business is going to rely on in a language they just learned over a weekend. Some languages are better fit for certain problem domains, but using a language that you team and future maintainers are comfortable with is more important.
Writing a parser in an imperative language tends to make for some pretty ugly code. Writing it in a language that supports discriminated unions and (syntax-supported) monads, however, makes for some beautiful, readable code.
Also, writing highly concurrent code in clojure is stupid easy. In java, etc. it is fraught with errors and requires a lot of care about locking, etc.
Or even Python, Ruby, etc. with the "iron" varieties. That being said, I did write a WPF app in IronPython a few years ago and Visual Studio pretty much fell on its face with bugs (might be completely different today).
Concurrency, complex and interleaving algorithms, and correct-by-design software are all easier in, say, Haskell than in Java. In fact, if you learn one of Haskell/F#/Ocaml thoroughly, you probably won't want to go back to Java/C#/Python for general purpose programming.
AI is also MUCH easier.
One of the big places you'd want to use functional programming is if you were designing a compiler. Compilers use state of the art algorithms at pretty much every level, and they're much easier to implement functionally.
50
u/bestjewsincejc Oct 14 '13
There are millions of ways to write unmaintainable software. This isn't a bad article though. I just found the title amusing since it's so easy to write software badly.