by ds2643 on 6/11/17, 8:07 PM with 15 comments
In the past, people have suggested Smalltalk as the best medium for learning concepts central to OOP. However, I've found the tooling has regressed in recent decades to the extent that I find using the language unpleasant (please correct me if I'm wrong).
In your opinion, which modern language best (and most simply) serves as a vehicle for teaching concepts core to OOP? I have no strong preference whether the type system is static or dynamic.
by probinso on 6/12/17, 4:43 PM
The curse of privacy dictates that the existence of a public method will act as documentation for an object. methods only exists for the purpose of Performing operations on that objects type. This will make you think a lot more about how objects systems provide secure and well dictated data flow. Your objects will be authored to respect these ideas.
The curse of consenting adults dictates that human readable code trumps control flow. The idea of inheriting from a dictionary in Python to Define your own class object makes for extremely powerful objects that are immediately designed to interface with the Python language. There however may be operations that can be applied to dictionaries that you may not want applied to your objects.
If you really want to understand object-oriented programming, then you should use both. You should find as many programming languages as possible and explore how their idioms paint the color of your code.
I expect this isn't a preferred answer, but the real message is if you pick one and learn it, don't stop there. It will take you time to become comfortable enough to Warrant breaking into another language.
That all being said, python and ruby are easier as a programming languages (in general) than many Alternatives. So if you have to learn programming at the same time as object-oriented programming they aren't bad choices.
by git-pull on 6/12/17, 6:49 AM
- ECMAScript 5
Mixins, scopes, instance variables, and instantiation.
As a bonus, but not OOP, callbacks. It's a straight-forward language that's available abundance.
- Python
For it's class inheritance being easy to navigate. Instance variables, instantiation, method resolution order (MRO), mixins.
- C++
This is the hardest language I can think of. It does everything OOP, and more, including allowing for a lot of stuff that's not legible.
Despite that, it's a solid language.
Something that goes great with constraining the many features of C++ are https://google.github.io/styleguide/cppguide.html or https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.
I think ES5 and Python are used very often and in terms of bang for the buck, give they cover a lot of the bread and butter OOP concepts.
by panic on 6/11/17, 8:32 PM
by solomatov on 6/12/17, 2:36 AM
by Lordarminius on 6/12/17, 2:42 AM
Use David Black's The Well grounded Rubyist or the PickAxe Book
by pryelluw on 6/11/17, 9:13 PM
by AlexAMEEE on 6/11/17, 9:47 PM
So I'll just write, Scala.
by mhh__ on 6/12/17, 5:30 PM