Do not upgrade
-
-
@Arantor I think we're saying the same thing in different words.
-
@Arantor said in Do not upgrade:
E.g. zero padding a number to 5 digits, need not be more than:
("00000" + var).slice(-5)
It needs to be a little bit more than that, unless you have a hard and eternal guarantee(1) that the number in
var
will never be longer than five characters and will never have e.g. leading spaces or + or - signs. (Maybe it's already a string with a leading space, or maybe the number is negative.00-42
doesn't seem like a good "zero-padded to five characters" result.)(1) We all know that there's no such thing, right?
-
@Steve_The_Cynic well, yes, but I was playing sort of the reductionist argument... depending on your needs this may well be enough, or it might not. But even so, for most needs you could probably get it in a couple of lines.
I think you're right though, we're all dancing around the same point: that it's perfectly reasonable to bring good libraries (and there is a variety of smells to discern good libraries), but that the current trajectory of development is to just pull in libraries for everything first.
The guy I leave behind at the end of the week is like that - can glue libraries together but has to be prodded to consider what would happen if there wasn't a library for his needs.
-
@Arantor said in Do not upgrade:
("00000" + var).slice(-5)
Interesting choice of variable name.
May I suggest
if
ornull
next time?
-
@Arantor said in Do not upgrade:
For example I see things like Babel and i think “what combination of circumstances led you to the point of concluding that this was the best possible solution to your problem?”
I think it is more like C was the correct solution for making Unix run on various CPUs. Adding the new functionality to all the browsers is duplicating effort and then there will always be users that have older devices they don't update for whatever reason, and the desire to support at least some of them.
Treating the in-browser environment as low-level platform to which you compile rather than writing directly for it makes sense. By embracing it completely the browser vendors could save effort on enhancing the base language to free more of it for hunting down security holes and stabilizing the “web api” (i.e. the things that have to be implemented by the browser itself).
When WASM gets to getting a garbage collector, I think Javascript should be deprecated and developers let to compile whatever they like to WASM—easier for the browser vendors and more flexible for the developers.
-
@Zecc said in Do not upgrade:
Interesting choice of variable name.
May I suggest
if
ornull
next time?Two of my favourite variable names are
set
and->
.
-
Status: Wondering what flying dumpster fire of a programming language @dkf has to deal with where
->
is valid variable name.
-
@Gąska It's legal in Tcl, but not commonly used as the
$varname
syntax doesn't support ugly stuff like that. But as a dump variable where you're only interested in the things after it (such as the captured substrings from a regular expression match) it's great.Example:
if {[regexp {^abc(\d+)def$} $someInput -> theDigits]} { puts "I found $theDigits" }
The only other weird thing for a general reader not used to the language is that literals are surrounded by braces.
-
-
-
@boomzilla colon facepalm colon.
-
So: "NPM" == "Naughty Provider (of) Malware" ???
-
-
@Carnage Another near miss for us, because we are not doing React.
-
The place I just left does React, but I don't feel motivated to tell them about it...