Live data from Hacker News

Alan Kay and OO Programming

ovid.github.io

111–120 of 141 posts

Re: Alan Kay and OO Programming

#111
post #76

>> Extreme late-binding is important because Kay argues that it permits you to not commit too early to the "one true way" of solving an issue (and thus makes it easier to change those decisions), but can also allow you to build systems that you can change while they are still running! >> Binding can also refer to binding a variable type to data. As someone who has over 15 years of experience going back and forth betw…

I think our industry has become rife with people who don't know its history. So we get people "discovering" new ways of doing things that were known decades ago. Take for example "JAM stack", also known as basically the way web development was done 20 years ago. It is touted it as something new and exciting when it's only so if you don't understand the history of web development. Sure, JavaScript is used more now tha…

Pop culture, that's it. A rather known and obvious approach at web development needed a catchy name and dedicated promotional website so that webdevs know that's cool and trendy.

Alan Kay said in 2004: «You could think of it as putting a low-pass filter on some of the good ideas from the ’60s and ’70s, as computing spread out much, much faster than educating unsophisticated people can happen. In the last 25 years or so, we actually got something like a pop culture, similar to what happened when television came on the scene and some of its inventors thought it would be a way of getting Shakespeare to the masses. But they forgot that you have to be more sophisticated and have more perspective to understand Shakespeare. What television was able to do was to capture people as they were. So I think the lack of a real computer science today, and the lack of real software engineering today, is partly due to this pop culture.» https://queue.acm.org/detail.cfm?id=1039523

Re: Alan Kay and OO Programming

#112

Earlier quoted context omitted.

That's not my experience. Usually it only takes me a few minutes to fix a bug once it has been caught by an integration test.

Depends on your system. Mine usually are huge. The integration test showing "this json reply is wrong" doesn't tell me anything else than I have to dig through all the layers.

Maybe you should break up that large system into more manageable chunks (e.g. microservices, engines, ...) and integration test those individually.

Re: Alan Kay and OO Programming

#113

Earlier quoted context omitted.

> I can't point to a single language that I would prefer for all of the different kinds of programs I've written. I never liked the "pick the right tool for job" cliche in the context of programming languages. I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Other than size, weight, po…

> I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Nope. Granted, I may work on a greater breadth of software than the average programmer. But, at the very least, I have implemented language VMs and garbage collectors where I needed to work at the level of raw bytes and manual memory m…

> I have implemented language VMs and garbage collectors where I needed to work at the level of raw bytes and manual memory management

Fair enough, and I guess I'm forced to agree a little. However, if the one true language already existed, the VM/GC problem wouldn't have to be solved twice. Somebody had to write the first assembler in machine code, too.

I've written a (Hans Boehm style) GC of my own, and I admit that wouldn't fit with what I had in mind either, but working with raw bytes is a solvable problem in almost any level of programming language as a few library functions. All the batch or command line utilities, GUI applications, back end server modules, and most of the one-off exploratory programs could fit in a single elegant language.

> I like static types for decent-sized programs, but I also use config files and other "data languages" where that would be more frustrating than anything.

Again I agree, but (to me) this has a solution. I could be very content with a statically typed language with a single variant type for when you need to handle JSON-ish type dynamic variables or hierarchical data. I think dynamic and static typing can coexist very nicely in one language.

> Even if there was a single language that was perfect for me for all of the code I write, I don't expect that that language would be perfect for others, and I don't think those people are wrong.

I did caveat this was for single person programs and that different people would make different choices. I think my point was just that, having looked at languages from Icon to Prolog to SQL to Scheme to Ocaml to Rust to C++ and a lot of others, I think there is a point in the high-D trade space where I would be content to live and breath for almost every programming problem.

I've never gotten anyone else to agree, but I think it's an interesting exercise to fill in the details. I mean, computers are so much malleable than real world tools - you could have a single thing which handles screws, nails, rivets, and bolts effectively.

Re: Alan Kay and OO Programming

#114

Earlier quoted context omitted.

> Statistically, someone is going to be right. Yes. If you ask 100 people what the answer to "3 + 5" is, you'll mostly get "8". But that's because you're asking them all for the right answer to the same problem. If you ask 80 of them the answer to "3 + 5" and 20 the answer to "3 + 2", the right answer isn't 8 and the people who answered 5 for the latter aren't wrong. They are solving different problems. Given the bre…

> I can't point to a single language that I would prefer for all of the different kinds of programs I've written. I never liked the "pick the right tool for job" cliche in the context of programming languages. I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Other than size, weight, po…

>I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it?

>However, if the one true language already existed,

The one true language can't exist because we want to use a finite set of characters to express convenient programming syntax. (A previous comment about this.[0])

It might be possible to craft a single optimal language for only one particular programmer but I even doubt that limited scenario is even realistic. Consider trying to combine syntax of 2 languages that many programmers use: (1) bash (2) C Language

In bash, running an external program is a first class concept. Therefore the syntax is simple. E.g.:

  gzip file.txt
  rsync $HOME /backup
