Live data from Hacker News

Node.js and the new web front-end

nczonline.net

141–150 of 163 posts

Re: Node.js and the new web front-end

#141
post #88

Earlier quoted context omitted.

Java and .NET are the only strongly typed languages used heavily as a web backend. Python, PHP, Ruby, and Node.js are all weakly typed.

Yeah this strikes me as the usual "language X sucks, because dynamic languages suck".

Not really, scripting has it's good uses. It's just wrong to use scripts to replace programming languages for all tasks.

Re: Node.js and the new web front-end

#142
If you ever complained about having to refactor a messy ex-outsourced codebase in Java/C#, then wait for wider JS adoption. I bet JS not being used for business logic will be advertised as a feature in job listings.

Re: Node.js and the new web front-end

#143
post #133
post #76

Earlier quoted context omitted.

What's so good about TypeScript's type system and what problem does it solve?

Almost no one realizes this, but the main purpose of TypeScript is to negate one of JavaScript's greatest advantages which is the lack of typing. This is an advantage because it makes code easier to write and read. The problem that TypeScript solves is that the web platform is in direct conflict with Microsoft's monopolies in PC gaming and business productivity software (Office). Confusing developers into thinking th…

Holy mother of god, HOW is untyped code easier to read?!

Re: Node.js and the new web front-end

#144
post #133

Earlier quoted context omitted.

Almost no one realizes this, but the main purpose of TypeScript is to negate one of JavaScript's greatest advantages which is the lack of typing. This is an advantage because it makes code easier to write and read. The problem that TypeScript solves is that the web platform is in direct conflict with Microsoft's monopolies in PC gaming and business productivity software (Office). Confusing developers into thinking th…

I think optional typing is better than no typing. It's useful for allowing APIs to be self documenting. It seems as if optional typing is going to get more and more popular. For example, see Google's optional typing in dart, where they actually recommend to not use types for local variables: https://www.dartlang.org/articles/style-guide/#type-annotati...

I am not sure. I think that descriptive identifiers can indicate the type and be augmented by documentation.

Re: Node.js and the new web front-end

#145

> As much as I love JavaScript, there are just some things I don’t want written in JavaScript – my shopping cart, for example. After developing almost exclusively in JavaScript for the better part of the past year (and doing a lot more in the previous 6), I'm convinced that this mentality is going to start fading as more and more developers become more capable and productive with JavaScript. There's nothing inherentl…

You're kind of quoting him out of context

> I believed, and still do believe, that statically typed languages are exactly what you want in the guts of your business logic.

He wasn't making a case against javascript for his shopping cart but rather against dynamic languages.

Now, you could certainly disagree with that as well, but it opens the discussion to a more correct one vs why you believe javascript is a mature language. Something the author actually agrees with.

Re: Node.js and the new web front-end

#146

Earlier quoted context omitted.

Okay, aside from some scientific functions, what do you really need from an integer that 52bits isn't enough for?

It's not about storing large numbers, but math precision. For example: 0.3 * 3 => 0.8999999999999999 A few rounding mistakes and you have a huge mess.

You seemed to have jumped from talking about integers to floating point!

And the example you have given is a problem with all floating point implementations, not just Javascript. You will get that exact same answer in C, Java, etc.

The only way to avoid this is to represent rational numbers directly, without simplification. For example:

  (3/10) * 3 => (9/10)

Re: Node.js and the new web front-end

#147
post #144

Earlier quoted context omitted.

I think optional typing is better than no typing. It's useful for allowing APIs to be self documenting. It seems as if optional typing is going to get more and more popular. For example, see Google's optional typing in dart, where they actually recommend to not use types for local variables: https://www.dartlang.org/articles/style-guide/#type-annotati...

I am not sure. I think that descriptive identifiers can indicate the type and be augmented by documentation.

They can. But both tend to get out of date as a codebase develops. It's very useful to have an automated tool that ensures the documentation lines up with the actual code - i.e. a type checker.

Re: Node.js and the new web front-end

#148
post #146

Earlier quoted context omitted.

It's not about storing large numbers, but math precision. For example: 0.3 * 3 => 0.8999999999999999 A few rounding mistakes and you have a huge mess.

You seemed to have jumped from talking about integers to floating point! And the example you have given is a problem with all floating point implementations, not just Javascript. You will get that exact same answer in C, Java, etc. The only way to avoid this is to represent rational numbers directly, without simplification. For example: (3/10) * 3 => (9/10)

There are no integers in js, all numbers are floats. What you want to do is represent all values as integers choosing an arbitrary precision, then only do integer math.

In the example given, using node-bignum and assuming our precision is a thousand of a cent:

    big(30000).mul(3) => 90000
Of course you'd get the same result in plain javascript with these numbers, but then you'd have to handle everywhere an operation could return decimals, and using bignum you have "unlimited" precision > 52bits.

Re: Node.js and the new web front-end

#149
post #110

Earlier quoted context omitted.

What's the big deal with getting bignum into js? Everything else I can agree with, but not having 64bit int support in a server side language has to hurt. (just look at most node db adapters and bigints are handled as strings)

Okay, aside from some scientific functions, what do you really need from an integer that 52bits isn't enough for?

I don't need "an integer bigger than 52 bits". I need a way to represent (fixed-precision) decimals exactly, and do arithmetic with them, preferably without performance being too terrible or the code looking too horrible. And I'd like it to be a standard implementation, or conform to a standard interface, so that a library ecosystem can build up with support for this type.

Re: Node.js and the new web front-end

#150
post #133

Earlier quoted context omitted.

Almost no one realizes this, but the main purpose of TypeScript is to negate one of JavaScript's greatest advantages which is the lack of typing. This is an advantage because it makes code easier to write and read. The problem that TypeScript solves is that the web platform is in direct conflict with Microsoft's monopolies in PC gaming and business productivity software (Office). Confusing developers into thinking th…

The "Open Web" is closed to one single language choice that was made for you by someone else. TypeScript is being developed, because Microsoft adapts to where the world is moving and they are just trying to avert the disaster that will happen when enterprises will actually start trying developing whole applications in JS. And Google is developing a higher-order version language as well. Nobody developed a language to…

> Nobody developed a language to run on top of Java

Clojure? Scala?

Post reply on HN