English 中文(简体)
Does Google s go-language address the problems in Paul s Graham s post Why Arc isn t Especially Object Oriented ?
原标题:
  • 时间:2009-11-11 09:17:22
  •  标签:
  • go
  • arc-lisp

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

最佳回答

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.

...

问题回答

Paul has some interesting points, in general, I ve read a lot of his musings. In this matter, we disagree. He s a lisp nut, and a crappy program nut. He seems to pawn off hard to understand programs as the work of great programmers. Yes, I realise it s more nuanced than that, but it really boils down to just that. At the end of the day, either your code is easy work with, or it s not. And some programmers, programmers that Paul would deem great, will be able to put up with more crap than others and still be able to make heads or tails of what the code intends. It s a skill, but most assuredly not the only one a good programmer needs.

Speaking of Arc, it sucks, and unless I m mistaken even people in the Lisp community think so -- my point here being that even smart people make mistakes.

Again, Paul is a smart guy, but his entire approach in this particular piece is off the mark it seems.

Wait up, though, is Go really object-oriented? It seems entirely agnostic on that front. You can use OOP or FP or Imperative programming within Go. I mean, prolog-style "programming" would be a stretch, but otherwise...

In fact, I d argue that Go resembles scala in this respect: there s some object paradigms lying around, and yet, there are also lambdas and typecasing lying around.





相关问题
minimum work size of a goroutine [closed]

Does anyone know approximately what the minimum work size is needed in order for a goroutine to be beneficial (assuming that there are free cores for the work to be offloaded to)?

How do you get the terminal size in Go?

How do I get the terminal size in Go. In C it would look like this: struct ttysize ts; ioctl(0, TIOCGWINSZ, &ts); But how to i access TIOCGWINSZ in Go

What do you use to write Go [closed]

I know its a bit too early, but I ve been trying out Go (Google s Programming Language) and its kindof annoying to write code in gedit. So, my question: What do you use to experiment with Go?

Shared memory vs. Go channel communication

One of Go s slogans is Do not communicate by sharing memory; instead, share memory by communicating. I am wondering whether Go allows two different Go-compiled binaries running on the same machine to ...

Embedding instead of inheritance in Go

What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description

热门标签