Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's hugely debatable, actually. If you ever called a command-line application in one of those scripts, you called what's essentially an object - it encapsulates its own behavior, hides how it does it, you can create multiple ones (instances) without them competing or sharing information, the command line arguments are arguments to the constructor, etc. They're nearly identical.


OOP concepts aren't what's getting in the way. It's the boilerplate most languages require for their preferred object systems. A good language for beginners would have to make it easy to progressively encapsulate things as the program grows, without requiring substantial rewrites. It should be very easy to go from a few named variables to an array or dictionary, and then to add methods to that to make it a proper class.


Sounds like JavaScript or Lua.


Seems like this logic would apply to any procedural program.


Several posts have mentioned that objects are merely metaphors, and isn't that exactly what you are doing here?


Pretty much. But I see "BASH isn't OO" fairly often, and really? Every process you spawn has its own memory. That's pretty definitively OO.


You're missing message passing (though you can have that with a separate process as well). Something isn't OO just because it has its own memory.


You have the strangest definition of OO I've yet to come across.


Encapsulation, abstraction, and per-instance memory? So I'm missing message passing (possible between processes), and...?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: