Live data from Hacker News

In defense of complicated programming languages

viralinstruction.com

371–379 of 379 posts

Re: In defense of complicated programming languages

#371

Earlier quoted context omitted.

White space is bad for readability anyways. I don't think that would be doable.

> White space is bad for readability anyways. Question{Which|of|these|sentences|is|easier|to|read;This|one?} Or this one in the next line?

I meant in the context of programming.

Re: In defense of complicated programming languages

#372
post #121

As someone who strongly dislikes complicated languages, it's obvious to me that it's a matter of personal preference; personal aesthetics, if you like. If the choice is between complexity in the language and elsewhere, often I'd rather it be elsewhere. But while that preference is entirely subjective, what isn't subjective is the distribution of that preference among programmers. I think that we can say with as much…

Funny to see this > As someone who strongly dislikes complicated languages while > Working on OpenJDK at Oracle as if Java was uncomplicated…

Everything is relative. Java is more complicated than Clojure and Python, but it's less complicated than C#, Scala, and Kotlin, and no more complicated than Swift.

Re: In defense of complicated programming languages

#373
post #303

Earlier quoted context omitted.

Flexibility usually has a cost. It's not better or worse.

Correct! When the language provides apparatus to do the thing, everybody doing the thing is incentivized do it the same way, making libraries implicitly compatible. Cobbling things together yourself (which you can always do: these languages are Turing-complete) you are unlikely to do it compatibly with what anybody else does. This might be why Lisp never developed an ecosystem. Everybody can make their own pile of ma…

So would this argument not apply to the use of Templates in C++? Everyone can design their own--what is to keep these from slopping all over the landscape?

Re: In defense of complicated programming languages

#374

Earlier quoted context omitted.

> Classes are not just unnecessary, they're a bad abstraction. And yet, there are approximately 0 examples of the "closure-backed classes" example you give, while every vaguely popular language except C has some variant of polymorphic classes, from StandardML to Lisp. Your closure example is not used in any langauge because it's extremely un-ergonomic. If the langauge doesn't have some kind of concept of "interface"…

Using C, which doesn't even have closures, as an example of why this doesn't work is rather silly. How can you have closure-based classes without closures? The ergonomics are beyond horrific in this case but I don't see how that's relevant. > And yet, there are approximately 0 examples of the "closure-backed classes" example you give, while every vaguely popular language except C has some variant of polymorphic class…

> I'm not arguing ergonomics, just implementation details, you can add all the syntax sugar you want :)

Oh, good. That sugar actually already exists in most OO languages, and usually it's called...

   class
> What problems do classes address?

The problem of getting sweet ergonomic syntax for the concepts of encapsulation, polymorphism, possibly inheritance (with additional sub-divisions mainly on whether multiple- or single-ancestor), interface, abstract class, type class, trait, structural typing, etc, etc. Currently implemented in varying combinations and to varying degrees in different languages.

So make up your mind: Do you have something against syntactical sugar for all those, or don't you?

Re: In defense of complicated programming languages

#375
post #360
post #356

Earlier quoted context omitted.

There are no classes in Rust, and it's better for it. That's my point, some abstractions like classes are NOT necessary. There were arguments before Rust 1.0 that people will simply try to emulate classes. But nobody actually bothered, because traits provide enough functionality that you don't actually need to have classes to actually write maintainable and understandable programs. I'm attacking the exact point of th…

> There were arguments before Rust 1.0 that people will simply try to emulate classes. But nobody actually bothered, because traits provide enough functionality that you don't actually need to have classes to actually write maintainable and understandable programs. It's not only traits. Traits (well, traits objects) are used for dynamic dispatch, traits themselves are used as composable interfaces, and structs + impl…

> There's only dogs that are barking.

   class DogSoundFile
   constructor Create(MP3File, Weight);
   ...
Bit silly, innit? (Are bigger MP3 files heavier...? :-)

Re: In defense of complicated programming languages

#376
post #373
post #303

Earlier quoted context omitted.

Correct! When the language provides apparatus to do the thing, everybody doing the thing is incentivized do it the same way, making libraries implicitly compatible. Cobbling things together yourself (which you can always do: these languages are Turing-complete) you are unlikely to do it compatibly with what anybody else does. This might be why Lisp never developed an ecosystem. Everybody can make their own pile of ma…

So would this argument not apply to the use of Templates in C++? Everyone can design their own--what is to keep these from slopping all over the landscape?

> So would this argument not apply to the use of Templates in C++?

Yes, AFAICS arguably it would.

> Everyone can design their own--what is to keep these from slopping all over the landscape?

Who says there is anything to do that?

Re: In defense of complicated programming languages

#377
post #373

Earlier quoted context omitted.

So would this argument not apply to the use of Templates in C++? Everyone can design their own--what is to keep these from slopping all over the landscape?

> So would this argument not apply to the use of Templates in C++? Yes, AFAICS arguably it would. > Everyone can design their own--what is to keep these from slopping all over the landscape? Who says there is anything to do that?

I was referring to

> you are unlikely to do it compatibly with what anybody else does

Re: In defense of complicated programming languages

#378
post #377

Earlier quoted context omitted.

> So would this argument not apply to the use of Templates in C++? Yes, AFAICS arguably it would. > Everyone can design their own--what is to keep these from slopping all over the landscape? Who says there is anything to do that?

I was referring to > you are unlikely to do it compatibly with what anybody else does

Yes, and I was implying there's nothing to make sure it's compatible.

Re: In defense of complicated programming languages

#379
post #360
post #356

Earlier quoted context omitted.

There are no classes in Rust, and it's better for it. That's my point, some abstractions like classes are NOT necessary. There were arguments before Rust 1.0 that people will simply try to emulate classes. But nobody actually bothered, because traits provide enough functionality that you don't actually need to have classes to actually write maintainable and understandable programs. I'm attacking the exact point of th…

> There were arguments before Rust 1.0 that people will simply try to emulate classes. But nobody actually bothered, because traits provide enough functionality that you don't actually need to have classes to actually write maintainable and understandable programs. It's not only traits. Traits (well, traits objects) are used for dynamic dispatch, traits themselves are used as composable interfaces, and structs + impl…

Of course it can be as simple as that, that's beside the point

But almost every time you actually won't ship a program that just prints stuff to the console

That's why I did it that way, because how you actually output won't be println, but probably to a window or a socket, or whatever

The core functionality of passing a slice will be actually useful in those cases, you can include this code in your final program

Post reply on HN