Recent submissions

Comment · 5 months ago
C# was always better than Java as a language. The strength of Java is the ecosystem, and Java being open source and cross-platform from the beginning.
Comment · 5 months ago
Yes, you must have individual constructors for the left and right cases in order to distinguish them. In C# you would use two distinct record types for this. Haskell’s syntax is more concise though, since you define the constructors inline in the declaration of the sum type.
Comment · 5 months ago
You cant have a `type Foo = String | Strimg` in Haskell either.
Comment · 5 months ago
Well it is a type union. The union of string and string is just string.
Comment · 2 years ago
There is no "the interest of the people". There are lots of different people with different and often conflicting interests.
Comment · 2 years ago
Half of his clever quotes are completely bonkers though and have been disproven by history. How many of you are proving your programs correct before entering them into the computer? Because that is the only correct way to program. And remember he disparaged Margaret Hamiltons software methodology. Sure, she helped put a man on the moon, but apparently she did it the wrong way.

I suspect geeks like Dijkstra because he is "edgy" more than because he is correct.

Also, Object-Oriented programming was actually invented in Norway, even though Alan Kay of Smalltalk fame tried to take credit.

He was right about GOTO though, but many developers did not even understand his argument but just read the headline and concluded "GOTO bad".

Comment · 2 years ago
The GOTO-paper is widely misunderstood though. It is making a case for blocks and scopes and functions as structures which makes it easier to analyze and reason about the execution of complex programs. The case against unconstrained GOTO follows naturally from this since you can't have those structures in combination with unconstrained GOTO.
Comment · 2 years ago
Sure, you can use parentheses everywhere, but the code would be quite noisy. Do you think this:

  ((window.location).href) == foo;
is more readable than:

  window.location.href == foo;
Comment · 2 years ago
Thank you for this additional context.

So in short, bitwise operators have lower precedence than comparisons to allow you to write:

    if (a==b & c==d) ...
but of course, this means you can't write bitwise checks like this:

   if (addr & mask == 0) ...
The problem could theoretically have been solved when the shortcut operators were introduced, by increasing the precedence of & and | to be higher than comparisons, but have the shortcut operators be lower. So you would be able to write both:

   if (a==b && b==c) ...

   if (addr & mask == 0) ...
But this was not done due to concerns of backward compatibility with existing code, since now every expression using the old pattern would subtly change semantics. E.g. the first example would now be parsed as:

  if ((a==(b & c))==d) ...
Comment · 2 years ago
I think it would be adopted exactly as widely as JavaScript is. People choose JavaScript because it is supported by the browser, not because they think it has a beautiful syntax. If some other language has been supported instead (whether VBScript or Scheme or whatever), people would use that.

Semantic markup languages were niche until the web happened. Objective-C was a weird niche language until the iPhone app boom. People learn the languages they need to learn.

Comment · 2 years ago
Netscape had market dominance at the time so Internet Explorer had to keep bug-for-bug compatibility with Netscape to keep up. Given the amount of bugs and the lack of documentation of JS, this must have been quite frustrating for MS who was used to calling the shots.
Comment · 2 years ago
Scheme would probably be the most hated language in the world.
Comment · 2 years ago
> Manage your time better.

Thank you for the advice which is no doubt well-intentioned.

But don't kid yourself. If you use your spare time for research and development to solve problems at work, then it is not really a hobby, it is just you working overtime for free. If that makes you happy, good for you, but it doesn't change the fact that time and resources are limited. The time is just cheaper in your case.

Comment · 2 years ago
Are you perchance working in academia? Your suggestion seems to assume unlimited time and resources to write everything yourself, while the purpose of using third-party components usually is to save time and resources.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton