This sounds more like how the developer uses the language and what there goal was, which I don’t see how it’s js fault if gmail doesn’t look or act the way you want it to.
personally I love Gmail.
Well the spam filtering works of course without using the web interface, and yes its quite good. I like gmail, just not the web shit.
I also had to figure out which “design” is actually the one you would expect from a email app, otherwise gmail be default, groups messages somehow, and I just find it extremely hideous.
If I get 6 messages from Riven saying “you’re a poopy-head”, then I want to see 6 list entries and not have them grouped as a “conversation”. Maybe you like that, I like things to behave traditionally…
And yeah drag and drop never works in web apps… well maybe sometimes it works, but its rare. Also right mouse button support is rare. The few times I use the dropbox web app I’m always surprised that it works.
Pretty much, yeah. I don’t see how javascript can evolve into a general-purpose language that isn’t awful. Too many design decisions which target scripting, which are good calls in that space are horrid in a general language space. (NOTE: I have not been paying attention to javascript evolution)
You don’t have to, there isn’t so much evolution to speak of in the scripting language itself, only in the piles and piles of script code browsers now have to execute just to do stuff you’d do with a couple of lines in any “normal” programming language. In fact its the browsers that have evolved to cope with Javascript I’d say. And continue to evolve as regularly whole new javascript engines have to be built just to meet demands. The ones existing today must use quantum mechanics or something.
JavaScript is okay. If you use a text editor with JSLint integration, that is.
However, the function scoping and the behavior of “this” is just bat-shit insane. There are also no proper namespaces, modules, or something like that. You can import stuff in CSS. You can’t do that in JS. There are hundreds of ways to roll your own classes an inheritance. As a result, your tools won’t have a clue that those weird looking constructs are supposed to be classes.
Well, it certainly has massive scaling issues. Your tools can’t help you. It’s all smurfs and foobars. For example:
var x = Math.round(5).length;
We can be fairly certain that this “Math” thing is the one provided by many environments. We can also guess that “round” is the usual rounding function which returns a Number. But… does a Number instance have a “length” property? Well, no idea. Someone could have added it to that… thing. I can’t know. To be honest, we also don’t know if “Math” and “round” are those things we think they are.
Dart, my current favorite language, doesn’t have any of those issues. Just like in Java, there are proper namespaces and stuff. You know what all of those things are. If you use a function from the Math package, it’s that function from the Math package. Real lexical scoping, a sane “this”, built-in classes/inheritance, etc. Unlike JS, it was created with tooling and performance in mind. And, well, it works. The editor is already way smarter than any JS IDE ever could be, startup is already 10 times faster, and the Dart VM is also already about 25% faster than V8 (Chrome’s JS engine). Their goal is to make it at least twice as fast as V8. They will easily reach that goal, no doubt.
Because Java doesn’t “integrate with PHP” the same way Javascript and PHP do. :persecutioncomplex: There’s another very practical reason why Java or a language like it can’t be used for web page scripting. It’s too verbose. Did you know Java code is 1% longer for the equivalent Javascript program for trivial, non-real-world programs that can actually be implemented efficiently with Javascript? Network bandwidth is very important for HTTP servers. Just ask the “standard” makers. Google had to get the header “X-Do-Not-Track” shortened to “DNT” so they could still afford their 2000 character tracking cookie. Visit any website and you’ll be shocked at how streamlined professionals make their web pages in order to make them load fast and preserve the user’s bandwidth. No one’s loading masses of libraries they don’t really need. Oh, and Javascript is faster, doesn’t use garbage collection, doesn’t freeze your web browser, and doesn’t…
(Ninja’d. I’m still making a joke at the expense of PHP and Javascript programmers. Sorry Cero.)
Well I mean, of course javascript and PHP are shorter, less verbose than Java, because in those languages you can just allocate random shit to other random shit and it works (or not and it doesnt tell you :D), that freedom comes of course with a horrible cost… Like many people said, not a big deal not smaller scripts but definitely for larger codebases
I myself have not worked on a larger js or php codebase… I would actually be interested what kinda tricks you guys use to find errors.
Haha, I can’t believe you don’t know how errors are easily found in web deployments Oh all right I’ll tell you. You upload it to the webserver, and then floods of angry emails come in from the 100,000 users you shafted without warning when it doesn’t work, and then you panic fix it. Rinse, repeat.
My previous comment was 50% sarcasm by weight and 90% sarcasm by volume. Javascript and PHP are not shorter at all unless you’re playing with the results of someone else’s program. You might save a few keystrokes on variable assignments, but you’re going to use way more characters and coding time for original work or for anything serious. PHP and Javascript grow exponentially more time consuming for any serious project.
PS: My favorite method for finding bugs in JS and PHP projects is to open the source code in a text editor, open the “Go to line” dialog, and enter a random number on the number keypad.
Java, not Javascript, is my favorite language, has been since it’s inception, will be till the day I die, probably.
On a side note, Python is heading toward more standard syntax, print will now need parenthesis and such. It’s great for serverside stuff, but for a full program it lacks luster to it, and it’s fugly. Just sayin!
I would actually be interested what kinda tricks you guys use to find errors [in JS].
I use JSLint (as a plugin). It’s a static code analysis tool. It restricts you to a somewhat less insane subset of JavaScript (see: JavaScript: The Good Parts) and it will tell you if you did something obviously stupid. Unlike other static code analysis tools, it’s 100% accurate. Well, it kinda cheats. It only includes accurate tests and most of its test are actually about conventions. The theory is that adhering to conventions, which improve the quality of the code by dodging or sidestepping common issues, can improve the quality equally well as targeting bugs directly.
From my own experience I’d say that, yes, this strategy really does work. I actually use the same strategy for CSS architecture. I use simple rules which can be verified by machines. Sticking to those rules automatically yields good results, because doing things in stupid ways would be a lot more work. Fortunately, people are lazy. I exploit this law of nature.
Self-correcting processes are the way to go. I also believe that we should use machines as much as we can. That’s why we invented them, to do the same stupid brainless crap a million times a day.
Another thing you can try is TDD (via Jasmine or Mocha). I only used it for libraries so far, but I think it can be really worthwhile… well, with libraries at least. TDD is just plain perfect for this.
larger js […] codebase
Well, just look at Google. They made the Closure Compiler (which uses type annotations), they made GWT, and they also made Dart. They apparently think that writing bigger programs in JavaScript isn’t feasible. They should know. They wrote some of the larges and most popular JavaScript applications (maps, gmail, spreadsheets, …).
Even though my own experience is somewhat limited, I have to agree. With JS, everything is just hot-glued together. Literally. You have to concat your scripts and then run them through a minifier (congratulations, you now need a build script). You also need a way to avoid this during development, because you need to be able to debug things. Your IDE can’t help you much either, because it just can’t know what those things or constructs are. Structure which was added by conventions isn’t accessible to tools.
It’s okay up to 5 kloc or so. It’s less annoying if you’re working alone on the code. If it weren’t for the retarded scoping, I’d say that it’s pretty much perfect for small games.
I missed this. You’re taking my comment out of context. There’s zero reason for big game studios to change from C++. The tech reasons have been covered ad naseum in many threads so there’s no reason to repeat them. So instead I’ll do two hypothesis:
The big players in the multi-billion dollar game industry have only succeeded in hiring idiots that don’t know anything about modern compiler & language design.
Maybe they do have a clue.
P.S. Never tell people you’re a “guru” at anything…you’re just shooting yourself in the foot. The first thing I think of is “Hey, I have this 19.99USD mail-in certification!”