- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
A good developer would implement e.g. the hashtable algorithm at most once for each language (when there is no suitable library available).
Admin
The younger developers who grew up with C++ STL and/or Java have probably never done it at all.
I know I haven't, though I did once (still at university) implement a B-tree. It's still the programming achievement I'm most proud of since that's a damn complex data structure with lots of edge cases, and I did it all by myself.
In the real world of software development, you rarely get to build a self-contained thing on your own, it's mostly teamwork and maintenanche programming.
Admin
This is impossible to know what this code is doing without knowing the language it is written in. Please always specify the programming language. Assuming that is C++, this is pretty clear that the + operator (and maybe the ToString() method) has been redefined and contains all the business logic *-)
Admin
True enough. However we have not forgotten the research of our fore-fathers. We make their work easy to use so that our modern programs are fast.
If programmers used bubble sort (or worse bogo-sort), stored all data in singlely linked lists, and other such things, even with modern technology computers would be slow. We can afford a little inefficacy because most programs are writing O(1) or O(n) code that glues together more complex algorithms (which are often O(n*ln(n))), but always the best algorithm for the job), written by the best programmers we have.
As you pointed out, we use hash tables all the time, but it is a part of our library/language so we don't write them. In many cases it is easier to use a O(1) hash table than a linked list, because both are implemented, but linked list doesn't implement a find so we have to iterate through it ourself. This is strong encouragement to choose the fast data structure right from the start.
Admin
thedailywtf.com is a church. We worship at the holy altar of bad code, by ridiculing it and those who create it.