by fnfjfk · 3y ago · 0 comments
It’s not wrong per se, don’t choose some technology posted for the first time yesterday. But if you make the choice of Java (boring) over Kotlin (shiny new), you’re possibly signing up for a curse of chasing NPEs, which Kotlin would have caught at compile-time. Or if you choose C++ over Rust, same general idea.
The specific languages it calls out are Python and PHP, which IMO are bug-prone languages with serious performance/efficiency implications. Some semblance of safety needs to be bolted on separately, and at large scale they will cost your company $$$ vs. a more performance-friendly language (the latter doesn’t matter so much if you are a tiny startup with no users yet).
I would say more important is “write boring code”, and it is easier to write boring to-the-point code in modern languages without implicit null references, with sum types for modeling mutually-exclusive data, and with as many other common pitfalls statically eliminated as is possible.
Working tightly with QA for over ten years by now, I can assure you that NPEs are exceptionally rare in bug reports filed by QA. No matter if that's a common problem in the language the application is written in (eg. Java or C++) or virtually nonexistent (eg. Kotlin or Haskell).
Here are some examples of more common bugs:
* Misunderstanding of the desired functionality (eg. giving admin permissions to regular users).
* Not being able to predict all valid input forms (eg. user names with accented characters).
* Forgetting to handle errors coming from multiple levels below the immediate level that's being worked with (eg. dealing with SSL-related problems in HTTP client / server communication).
* Simply forgetting to implement some uncommon bit of functionality (usually related to cleanups, deletion etc.)
----
Currently in-use programming languages have roughly the same ability to deal with these, as I call them, "macro-problems" of programs. All of them are equally ill-equipped and unprepared for them. Tightening the type system or chasing after nulls is working at a resolution that's too fine. At this resolution programmers usually still have a good chance of figuring out the problems without the aid of types or similar automation.
NPE issues are also very very difficult to chase down.
"very very difficult" on what scale? How many "verys" before it gets really hard?
Again, the proof is in the pudding. You take a language that doesn't make any special efforts to protect against nulls (eg. Java), and you take Kotlin that does, and the difference in the number of problems associated with NPEs is barely noticeable.
Perhaps some automation offered by Kotlin for dealing with NPEs makes developers' experience more pleasant / easier, but the Java side just isn't hard enough to make this a substantial benefit.
And, just to not be misunderstood: I'm not saying that automation in how to deal with missing values is bad, not at all! It's good. But, strategically, there are much bigger problems / juicier targets than NPEs. If you compare this to health, then NPEs are a headache, while misunderstood requirements are a cancer. It's great if you can treat both, but if you have limited resources, then cancer gets a priority treatment.
You are also choosing
-to let your team choose their own IDE
- easy to debug
- frameworks that works out of the box
- and continue to work regardless of Kotlin versions (since one doesn't use Kotlin)
- to no have to deal with a number of "interesting" ways to write code
I like Kotlin. But it is more nuanced than some people would like to have us believe.
Personally I think I have spent far more time over the last three or four years hand holding Kotlin and cleaning up "clean code" than I have saved by less NPEs.
I'm with you generally though. Yes choose boring tools, JVM, PostgreSQL, etc. But also write boring code using boring architectures deployed on boring platforms.
But isn't the point that if you run into this much issue for the initial choice, you are now ready to use an innovation token and switch to a different one?
> Some semblance of safety needs to be bolted on separately, and at large scale they will cost your company $$$ vs. a more performance-friendly language (the latter doesn’t matter so much if you are a tiny startup with no users yet).
At that point with all the financial resources, they can consider to rewrite/migrate. Thus, at the start, chose boring technology.
Even at a big company, retraining or hiring people proficient in Rust will probably cost more than continuing to use C++ codebase and people.
Is this in regards to running a startup? In that case, I have little to add. But my initial understanding would be, the startup needs to be able to reach product market-fit as quickly as possible. Which is where using a boring technology (to the founders/founding team) would reduce distractions/unknowns.
> but since my proficiency with C++ was a few small incremental changes relative to C, I was going to have to learn a lot in either case.
Isn't this premise aligned with the philosophy written in the article? 1. You needed to learn something new (so no longer boring, and prime for innovation token) 2. You needed to use something different for a systems language context (innovation token time)
New doesn't mean exciting. Programming languages are boring – even new ones. If you see a programming language attracting a lot of excitement, beware, but otherwise whatever you're comfortable with will be fine.