Hacker News new | ask | show | jobs
by klibertp 4181 days ago
> Yet, there are features that lead (with a high probability) to bad program code (see goto)

No, I disagree. It's feature usage - or rather misusing it - that leads to "bad code". And that's even before we start talking about what is a "good" or "bad" code, which is OK to discuss on a high-level, but invariably leads to flame wars when it comes to details.

> I’m pretty certain such a thing exists for language design, too.

What I'm saying is that I didn't see this in action, ie. I found no obvious correlation between any single feature and good or bad language design, across all the languages I learned/investigated (EDIT: where the sample size is 40, also see below). Also, saying that a particular language design is "good" or "bad" is utterly meaningless: the only way of judging PL designs is on how well they suit to some purpose. Take a look at J or Forth - these are beautiful designs, yet you probably wouldn't want to use them to code a basic CRUD app.

> comparing penises by writing out numbers w/o any reference is silly at most.

My VPS hosting is dead for some reason, but you can see - incomplete, work in progress - list of those languages here: https://klibert.pl/articles/programming_langs.html (when it comes back EDIT: should be working now).

Also, thanks for assuming so much about my mentality from a simple comment; in reality I'm just happy and excited about my new side project, which happens to be about documenting my experience with various languages and their usefulness in polyglot setting.

1 comments

> It's feature usage - or rather misusing it - that leads to "bad code".

I still don’t agree with this. There are features that invite misusing them, or pose a greater risk of being misused. For example, with operator overloading developers often leave out some cases, causing possible dangerous behaviour afterwards. Or goto, which has a very big risk of being misused (compare the possible useful cases against the many, many cases where it’s not).

> Also, thanks for assuming so much about my mentality from a simple comment

Indeed, that’s what happens when such a comment is first impression.

> There are features that invite misusing them, or pose a greater risk of being misused

Of course, that's true! But, depending on a language, including such risky features may be a sign of good design, too. I mean, if 'goto' is that bad a feature, how come it persists in C for so long and shows no signs of going away? Similarly:

> For example, with operator overloading developers often leave out some cases, causing possible dangerous behaviour afterwards

is certainly true, but it doesn't mean that including operator overloading in a language design is a "design smell". Julia users would probably kill anyone who'd try to take operator overloading from them, for example.

Some language features are more risky - in the sense of encouraging misuse - than other; however, mere inclusion (or absence) of a feature says nothing about how good or bad particular language design is. You need to evaluate language design by taking into account all of its features taken together at the very least, and preferably consider them in the context of language goals and intended uses too. Otherwise it's unfair to the language and its creators.