by andai · 2y ago · 0 comments
(Actually, implicit unquoted strings sound so nightmarish it's comical, but let's do one question at a time...)
I used to think the solution was static typing, but then I found none of the same infuriating bugs in Python, which has dynamic but strong typing, forcing you to be explicit about type conversions.
Edit: I think I've hit the nesting limit, so please reply to parent comment and I will find it.
The two languages certainly both have their terrible warts. I think in the implicit conversion gotchas, JS is actually markedly worse. Perl has polymorphic values, but somewhat typed (for its basic types) operators (eg "eq" for strings, "==" for integers). JS has both implicit value type conversions and overloaded operators. That leads to an unholy level of indeterministic mess.
I think the people that love perl love its expressiveness. It has a little bit of functional programming here, and a system for making an object-oriented language, and all of these handy tools and you choose which ones you need or find most readable. I've heard Ruby called a better Perl, and - as someone whose day job is largely those two things - that's completely fair.
Eg. putting "use v5.14.0;" or similar on top of your file (or compilation unit/scope) will indeed turn on strict mode for you, along with adding a number of features as well.
At the time, also auto-toggling warnings was considered unacceptable because technically, using the warnings pragma anywhere had some edge case action at a distance. This has been remedied in some later release after I wasn't involved in the language development anymore, and from some more recent version, warnings are also part of the standard import.
I imagine you (TheDauthi) already know that, though.
Possible effects: People that must use Javascript, but don't want to (only choice, only framework). People that use Javascript because it's hyped or hot, not because of personal interest. Larger volume of talk, so more opportunities for griping. Much larger perception of griping (blogs, HN links, news. You almost have to work to find the Perl griping locations). The talk tends to more work issues (stuck on project, annoyed at issue), and not discussing a language you write with because you enjoy the features.