3 ms·
I actually like JavaScript, and weak typing is one of the reasons.
by ld00d 12y ago
I actually like JavaScript, and weak typing is one of the reasons.
- tosh 12y agoCan you give an example re why you like JavaScript's weak typing (http://en.wikipedia.org/wiki/Strong_and_weak_typing#Definitions_of_.22strong.22_or_.22weak.22 http://en.wikipedia.org/wiki/Strong_and_weak_typing#Definiti...)? Or do you mean dynamic typing?
- ld00d 12y agoNot having type casts everywhere.
- tracker1 12y agoWell, if you are processing CSV or XML data-stream for import operations into a foreign system, JS is a very natural language for this type of work. Being able to translate anything into a 32-bit integer value with ~~ for example, or understanding falsy-truthy operations can make text composition easier as well. The only real gotcha in validation is when you want something that is a numeric-string or a number to be a number, and anything else to be a null. Outside of that case, I find that dealing with data migrations/translations in JS is FAR better in practice than most of the options I've used. Especially when you compare to the likes of say C, C#, Java etc... Yes, you can use strong XML validation, but it tends to produce a lot of errors that are recoverable in JS.