4 ms·
Or you could use a language that uses object orientation in a more natural way, such as Ruby and Scala, which both are fundamentally OO languages. You can do p
by knowtheory 16y ago
Or you could use a language that uses object orientation in a more natural way, such as Ruby and Scala, which both are fundamentally OO languages.
You can do procedural-y things with both languages, much to their credit, but packaging up functionality is both natural and intuitive.
Over building APIs is not a hallmark that Objects are bad. They're a hallmark of bad design.
So, yeah, i agree, prototype a minimal solution and iterate, and teach others to do this. This is an issue that is orthogonal to object orientation. At least, it is in languages that don't make you jump through weird hoops (C++ & Java, i'm looking in your general direction).
- Tekahera 16y agoI think the point is precisely to take design entirely out of the picture when you're teaching a new comer about programming. The fact that you have these problems and you can write executable recipes to solve them is already more than a mindful, everything else only confuses.
- zaidf 16y agoReminds me of my AP Computer Sci class in high school a decade ago. There were five people in the class, two of them being my brother and I. Two of the three left had zero prior programming experience. I could only sympathize with them as we rushed through the "syllabus" learning about everything from pointers to classes to inheritances. Suffice to say they were completely lost and dreaded the class as much as math. I wasn't particularly good at math and could not imagine seeing programming as "math" because of how much fun I was having with VB/ASP(yes, you can chuckle) at home. I don't even want to think what perception of programming the two people left with. I recently finished college with communications degree, make a decent wage doing programming and haven't needed to even think of the word "inheritance." Of course there are many great uses for it. But to assume everyone should learn about it is to assume that everyone wants to be a genius programmer at google. There is so much gray in between the curriculum just ignores.
- bachatawat 16y agoyou lost me at "I recently finished college with communications degree"
- zaidf 16y agoI still get a chuckle out of it, too. Then again, how else do you end up in a debate class full of basketball players who are gonna win the NCAAA Championship later in the semester?
- deleted 16y ago[deleted]
- jerf 16y agoThe delta between Python and Ruby is way, way smaller than the Ruby community seems to think it is. You are aware that everything is an object in Python, too, right? The idea that that isn't true still seems to be knocking around the Ruby community. Everything he said about Python applies precisely to Ruby (or fails to apply in exactly the same way if it is a bad argument), because there's hardly any difference that matters to a newbie. "But, but, len is a function! And you can't monkeypatch the base classes even though you can monkeypatch everything else!" Yes, please, by all means burden your neophyte with that tirade. They'll really appreciate it while they're trying to figure out what an "if" statement really does or why calling a function with the wrong capitalization doesn't work.
- deleted 16y ago[deleted]
- jonhohle 16y ago> You are aware that everything is an object in Python, too, right? Python is missing encapsulation and message passing. It's object model seems to be similar to something like PHP or JavaScript: objects are essentially hashes. In practice, that's not a huge deal, but they aren't quite the same. This is not important for beginning programmers, but for programmers thinking about their toolset more information can only help.
- BobKabob 16y ago"Any traditional OOP programmer might tell you that essential elements of OOP are encapsulation and message passing. The Python equivalents are namespaces and methods. Python doesn't subscribe to protecting the code from the programmer, like some of the more BSD languages. Python does encapsulate objects as a single namespace but it's a transluscent encapsulation." From: http://www.voidspace.org.uk/python/articles/OOP.shtml http://www.voidspace.org.uk/python/articles/OOP.shtml
- GeneralMaximus 16y agoTBH, private fields are a stupid idea. It's just a cutesy concept that gives the newbie a false illusion of being in control. I've never seen a program where a private field was actually important to the integrity of the program.