My next project will probably be a JavaScript game, but I started with Java because it's my favorite language. Although I often use JavaScript too.
I don't want to start "what is your favorite language" mindkilling debate, but for me programming in Java is more pleasant than in JavaScript. Partially because of the language, partially because of the tools. It is nice to write an anonymous function in JavaScript quickly, but I prefer a language with mandatory variable declaration and static typing, because it finds many errors in compile time, which saves me a lot of work and frustration (this is not so important when I write the new code, but becomes significant when refactoring). Also my favorite tools, Eclipse and JUnit are free. Writing and maintaining longer programs in JavaScript is rather inconvenient... but maybe it's because I'm doing it wrong.
So if there are JavaScript fans on LW, I would like to ask -- what are the best practices when developing a browser application (e.g. a game) in JavaScript? Google typically returns low-level answers, such as "always declare variables", "always use a semicolon" and "give your variables meaningful names". Let's suppose I'm already a relatively good programmer, but my experience is mostly outside of JavaScript. Are there any best practices or good free tools that an experienced JavaScript programmer could recommend me? I currently use Eclipse as a syntax highlighter, a JQuery library, and Firebug plugin. Please recommend me what you use and consider useful.
For tools: I prefer Google Chrome's inspector to Firebug, but it's pretty much a wash. I use Emacs with js3-mode, which does a lot of great syntax highlighting / error catching kind of stuff - if you're not using a really smart editor like that, then something like JSHint or JSLint would probably be a good idea.
Regarding best practices, I recommend npm style.
Also, being extremely fast-and-loose with your code's (and data's) structure. One of the advantages of a very dynamic language like JS is that you can very quickly change aspects of your design, with...
This is the bimonthly 'What are you working On?' thread. Previous threads are here. So here's the question:
What are you working on?
Here are some guidelines: