News for hackers. Stuff that matters.
Re:XYPlorer Is Written in VB6 by dalemhurley on Saturday January 11, 2025 @05:22AM (#42664803)
Every single language is a mess. Just look at time and floating point numbers in Java (not having a go at Java).
Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @05:35AM (#42664889)
Every single language has parts that are a mess, or at least not perfectly designed. But that doesn't mean that languages all have an equal amount of mess. Python clearly has less mess than Perl. Rust clearly has less mess than C++. Zig clearly has less mess than C.

There should be a name for the "nothing is perfect so everything is equally bad" fallacy. It's surprisingly common.

Re:XYPlorer Is Written in VB6 by networked on Saturday January 11, 2025 @06:25AM (#42665143)
The fallacy of gray?

https://www.greaterwrong.com/posts/dLJv2CoRCgeC2mPgj/the-fal...

> The Sophisticate: “The world isn’t black and white. No one does pure good or pure bad. It’s all gray. Therefore, no one is better than anyone else.”

> The Zetet: “Knowing only gray, you conclude that all grays are the same shade. You mock the simplicity of the two-color view, yet you replace it with a one-color view . . .”

> —Marc Stiegler, David’s Sling

Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @07:41AM (#42665483)
Ah nice, thanks!
Re:XYPlorer Is Written in VB6 by guenthert on Saturday January 11, 2025 @06:26AM (#42665146)
> There should be a name for the "nothing is perfect so everything is equally bad" fallacy. It's surprisingly common.

I think this falls under splitting (black-and-white thinking), a form of defense mechanism or (I suspect) mere rhetorical tool.

https://en.wikipedia.org/wiki/Black_and_white_thinking

Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @01:07PM (#42667712)
No, black and white thinking is a different thing. It's "the fallacy of grey", linked in a sibling comment.
Re:XYPlorer Is Written in VB6 by donatj on Saturday January 11, 2025 @09:26AM (#42666087)
In Python, default arguments are mutable. That's the ultimate WTF and footgun.
Re:XYPlorer Is Written in VB6 by orbisvicis on Saturday January 11, 2025 @09:52AM (#42666254)
That's somewhat of misnomer. The root cause is that default arguments are evaluated during function creation rather than when the function called. And... this is invaluable for forcing immediate evaluation of otherwise late-binding closures.

What can be confusing is mixed lifetimes of nested generators using `yield from`. If any outer generator has a shorter lifetime, when it is garbage collected `yield from` will forward `close()` to the inner generator. Attempting to re-use the inner generator will result in a premature `StopIteration`. Iterators do not have `close()` and so are unaffected. This affects only `yield from` and not `for i in gen: yield i`.

Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @01:15PM (#42667777)
Yeah that is definitely a footguns but I think calling it the ultimate footgun is overselling it. Perl implicitly casts between strings and integers. That's a waaaay bigger footgun.
Re:XYPlorer Is Written in VB6 by aspenmayer on Saturday January 11, 2025 @01:01PM (#42667656)
> There should be a name for the "nothing is perfect so everything is equally bad" fallacy. It's surprisingly common.

https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good

Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @01:07PM (#42667705)
That's a totally different thing.
Re:XYPlorer Is Written in VB6 by aspenmayer on Saturday January 11, 2025 @01:10PM (#42667738)
Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @04:43PM (#42669147)
Also not the same thing. That would be someone saying "we can't use any language because they all have flaws".

The one I'm talking about is the fallacy of grey, linked from a sibling comment.

Re:XYPlorer Is Written in VB6 by DanielHB on Saturday January 11, 2025 @05:56AM (#42665002)
There are lasting languages and good languages, but there are no lasting good languages.
Re:XYPlorer Is Written in VB6 by nycdotnet on Saturday January 11, 2025 @09:07AM (#42665957)
“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”. Bjarne Stroustrup
Re:XYPlorer Is Written in VB6 by DanielHB on Monday January 13, 2025 @06:43AM (#42682453)
Although I don't disagree with that statement it is not exactly what I was implying. I was implying that good languages eventually grow into bad languages.

Usually happens through tacking on new features and standard API functions without removing old ones. I wish modern languages would allow different modules within the same project to use different versions of the language and be more aggressive about deprecating/removing old features.

So like if you open a module and see "version 3.0" in the manifest you know for sure that this module is not using stupid feature X from version 1.0. While still being able to use "crucial library not updated since 2003" without much fuss.

Most languages these days don't dare to change core syntax behaviour in order to not break backwards compatibility.

Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @04:47PM (#42669181)
Nonsense. There are plenty of good languages that have lasted a while, unless your standard for "good" is unreasonably high.

Java is probably the longest lasting language that I would consider good. Are there things that I hate about it? Of course. But it got a lot of things right - even things that more modern languages have done much worse at, like IDE support.

Re:XYPlorer Is Written in VB6 by MrBuddyCasino on Saturday January 11, 2025 @07:15AM (#42665371)
> Just look at time and floating point numbers in Java

What do you mean? The time & date API in Java is excellent, and the float and double types follow the IEEE standard.

Re:XYPlorer Is Written in VB6 by badlibrarian on Saturday January 11, 2025 @08:41AM (#42665799)
It took nearly 20 years to sort it out. Before Java 8, January was 0 and getYear() for today would return 125.
Re:XYPlorer Is Written in VB6 by stefanfisk on Saturday January 11, 2025 @10:43AM (#42666579)
Wasn’t Java 8 released 11 years ago? If PHP had been in its current state back then it would have been a masterpiece.
Re:XYPlorer Is Written in VB6 by IshKebab on Saturday January 11, 2025 @04:52PM (#42669214)
January as 0 seems like a very definsible choice. Presumably they did it to match C. If anything the WTF there is that the day of the month doesn't start from 0.

Dunno what's up with getYear() though!

Re:XYPlorer Is Written in VB6 by divbzero on Sunday January 12, 2025 @12:05AM (#42671420)
getYear() must have been written in the 1990s during the early years of Java:

   95 = 1995
   96 = 1996
   97 = 1997
   98 = 1998
   99 = 1999
  100 = 2000 !?
Re:XYPlorer Is Written in VB6 by desdenova on Saturday January 11, 2025 @06:38AM (#42665204)
Taking two of the worst languages as an example of "every single language" doesn't really work.