I have to disagree again on that
ohh boy!
I certainly hope you weren't disagreeing with the "time and place" part. That would just be silly :lol:
OO does indeed generate some overhead, but in no way unnecessary. If only because it makes the code testable, and I would never consider a piece of code complete without full (or almost full) unit-tests coverage.
Ah, but sometimes you don't have that overhead to work with-- this is the problem I have with people who, say, write otherwise amazing games in Java (*coughminecraftcough*). Sure, you can test it to the bajeezus, but will it
run like the wind? If you're writing a pizza delivery system (our SE project), sure it will. If you're writing a game engine, not so much. Who cares about adherence to some paradigm when you can save millions of cycles and bits by not worrying about:
- garbage collection
- constructing large "objects" for the purpose of saying you did it (or 'testing' which will be irrelevant to the end user)
- using design patterns that are overgeneralised and therefore, inherently not optimised
In my opinion (but I consider it fact) the only criterion for something being "necessary" is hardware compatibility. I can test my program without needing JUnit or whatever to hold my hand. It's possible-- tonnes of good code was written before OOP came along. Someday, some new paradigm will come out and be the new "Way To Do Things," and my eyes will already be tired from rolling at OOP
Here is my central issue with OOP being the "Way To Do Things":
machines don't speak in objects. A computer (as of yet) has no idea what an "object" is, and as long as you continue trying to teach it new things, it will just implement them in old ways. I am not fond of humans thinking like humans whilst they code. In order to write efficient, non-bulky, low-overhead code, you have to minimize the use of training-wheel concepts such as OOP. You have to think, "What is the
machine doing now, with this code?" The idea that you can write a program without knowing what the underlying machinery will do with it is pretty cool-- for a hobbyist. It has absolutely no place in professional software development, unless the product is an initial mockup or something.
I get the sense that this is at the very heart of our disagreement. You would most likely cite code aesthetics and "non-hackishness" as your highest priority-- I would cite performance.
I seriously love me some C++ (I had my larval stage in it), and don't get me wrong; I love OOP, it's fun and we tend to have enough bits and cycles to play around with these days. However, I'm not going to write a testable little self-contained class for every single thing I do, just so I can test it with some utility and watch things turn red. That's what asserts, standard i/o, and shell scripts are for.
It simply produces better code, and our users are happy because the system just works.
To give you an example, around 55% of our current system codebase is tests. We have around 2000 of them, unit / system / acceptance tests and they take 25 minutes to run. But when we break something (even the smallest thing), we know it instantly because the build goes red.
Something I can admire about your approach is its inherent quality factor. It may cost you some speed and make a whole hell of a lot more work for everyone-- you said it best,
over half of your codebase is testing stuff-- but as a result very few bugs make it into a release, ever, and I can admire that. I sure as hell wouldn't want to hire someone just to write and watch over tests, though. To me, that's something that can (and should) be done by everyone for their own individual units. Plus, then you wouldn't have to deal with trying to explain your code to someone else.
Actually I'm not a big fan of UML myself
(sorry, I don't do that on purpose!) because usually I find it too cumbersome and more annoying than useful. It slows down communication where it was created to help it. The only part of UML I use quite often is the class diagrams, when discussing a database/application model with colleagues on a whiteboard.
You're kidding
the only part I use is class diagrams, so we finally agree on something. I might do a state diagram someday if I'm -actually- thinking in terms of "states," like in a game engine, but most of that stuff just works in my head. That's what I didn't like about SE. I couldn't just do things in my head... comments weren't even enough. I actually had to make diagrams for how my things worked on the inside... and I kept thinking,
what use are these, except for grading? if my unit works, why does everyone else need to know -how-? Isn't that the point of collaborative OOP?