Basically, whatever one types at a bash command prompt is just copy-pasted into a .sh file.

But in C Language, external programs are not first-class concepts so one must use a library call such as "system()":

  main() 
  {
    system("gzip file.txt");
    system("rsync $HOME /backup");
  }
In C, we have to type out "system("")" that surrounds each external program. We have to add the noisier syntax of semicolons after each line. It's ugly and verbose for scripting work.

In the reverse example, C makes it easy to bit-shift a number using >.

  y = x 
How would one transfer that cleanly and conveniently to bash? Bash uses a bunch of special symbols for special functions.[1] Bashes uses > for input output redirection. Therefore, bash would need to have noisier syntax such as "bitshiftleft(x, 3)"

So, if we attempt to create a Frankenstein language called "bashclang" that combine concepts of bash and C, which set of programmers do we inconvenience with the noisier syntax?

What if we just tweaked C's parsing rules so that naked syntax to run external programs would look like bash? Well, what if you have executable binaries with names like "void", "switch"? Those are reserved names in C Language.

Same thing happens with other concepts like matrices. In Julia and Mathematica, matrices are first class. You can type them conveniently without any special decoration. But in Python, they are bolted on with a package like NumPy. So one has type type out the noiser syntax of np.full() and np.matmul().

Convenient syntax to enable easy-to-read semantics in one language leads to contradictions and ambiguity in another language.

To add to munificent's comment, I also don't see how one language can offer both garbage-collected memory and manual allocated memory using convenient concise syntax _and_ and zero-cost runtime performance-penalty for manual memory. Those two goals contradict each other. When I want to write a line-of-business type app, I just use C# with GC strings. On the other hand, when I'm writing a server-side app that's processing terabytes of data, I can use C++ with manually allocated strings with no virtualmachine runtime overhead for max performance.

[0] https://news.ycombinator.com/item?id=15483141

[1] https://mywiki.wooledge.org/BashGuide/SpecialCharacters

Re: Alan Kay and OO Programming

#115
post #114

Earlier quoted context omitted.

> I can't point to a single language that I would prefer for all of the different kinds of programs I've written. I never liked the "pick the right tool for job" cliche in the context of programming languages. I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Other than size, weight, po…

>I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? >However, if the one true language already existed, The one true language can't exist because we want to use a finite set of characters to express convenient programming syntax. (A previous comment about this.[0]) It might be possible t…

> So, if we attempt to create a Frankenstein language that combine concepts of bash and C, which set of programmers do we inconvenience with the noisier syntax?

I won't speak for others, but I can make that choice for myself, and I'm willing to give the C-like language the upper hand. If bash like things were high enough priority, I might change the name "system" to "run" so it was just a bit more concise, perhaps taking multi-line strings to tidy it all up. I'm not saying one language to rule them all, I'm just saying I could have one language for nearly everything I've done or want to do.

What I was talking about was more like what features does the language have. For instance, I like algebraic data types (sum/product types). I like generics/templates. I want an "any" (variant) type. I want complex numbers and matrices. I like operator overloading so I can implement new arithmetic types. I want simple and immutable strings. I want structs and unions. I want SIMD types. I could also list things I don't want.

Anyways, I could go on, but all of those fit in a single efficient and expressive language. Some current languages come close, but get important details wrong.

> I also don't see how one language can offer both garbage-collected memory and manual allocated memory using convenient concise syntax _and_ and zero-cost runtime performance-penalty for manual memory. Those two goals contradict each other.

There are a lot of details that matter, and I can already anticipate some of your objections, but I would be very happy with automatic reference counting on a type system which precludes reference cycles. I would not use atomic increments or decrements (which is one of the more costly aspects of reference counting), and I would not let threads share data directly. This provides deterministic memory management and performance not too short of what you get in C, C++, or Rust.

So not "zero-cost", but damned close. It's also simple enough to think about the implementation so you can easily keep the non-zero-cost parts out of the inner loops.

Of course someone else would disagree and say they can't accept this (minor) compromise.

Ousterhout had a famous quote about needing both a high and low level language. For him, that was Tcl and C. I think I could have everything I need/want for high and low level tasks in a single elegant language. You're not alone in disagreeing :-)

Re: Alan Kay and OO Programming

#116

Earlier quoted context omitted.

> Statistically, someone is going to be right. Yes. If you ask 100 people what the answer to "3 + 5" is, you'll mostly get "8". But that's because you're asking them all for the right answer to the same problem. If you ask 80 of them the answer to "3 + 5" and 20 the answer to "3 + 2", the right answer isn't 8 and the people who answered 5 for the latter aren't wrong. They are solving different problems. Given the bre…

> I can't point to a single language that I would prefer for all of the different kinds of programs I've written. I never liked the "pick the right tool for job" cliche in the context of programming languages. I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Other than size, weight, po…

> never liked the "pick the right tool for job" cliche in the context of programming languages

Me neither. Many of the differences are fairly random, at least in relation to the task they're being applied to.

