|
Jeroen_R wrote: Also: don't use var anymore, use const or let. And use a transpiler if you need to support old IE versions.
JavaScript and new rules for a an old JavaScript prototype builder.
Also, I don't want to support old IE.
It's dead, Jim!
|
|
|
|
|
raddevus wrote: It's only 1000 lines of code. (That's like 4 printed pages. Not bad.)
Only if you have VERY good eyes, because it would be printed in ... Courier New point 2
I'm guessing you actually mean 20 printed pages in Courier New point 9 (which is also not bad)
|
|
|
|
|
V. wrote: Only if you have VERY good eyes, because it would be printed in ... Courier New point 2
Hahaha! You are right. I was thinking 250 words per page.
I'm nuts!! 20 pages!! What's going on around here? Oh man, I got to go back and slim things down.
|
|
|
|
|
raddevus wrote: new room({location:i}) just sends in a json object which is used to initialize the object.
‘{location:i}’ is Javascript syntax for defining an object.
JSON is a format for persisting Javascript objects as text.
|
|
|
|
|
jarvisa wrote:
‘{location:i}’ is Javascript syntax for defining an object.
JSON is a format for persisting Javascript objects as text.
That's a very good (specific) point.
|
|
|
|
|
A poor craftsman blames his tools.
Javascript (or any language) is as good or bad as the developer using it. You can paint yourself in a corner using any language the only difference is the color of the paint!
Sorry guys, but tell me that ain't the truth.
If you think hiring a professional is expensive, wait until you hire an amateur! - Red Adair
|
|
|
|
|
ClockMeister wrote: A poor craftsman blames his tools.
ClockMeister wrote: Sorry guys, but tell me that ain't the truth.
LIES!! All LIES!!
Yeah, I totally agree with you actually. However, sometimes certain tools need a spark guard or a wires that are covered with insulator that protects me a bit.
Sitting In Tub With Toaster
I mean, yes, if I'm sitting in the tub holding a plugged in toaster, then I'm the toast. But if my toaster kills me for touching it while it's toasting that's another thing.
|
|
|
|
|
A good craftsman blames himself, for not bringing the right tols to the job.
|
|
|
|
|
raddevus, thank you for sharing your story! This is exemplary case why JS is a time bomb, not a language!
JS made for children, meaning when child say "I want that!" (despite he allowed or not), JS just silently does "that". It's horrible practice and strictly disallowed in enterprise code. That's why we use "statically typing" languages - they give you 100% guarantee you don't call "toaster.GimmeCoffe" - simply because it cannot!
I feel a big sorry for poor JS developers - they chose so horrible language and waste so much time on learning, developing, debugging... Guys, what for?? Are you masochists??
|
|
|
|
|
JavaScript is like virginity. It is its' own punishment.
Really and Truly.....
|
|
|
|
|
I love JS. Does that make me NOT a developer?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev wrote: I love JS. Does that make me NOT a developer?
No, no. Of course not.
I mean, if you become addicted to any substance, does that make you not an addict?
I'll let you answer that for myself.
|
|
|
|
|
ouch
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev wrote: ouch
Please don't let it spread around, but I really like JavaScript too.
I like it because it is proliferate --- browsers are everywhere -- you can write code anywhere!
I just wish it had some more and better tools for debugging and compiler warnings so development with it could be more structured and systematic. But sometimes I just really like it because it is so wild and zany too. It's so dynamic you can do crazy cool things with it.
Also, the Canvas (drawing / gaming) stuff that you can do is amazing and quite easy to learn.
Check out my robotDots article (HTML5 Canvas : Clean JavaScript & Code Organization Allows Faster Dev, Easier Extensibility[^]) or my console in a web page article (Command Console in your browser via HTML5 Canvas & JavaScript[^]) here at CP.
Of course you are a real dev.
|
|
|
|
|
I agree. Well said.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
raddevus wrote: ...in this case the JavaScript compiler...
That might be your problem, you're compiling and interpreted language!
Seriously, though, if you're concerned with size (as mentioned above) just minify the production version.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
|
Nathan Minier wrote: just minify the production version Minification is a 'brilliant' idea which is generally horrible in practice. Debugging minified code is a pain.
Here's a link that may help some people javascript - How to effectively debug minified JS files? - Stack Overflow[^]
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: generally horrible in practice
I can't agree. I think that, as you said, debugging it is painful, but that's why you only minify production.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
I've done a few node.js projects...develop in TypeScript, transcode to js, and minify the transcoded js. It's a couple lines in your build script, and the file size (if you keep all the files in your build chain for those few times when you question whether the TypeScript transcode was problematic) is negligible. When you deploy, the deployment script only lifts the minified js.
|
|
|
|
|
Did you mean to reply to the other guy, or were you just really happy about the node-typescript toolchain...?
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
raddevus wrote: But, but, but... JavaScript compiler why couldn't you have mentioned it?
Isn't "Javascript compiler" a contradiction in terms? A non-sequitur? An oxymoron? A Trump "truth?" A Fox New fiction? Something that doesn't actually exist in this space-time continuum?
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
|
There are some checking tools for javascript out there, like lint. Good luck
PS: I got headaches because of some "platform specific issues" of my tool chain and imcomplete binaries.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
you keep saying "compiler" but in JavaScript there's no such thing. JavaScript runs under an interpreter, that's why you're able to have such things as eval("javascript code here") . The closest thing you may get to a compiler is to using something like jslint.
Edit:
I've seen your compiler links. Interesting. So yeah, you've a point.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
modified 12-Jan-19 12:38pm.
|
|
|
|