4 ms·
Someone needs to write a "History of Programming Language Design Mistakes." (Not saying Rust is one of these.) While working for a Smalltalk vendor, I got to s
by stcredzero 13y ago
Someone needs to write a "History of Programming Language Design Mistakes." (Not saying Rust is one of these.)
While working for a Smalltalk vendor, I got to see that the various Smalltalk implementations all made the same mistakes. (Visualworks, ObjectStudio, Digitalk) Then later on, I've seen eerie reminders of those things I saw in other environments/languages.
This is a highly complex subject, not only spanning a great deal of technical material, but also interactions within communities of many programmers, decision makers, and others.
I think such a book would be highly valuable to the programming field. (Or, as Alan Kay says, "not quite a field.")
- chubot 13y agoHere's one that's been on my mind that I haven't seen people talk about: making O(1) and O(n) operations look the same. Example in Python: d = { ... } for ... if 'key' in d: func() L = [ ... ] for ... if 'key' in L: func() Python is my favorite language, and I teach Python classes, but the number of both beginner and production programs I've seen with quadratic blowups because of this issue is crazy. I think a lot of the problem is the subtle syntax. People with a solid CS background find this distinction fairly natural, but most Python programmers apparently don't. I guess the alternative syntax would be L.find(), which sort of emphasize the linear search. It seems WAY more elegant to have the polymorphic "in", but the number of mistakes is too high. Actually now that I think about it, this was question #0 on the stripe CTF3. So I guess the same thing happens often enough in Ruby for them to use it as a question.
- j_baker 13y agoI see this as ultimately being a much better from an optimization standpoint. Now I can change L to a set or a linked list if I find that more efficient without having to change it everywhere. Language features are no substitute for algorithm and data structure knowledge, which your students can likely be forgiven for not knowing about.
- chubot 13y agoI don't buy it. Physically editing text is never the problem when changing a data structure like this. The work is ensuring your program is still correct and performs better.
- dragonwriter 13y agoEnsuring code is "still correct and performs better" is made easier if only the data structure used has to change to get "performs better", and the "still correct" comes free with it because the operation that performs the same function is the same operation regardless of the efficiency of the algorithm.
- j_baker 13y agoRight. And this kind of polymorphism means that your program will still retain the same correctness no matter what data structure you use. Physically editing text is the most correctness-destroying thing you can do.
- j_baker 13y agoIt sounds to me like you know enough to write such a book. ;-) I'd certainly like to read such a thin.g.