TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Best modern language to learn object oriented programming

7 点作者 ds2643将近 8 年前
I&#x27;m a programmer who was introduced first to the functional paradigm. I&#x27;d like to better understand the object programming paradigm.<p>In the past, people have suggested Smalltalk as the best medium for learning concepts central to OOP. However, I&#x27;ve found the tooling has regressed in recent decades to the extent that I find using the language unpleasant (please correct me if I&#x27;m wrong).<p>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.

8 条评论

probinso将近 8 年前
The problem is that your programming is styled by the language you choose. If you decide to go down the route of python then the curse of consenting adults will paint the way you believe object-oriented programming should be done. Likewise if you select something like C++ or Java, then the curse of privacy will paint the way you think about object-oriented programming.<p>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.<p>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.<p>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.<p>I expect this isn&#x27;t a preferred answer, but the real message is if you pick one and learn it, don&#x27;t stop there. It will take you time to become comfortable enough to Warrant breaking into another language.<p>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&#x27;t bad choices.
git-pull将近 8 年前
I don&#x27;t know if it&#x27;s best, but I took on OOP in little bites:<p>- ECMAScript 5<p>Mixins, scopes, instance variables, and instantiation.<p>As a bonus, but not OOP, callbacks. It&#x27;s a straight-forward language that&#x27;s available abundance.<p>- Python<p>For it&#x27;s class inheritance being easy to navigate. Instance variables, instantiation, method resolution order (MRO), mixins.<p>- C++<p>This is the hardest language I can think of. It does <i>everything</i> OOP, and more, including allowing for a lot of stuff that&#x27;s not legible.<p>Despite that, it&#x27;s a solid language.<p>Something that goes great with constraining the many features of C++ are <a href="https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;cppguide.html" rel="nofollow">https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;cppguide.html</a> or <a href="https:&#x2F;&#x2F;isocpp.github.io&#x2F;CppCoreGuidelines&#x2F;CppCoreGuidelines" rel="nofollow">https:&#x2F;&#x2F;isocpp.github.io&#x2F;CppCoreGuidelines&#x2F;CppCoreGuidelines</a>.<p>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.
评论 #14535690 未加载
panic将近 8 年前
Ruby and Objective-C both have a strong Smalltalk lineage. You typically use the C part of Objective-C to perform basic operations like arithmetic and function calling -- if you know C already, it may be a more comfortable starting point, but it doesn&#x27;t show off the power you get when <i>every</i> value is an object (and you can do things like add new numeric types while the system is running: <a href="http:&#x2F;&#x2F;lists.squeakfoundation.org&#x2F;pipermail&#x2F;squeak-dev&#x2F;1998-October&#x2F;025066.html" rel="nofollow">http:&#x2F;&#x2F;lists.squeakfoundation.org&#x2F;pipermail&#x2F;squeak-dev&#x2F;1998-...</a>).
solomatov将近 8 年前
C# or Java. Most of the best OOP books are written for these languages.
Lordarminius将近 8 年前
Ruby.<p>Use David Black&#x27;s <i>The Well grounded Rubyist</i> or the PickAxe Book
pryelluw将近 8 年前
Have you tried F#? Its multi-paradigm and might make some thingd clearer. You can later move to C# and onto others. :)
评论 #14534515 未加载
AlexAMEEE将近 8 年前
I wrote many lines about Scala but then I lost the motivation to finish it.<p>So I&#x27;ll just write, Scala.
mhh__将近 8 年前
&lt;plug&gt; D is a very nicely language for doing OOP in&lt;&#x2F;plug&gt;