Lurker News
Back to discussion

Comment by pedrocx486

pedrocx4865 replies#
It's a bit sad that people today still "fanboy" against a lang, like a lot of people still do for PHP (which has absolutely improved from the absurdity it was). JS followed the same path, ES2016 is an absolute dream to code on.

Maybe I'm biased? PHP paid my bills for a long time and currently I'm a front-end developer that works mostly with Angular (but sometimes I jump into the .NET Core backends). I love JS and TS, they evolved nicely along the years.
Nothing against being a fanboy for one specific lang, but thinking "X" language is bad/joke/nightmare isn't nice and makes people that work with them look like losers, which they aren't.

SonOfLilit3 replies#
PHP and Javascript both improved significantly, but both still have horrible legacy baggage that can't be rid of, namely weak typing (not dynamic, where a variable can hold any type, but weak, where "1"+2=3). For me, that makes programming in either language like running in a minefield. And still, I write Javascript daily, because myeusers don't care about weak typing :-)
chrisweekly2 replies#
If you really care so much, why not simply embrace TypeScript?
Kinrany3 replies#
TypeScript is awesome compared to JavaScript and even to other popular C-like languages. But it inherits all of the problems of the JS ecosystem without providing all of the benefits.

To make a JS package consumable by a reasonably strict TS project, someone has to basically rewrite the package. It's less effort than writing one from scratch, but it's not free.

Continue this thread — 3 replies

SonOfLilit#
Perhaps one day I will. When I last started a big JS project it wasn't mature enough to build a company around. This does seem to be changing.
z3t42 replies#
Strong/weak and dynamic/static. JS is dynamic, but variables will always have a type, which is memory safe - which makes types strong.
Ndymium3 replies#
I thought weak/strong typing is more about how explicit/implicit type conversion is. In PHP and JS it's almost always implicit and they don't warn you for mixing most types, whereas e.g. Python will complain. That's one thing I don't enjoy with PHP/JS. A lot of certainty goes out of the window with it.

Continue this thread — 3 replies

jt21901 reply#
I’ve heard another definition of strong, which is that the compiler will make more guarantees, and in those cases the terminology was:

    * safe/unsafe
    * strong/weak
    * static/dynamic
Note that while safe/unsafe is basically all-or-nothing, strong/weak and static/dynamic are more of a spectrum, so JavaScript would be safe, weaker, and more dynamic than other languages. Typescript makes JS stronger when authoring code.

Continue this thread — 1 reply

kmill1 reply#
Javascript is a lot saner than that. The result is "12". (I'm ok with automatic casting so long as it's an embedding. Every number has a reasonable string representation, but not vice versa. Wanting explicit casts like in Python is defensible, though.)
SonOfLilit3 replies#
Huh, what do you know.

Still, this is unforgivable in my book:

  [] + {} == "[object Object]"
  {} + [] == 0

Continue this thread — 3 replies

tasuki2 replies#
Would you agree that a language X can be objectively superior to language Y?

I worked with PHP professionally for some 10 years, with very competent colleagues from whom I've learned a lot. The PHP ecosystem with Composer and Symfony components is quite good. Still, PHP itself is a terrible language. I have less knowledge but a similar opinion of JavaScript. Doesn't mean people working with PHP or JavaScript are losers - I admire their tenacity and do feel a little bad for them.

tarsinge2 replies#
The point is that a language can evolve so much they are not even the same language. I prefer ES2016 to Python for example.
fastball4 replies#
Eh, the weak typing intrinsic in JS still makes Python win out between those two.

Continue this thread — 4 replies

amelius3 replies#
Numpy wouldn't work in JS because you can't overload operators afaik. Numpy/scipy are reasons why many people love Python.

Continue this thread — 3 replies

wolco1 reply#
Terrible compared to what? What do you find a better language? What makes a language terrible for you?

Is COBOL terrible or C Or Go?

tasuki#
Good questions, not sure I can answer satisfactorily :)

> Terrible compared to what?
Terrible compared to other available programming languages.
> What do you find a better language?
Lisps, Haskell, Erlang, Rust, but even eg Python, Ruby, C, Java.
> What makes a language terrible for you?
Allowing me to do unreasonable things and resulting in unreasonable behaviour. Eg JavaScript:
[] + {} == [object Object]
{} + [] == 0
> Is COBOL terrible or C Or Go?
Programming languages are products of their time and context.
When COBOL was created, it might've been the best there was. By now, I think COBOL can be considered worse than many alternatives. If someone decided to write a non-toy greenfield project in COBOL today, I'd be surprised and might question their sanity.
C has two things going for it: it's a simple language and it's close to the hardware. I wouldn't call it terrible.
Go, now I really dislike Go, but I think there might be situations where it's the right tool for the job. Simple web services perhaps?
PHP was terrible already when it was created. I don't hold that against Rasmus, he just wanted to get simple things done, and didn't even intend to create a full-fledged programming language.
JavaScript... Brendan Eich wanted to put Scheme scripting in the browser, but because Java was popular, he was told by management to make it look more like Java and also to call it JavaScript. Oh also he had like a two week deadline or something.
Yea, I dunno... good hard questions :)

heavenlyblue#
“PHP paid my bills” is the same argument as “NHS saved my life” in the UK
carapace#
You're biased, they suck. Doesn't make you a loser for working with them, we all do it. But it's just pulling the wool to think that their obvious utility somehow counter-acts their (also obvious) lousy design. My personal advice is don't identify with your tools. Mark of a mature craftsman is knowing the nature of your tools and getting the job done anyway.
bcrosby95#
I don't really post anti-Javascript commentary, but I have an intense hatred for it because I disliked it and I had to use it for 10 years because it was the only client side language for the web. It is a bit irrational at this point, but I'm not a fan of imperative languages these days, and combining that with past experience makes me really not like it.

I don't particularly care about php because I have basically zero experience with it.