dongtanzhu5417 2009-11-11 09:17 采纳率: 100%
浏览 34
已采纳

Google的母语是否解决了保罗·格雷厄姆(Paul Graham)的文章“为什么弧不是特别面向对象”中的问题?

Does Google's Golang address the problems with languages addressed in Paul's Graham's post 'Why Arc isn't Especially Object Oriented'?

  • 写回答

3条回答 默认 最新

  • dongyiba8082 2009-11-12 16:11
    关注

    My initial feeling towards this is "It is too soon to tell"

    1) Object-oriented programming is exciting if you have a statically-typed language without lexical closures or macros. To some degree, it offers a way around these limitations. (See Greenspun's Tenth Rule.)

    Go supports Function literals (see docs) which if I am reading this correctly allow you to pass functions as params, whether defined elsewhere or created ad-hoc.

    2) Object-oriented programming is popular in big companies, because it suits the way they write software. At big companies, software tends to be written by large (and frequently changing) teams of mediocre programmers. Object-oriented programming imposes a discipline on these programmers that prevents any one of them from doing too much damage. The price is that the resulting code is bloated with protocols and full of duplication. This is not too high a price for big companies, because their software is probably going to be bloated and full of duplication anyway.

    This point is far to subjective to answer.

    3) Object-oriented programming generates a lot of what looks like work. Back in the days of fanfold, there was a type of programmer who would only put five or ten lines of code on a page, preceded by twenty lines of elaborately formatted comments. Object-oriented programming is like crack for these people: it lets you incorporate all this scaffolding right into your source code. Something that a Lisp hacker might handle by pushing a symbol onto a list becomes a whole file of classes and methods. So it is a good tool if you want to convince yourself, or someone else, that you are doing a lot of work.

    Since go isn't a truly object oriented language, you can probably solve the problem in whatever fashon you are comfortable with.

    4) If a language is itself an object-oriented program, it can be extended by users. Well, maybe. Or maybe you can do even better by offering the sub-concepts of object-oriented programming a la carte. Overloading, for example, is not intrinsically tied to classes. We'll see.

    Go seems to have an interesting approach to objects, where you are not required to worry / develop large object trees. It looks like the tools are present in the language to structure your data in an object oriented fashion without locking you in to a pure object oriented environment.

    5) Object-oriented abstractions map neatly onto the domains of certain specific kinds of programs, like simulations and CAD systems.

    ...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置