Hacker News new | past | comments | ask | show | jobs | submit login

What is the best language to learn OOP concepts ?



Good question. If we are talking "real OOP", I'm not sure these days. What do other people think?

Smalltalk is very long in the tooth these days, but it is still "rather object-oriented in good ways".

Erlang and its derivatives are fun and good to help that kind of thinking.


What do you think is missing from Smalltalk, and what would you expect for the "21th century Smalltalk" if there was such think?

Even though is "old", I find it extremely valuable for learning to think and reason in a pure OO fashion.


It's worth thinking about what scales and what doesn't scale so well. For example, names are relatively local conventions. We could expect to have to find better ways to describe resources, or perhaps "send processes rather than messages". Think about what's really interesting about the way Parc used what became Postscript instead of trying to define a file format for "documents" for printers ... (a programming language can have far few conventions and be more powerful, so ...)


Granted, names have their problems. But as a tactical solution URLs can be used to send high-level messages or at least as a name resolution scheme to initiate communication between two or more OO systems. And URLs are just names... (credit where it is due: I first heard the thought expressed by you and it gets the job done until something better comes along)

Admittedly this does not (directly) address the issue of sending processes (which could be handled indirectly as payload.) Or am I missing the bigger picture you're driving at here?


Keep on turning the crank ...

What if you need something but don't know its name or URL? Etc.


My example definitely presumed things like service discovery which gets you to URLs. But I think I see the larger point you make about what if you don't even know what kind services are available (which my example assumes you already know) and once told of their existence how do you negotiate their capabilities and usage (my example, as I envisioned it, completely falls apart here without some major plumbing which might require running an open sewage line through the kitchen. i.e. probably not the best way to do it)

P.S. I have found the team's work on STEPS quite thought provoking. If anyone could find the time once things settle down, it would be most appreciated if some quick docs re: how to reproduce (i.e. build) the Frank environment could be put together. (if they already exist, a pointer to them would be helpful)


One thing I've found about the web, as it exists, is that the people who set up a system for the outside world to use change it over time. The URLs change. The CGI their service will accept changes. As things exist now, a program must use "sticky" names, and if a name changes, all of a sudden the connection is broken, even though the exact same functionality still exists. It would be good if a program could find the functionality it needs based on a functional description of what it needs, rather than a name. That gets more to what's really important. I once complained to Alan that Smalltalk had the same problem. If I change the name of a class, all of a sudden all the code in the system that needs that class could no longer find it, even though I had changed none of its functional code. This seemed like an extremely brittle scheme for finding resources. The name is not the important thing about what a program needs. It's just a reference point that does nothing. Names are still good, because they allow us to quickly identify resources, but they should mainly be for us, not the program, because when you really think about it, a program doesn't care what something is called.


Hi Mark

Actually, this is not quite true about Smalltalk code (which is linked to its class). But referring to things is also done via variables and selectors of various kinds, and these are names which have to be locally known. Smalltalk can also find quite a few things by description (for example it can find things like the "sine function" via examples of inputs and outputs).


> it can find things like the "sine function" via examples of inputs and outputs

I think this is a really important idea. On one hand, it can save us from re-inventing code which already exists (e.g. "this existing code will satisfy your test suite"), it can help us discover relationships between existing things ("the function 'sine' behaves like the function 'compose(cosine, subtract(90))'"), it can aid refactoring/optimisation/etc.

On the other hand, it could also help us discover services/information which we could not obtain by ourselves. For example, discovering a database mapping postcodes to latitude/longitude.

There's some interesting work applying this to pure functions, using testing https://hackage.haskell.org/package/quickspec and proofs https://github.com/danr/hipspec

It's also closely related to inductive programming (e.g. inductive logic programming, inductive functional programming, or even superoptimisation), where combinations of existing functions are checked against the specification. Of course, that leads down the path to genetic programming, and on to AI and machine learning in general!


I misspoke. I just tried doing what I described, with String. Squeak notified me about "obsolete references" to the original class name in existing source code. It's been a long time since I did this. I might've seen that before when I did this, and I guess it left me with the impression that it was not capable of adapting to the change by itself. The name change didn't cause a problem in continuing to use String, even in the compiler, such as doing in a workspace: 'hello world ', 'hi there'.

I am familiar with Method Finder. I've used it several times with varying degrees of success. Sometimes I found that what I was trying to describe couldn't be expressed with the conventions it uses. I am also familiar with the fact that all of that functionality is accessible from a set of objects, but my understanding is you have to explicitly use those objects in your code to look up by description. If you just say "Classname new", you're not going to get that. That's what I was talking about (at least trying to :) ) in my previous comment.

BTW, I read Ted Kaehler's paper on using the aforementioned objects to try to access objects, if I remember correctly, within Squeak strictly by description, as a means to try out methods for "computing through negotiating with objects." It seemed to come with a little difficulty, as I remember him talking about some number of "destructive actions" that happened as a result. Interesting experiment. I had the thought around then that in order for negotiation to happen safely, the receiving system would need to put objects in a "test harness" to prevent such destructive actions.

Working with Method Finder was one of the examples I used as inspiration for trying to "sketch" a language where the idea was I could "program by suggestion," which I described in an earlier comment here (https://news.ycombinator.com/item?id=11945188).


> it can find things like the "sine function" via examples of inputs and outputs

I really like the idea, and reading through comments this question came to my mind.

Names are important for us. They synthesize what a "thing" is, and they help us organize knowledge.

So even though it might be true that for computers names are not that important (i can describe what i want), i believe they are for us, humans, when trying to understand a given system.

We grow systems both for humans and for computers.

What's your take on this? How would you find balance between the two?


Thanks, Alan. I guess sometimes is hard to think about that level of scaling when working on the industry... or at least in projects that are not that massive.

I assume your are talking in the lines of "call by meaning" when you mention that names are relatively local, right?

As for "send processes rather than messages", isn't that what objects are about?

I mean...sending the real thing, not just "data" as part of a message. That reminds me of the Burroughs 220 and "delivering video + codec together" example you mention in your talks.


Modularity is: what is the minimum you need to know to make use of a module, and what is the minimum that a module needs to know to help you?

Making this good is one of the secrets of scaling


Im afraid I'm missing the point about "sending processes rather than messages".

The modularity thing sounds pretty much to well designed objects to me, but it seems that you're trying to make a difference between that and processes.

What do you have in mind or, better said, which could be a concrete example of it?


The question is whether a "message" has enough "stuff" to reify into a real process (so it can help interpretation and negotiation) or whether the receiver has to do all the work (and thus perhaps has to know too much for graceful scaling of the system).


I know I'm stuck in a box here. The other way around would be:

- what if we cant send processes instead of messages? - what are we missing? - which things cannot be done?

Pretty much what we have nowadays.

I find it hard to understand how sending processes (assuming they're not only objects but the context in which they live) help scaling the system.

Which example are you thinking of, that i cannot because I'm lacking this idea of processes rather than messages?


How would we communicate with an alien civilization? How would we establish a common frame of reference from which to establish a communication protocol. Think along those lines...


Re. consider "send processes rather than messages"

Interesting thought to ponder!... What came to mind is Smalltalk-80 kind of did that, though the processes (blocks) were not in the "driver's seat" of the interaction. They came as "payload."


Smalltalk and Lisp (via CLOS) would still be my top two choices... haven't come across anything better yet.




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

Search: