Better HN
topnewbestaskshowjobs
Log inSign up

goto11

5,798 karma · joined Oct 25, 2018 (8y ago) · 2,446 submissions

Submissions

comment 6mo ago · link · parent

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 6mo ago · link · parent

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 6mo ago · link · parent

You cant have a `type Foo = String | Strimg` in Haskell either.

comment 6mo ago · link · parent

Well it is a type union. The union of string and string is just string.

comment 2y ago · link · parent

There is no "the interest of the people". There are lots of different people with different and often conflicting interests.

comment 2y ago · link · parent

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 2y ago · link · parent

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 2y ago · link · parent

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 2y ago · link · parent

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 2y ago · link · parent

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 2y ago · link · parent

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 2y ago · link · parent

Scheme would probably be the most hated language in the world.

comment 2y ago · link · parent

> 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 2y ago · link · parent

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.

comment 2y ago · link · parent

> Identifying high-quality libraries and frameworks that meet your project needs

This is a really important skill that I find difficult and frustrating. Does anyone have good advice or resources?

comment 2y ago · link · parent

But this is just computed gotos. There is no continuation passed.

Arguably the main point of continuation-passing style is that you pass a continuation along with the jump. Hence the name.

comment 2y ago · link · parent

GOTO does not pass a continuation though, so I can't see how it is similar to continuation-passing style. GOTO is just a jump like jumps in machine code.

BASIC does not have notion of a continuation as a value.

comment 2y ago · link · parent

> "When I was younger, I looked at my great grandad's prisoner-of-war diaries and I just love everything about the period."

Is this some kind of understated British humor?

comment 2y ago · link · parent

The Grimm Brothers didn't write the stories, they collected and published folktales. In any case they would have been been out of copyright since Jacob Grimm died in 1863.

Disney didn't mind paying for the rights if they wanted to use material still under copyright, like they did for Bambi or Dumbo or many others.

comment 2y ago · link · parent

It is still type inference though. If 2 is an int, the compiler perform type inference to figure out that the expression 2 + 2 is also an int. It is just that traditional languages only use type inference for expressions, not declarations.

comment 2y ago · link · parent

But that would only help you if you assign the numeric literal directly to a variable. If you use it in an expression like `foo(10)` or `10 * bar` you would still not see the numeric type specified.

So if you want the type to be always explicit, the type specifier should be coupled with the literal like `10[i32]` or similar, so you can write `foo(10[i32])`.

comment 3y ago · link · parent

And digging a step deeper: Over-engineering often happen because you think you might need the complexity later, but it will be more difficult or risky to extend the system at a later time.

E.g. starting out with a microservice architecture even though you only have 100 users, because you think it will be too difficult to re-architect a monolith the day you hit a million user.

So you should address why it feels like the code becomes less malleable over time.

comment 3y ago · link · parent

Collapsing margins was a sane default in the original use case of CSS - text documents with sections and headers. But it is not intuitive when working with GUI components.

comment 3y ago · link · parent

Box office across all three of the sequel trilogy moves. The same is the case for the three movies in the original trilogy btw, so I guess we should conclude that "Return of the Jedi" was the only Star Wars was movie people actually liked, since The Force Awakens is one of the most successful movies of all time?

In reality, sequels tend to be less successful than the original, but can expect a certain audience. Since only very successful movies get sequels, sequels are still safer investments than original movies.

12345
82