Reminds me of the distinction we had in the late 80s and early 90s between "server" and "client" operating systems. "Client" operating systems had user friendly GUIs and crashed a lot. "Server" operating systems were solid but didn't have (nice) GUIs. Makes sense, right? Except that it was complete hogwash, there was no actual reason for it except random chance/history. As NeXTstep amply proved.

Why do we have Java with byte-codes on the server? This was initially invented for small machines, and the bytecodes/VM were for applets and "write once, run anywhere". How does that make sense on a server. You are deploying to a known machine. With a known instruction set architecture. It doesn't, that's how. But Java failed on the desktop and the server was all that was left.

> I don't think it has to be a superset of all languages monstrosity either.

Agreed. Most programming languages are actually quite similar. I am personally finding that the concepts I am adding to Objective-Smalltalk[1] work well, er, "synergistically" in (a) shell scripting (b) application scripting (c) GUI programming (d) server programming. Haven't really tried HPC or embedded yet.

[1] http://objective.st

Re: Alan Kay and OO Programming

#117

Earlier quoted context omitted.

> I can't point to a single language that I would prefer for all of the different kinds of programs I've written. I never liked the "pick the right tool for job" cliche in the context of programming languages. I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Other than size, weight, po…

> I'm curious if you can imagine a single programming language which you /would/ prefer for all of the different kinds of programs you've written. Not that it does exist, but could it? Nope. Granted, I may work on a greater breadth of software than the average programmer. But, at the very least, I have implemented language VMs and garbage collectors where I needed to work at the level of raw bytes and manual memory m…

I find Objective-C to have that range. I have used it for implementing everything from kernel drivers (DriverKit, yay!) to programming languages to server apps and GUI apps.

Not perfect at the entire range, but it does have it.

And having used it and seen what worked well and what didn't, I have some ideas as to how to make it better.

I think it could be improved by having the Smalltalk-side be the default and then add mechanisms to move towards the machine again. Either very simply (add some primitive type declarations) or with greater power, from a less constrained base.

Re: Alan Kay and OO Programming

#118
post #66

Earlier quoted context omitted.

I really don't agree with your point. The analogy Kay uses with biology is very telling : Cells (co-)evolved for billions of years, they were not "designed" to accomplish certain tasks. Just survival and reproduction. And still, even with those billion of years, we still have cancer (as in bug in the reproduction process). We design software. We evolve software. Software doesn't build itself, or decide for itself wha…

> Dynamic languages let you think a problem you haven't thought of at design time will somehow solve itself magically at runtime, using components designed weeks before, with knowledge of that time. I think that's a misleading summary. Both dynamic and static languages suffer when it comes to changes over time (people will argue over which suffers more, but both suffer) so solving problems you haven't thought through…

Ok so what is the benefit of dynamic / runtime binding, then ? Isn’t it to reach potential combination of components talking together in ways you couldn’t (or didn’t want to) anticipate at compile time ?

Re: Alan Kay and OO Programming

#119
post #2

I have a ton of respect for Alan Kay and think he's a genius. But why does it seem like every time he talks about OO it's always painting an apocalyptic picture like we're in some kind of twilight zone alternate nightmare reality of broken patterns and models? Surely our concept of objects and OOD can't be that bad, but his apparently contrary outlook is just so persistent...

> Surely our concept of objects and OOD can't be that bad Yes, it is. Object orientation is probably the worst idea to ever have appeared in computer science, both from a philosophical and practical point of view: it is an unsound principle and it leads to disastrous engineering practices. We will be mocked mercilessly by our descendants.

Actually, OOP is the most successful architectural style in existence.

Pretty much all the GUI software you see is OOP. Modern personal computing was invented on OO. The Web was invented on a NeXT in Objective-C on AppKit.

OOP was seen by Fred Brooks as one of the few possible technologies that come close to a "silver bullet" when he wrote NSB, and ten years later he said that this had come true.

Today, we tackle problems orders of magnitude larger and more complex than pre-OO. We have reuse at levels that were only dreamed of (and largely thought impossible) before.

etc.

Re: Alan Kay and OO Programming

#120
post #118

Earlier quoted context omitted.

> Dynamic languages let you think a problem you haven't thought of at design time will somehow solve itself magically at runtime, using components designed weeks before, with knowledge of that time. I think that's a misleading summary. Both dynamic and static languages suffer when it comes to changes over time (people will argue over which suffers more, but both suffer) so solving problems you haven't thought through…

Ok so what is the benefit of dynamic / runtime binding, then ? Isn’t it to reach potential combination of components talking together in ways you couldn’t (or didn’t want to) anticipate at compile time ?

Your comment feels very aggressive and uninterested in actual debate.

My primary benefit is not spending the time telling the computer things it should already know. Dev time is the most limited resource, I prefer not to spend it restating the obvious. And yes, sometimes this restatement could be complex to express.

The biggest benefit I see most static typing advocates benefiting from is IDE-hints, not compile-time checking. But IDE hints aren't what people use to advocate for static typing.

There are many reasons for different approaches - but if you want to limit it to a single thing, feel free. Just don't expect many people to be convinced, or even interested in your arguments.

Post reply on HN