3 ms·
Like the old saying, "you can write cobol in any language". Polymorphism and "good generic data structures" (in the sense you are implying) are not a necessary
by CrLf 14y ago
Like the old saying, "you can write cobol in any language".
Polymorphism and "good generic data structures" (in the sense you are implying) are not a necessary requirement of elegant and maintainable code. It is part of the problem that programmers have taken OO concepts as the end-all of good code, and must apply those concepts everywhere even if that means implementing them from scratch at the cost of (unnecessary) complexity.
Large systems have been written in C. Many large open-source projects use C. There is no evidence that these are less maintainable (in general) because of language choices.
Some of these graft OO concepts onto C. GTK is noticeable for this (although it doesn't seem to be too bad for application developers, I'm afraid for those tasked to maintain the libraries themselves).
Procedural programming is not a sin (if "procedural programming" exists at all today, as most of the simplest object concepts have become common practice and are now though as an integral part of it).
- cygx 14y agoLike the old saying, "you can write cobol in any language". As far as I know, there is no such 'old saying'. However, The determined Real Programmer can write FORTRAN programs in any language.
- pcwalton 14y agoParametric polymorphism (i.e. generics) is not an object-oriented concept.
- norswap 14y agoThe problem never was the lack of OO, the problem is that you have to repeat yourself. There will come a type when you have a type that behaves a certain way (certain members, argument of certain functions) and then you will make a type that is mostly the same thing, but then slightly different (maybe one attribute is replaced by something else). You'll have to adapt everything you reproduce a lot of your logic or jump trough very annoying hoops to have your existing logic work with this new type. If from OO, I could have only Java-like interfaces, it would probably be enough. Implicit type conversions could also work I suppose.
- luser001 14y ago> There is no evidence that these are less maintainable (in general) because of language choices. I have an example. The Squid proxy code used calling via function pointers everywhere as DIY polymorphism. That made it quite difficult for me (ymmv) to follow the code. Things like ctags would have worked if they'd used "real" C++ polymorphism. IMHO. YMMV.