3 ms·
I don't see why a person with a C# background would have any of these (2) "bad habbits". On the contrary, someone with some C# experience would do his best to a
by oozcitak 16y ago
I don't see why a person with a C# background would have any of these (2) "bad habbits". On the contrary, someone with some C# experience would do his best to avoid global variables, and one of the first things he would search for would probably be how to do namespacing with javascript. The new keyword may be an issue at the beginning but as soon as you do some JSON, you automatically get the correct way of declaring arrays and objects.
- brc 16y agoI came here to say the same thing : C# makes it intentionally very difficult to create a global variable, and the first example is just a case of sloppy coding, whatever the language. You cannot develop a habit of creating global (or undeclared) variables if you're coming from a C# background. Similarly, the global namespacing - a C# developer is going to look for ways to declare namespace.definition style, and is not going to spontaneously come up with namespace_definition, as this is an unseen pattern in C# examples and general practice. Perhaps it would be a good primer for a VB6 -> Javascript developer, but I don't imagine there are too many of those around.
- GFischer 16y ago"VB6 -> Javascript developer, but I don't imagine there are too many of those around." Why not? Some of us are (were) stuck maintaining bad VB6 apps and asp webpages with vbscript that we had to migrate to javascript as Firefox doesn't support vbscript. I no longer do this, but it paid above average for my country and I was starting out as a developer. And yes, my code probably did suck (heck, it probably still does).