Hacker News new | ask | show | jobs
by theshrike79 1758 days ago
If people would stick to common generic data structures (like a map/list that can handle any datatype), i'd be fine with abstractions.

But some people have a tendency to play code golf with their codebases.

I have, for example, encountered a "generic data structure" that looked like a normal linked list on the surface. BUT, it actually sorted the largest three items in the first 3 cells and the average in the 4th.

That was multiple days of work wasted because someone decided to be cute with their data structures. And that wasn't even the only one of such "generic" monstrosities in the code.

3 comments

So blame goes to the hammer instead of the carpenter?
What does that have to do with generics? Surely they’d have written the same bad code monomorphised?
Generics (and other abstractions) are not the root cause. Go was a pragmatic defence against mediocre developers. The majority of developers are mediocre by definition, and will abuse _any_ abstractions to create Rube Goldberg contraptions and monstrosities.
20 years ago those mediocre programmers were using Visual Basic and Java, so look for the past to see where future goes.