Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Tuesday, December 27, 2011

Javascript Virtual Joystick

http://learningthreejs.com/blog/2011/12/26/let-s-make-a-3d-game-virtual-joystick/

This isn't going to be a lengthy article.  Just wanted everyone to know about: https://github.com/jeromeetienne/virtualjoystick.js



It's exactly what it sounds like, a virtual joystick for mobile devices.  Wonderful.

Thursday, December 1, 2011

Coffeescript IDE


So we have to choose what IDE we are going to write our coffeescript in.

So we are looking for some basic things (in no particular order):

syntax hilighting/coloring
compiling to javascript
live debug
ability to handle .coffee files/support coffeescript
refactoring
indentation support/text formatting
simple expansion
very low entry level
free and open source
Javascript support

Let's take a look at the coffee script wiki:

  • Brewer: rbrcurtis's Brewer project browser based editor uses the ace editor (which cloud9 also uses) to show the compiled JS alongside your coffeescript, much like the coffeescript homepage, and runs a simple nodejs webserver on your machine to provide file manipulation functionality.
  • Cloud9IDE: tanepiper's Cloud9IDE CoffeeScript Live extension - provides a live debug environment for .coffee files in Cloud9. Of course, written in CoffeeScript too!
  • Coda/SubEthaEdit:
  • Emacs: defunkt's CoffeeScript Major Mode — provides syntax highlighting, indentation support, and some bonus commands.
  • gedit: wavded's gedit-coffeescript — provides syntax highlighting.
  • IntelliJ IDEA/RubyMine/PyCharm/PHPStorm/WebStorm:
    • yeungda's coffeescript-idea — provides syntax highlighting. development halted: see next item.
    • netzpirat's CoffeeBrew — an extensive refactoring and improvement upon coffeescript-idea. development halted: see next item.
    • Official Support is planned for RubyMine 4, using CoffeeBrew as a base. Whether or not this support will be more widely available is currently up in the air. Please add your comments to the bug tracker if you would like to see CoffeeScript support in other jetbrains products than just RubyMine, with all of the features one would expect from a jetbrains product (completion, inspections/intentions, auto-fix, go-to-definition, etc).
  • jEdit: dhotson's and balazstth's coffeescript-jedit — which provides syntax highlighting and indentation support in jEdit.
  • Kate: max99x's kate-coffeescript — provides syntax highlighting.
  • NetBeans: dstepanov's coffeescript-netbeans - compiles coffeescript files without Node.js, advanced syntax highlighting, error checking by background compilation and autocompilation
  • Notepad++: blakmatrix's CoffeeScript_notepad_UDL - provides syntax highlighting.
  • Sublime Text 2: jashkenas's CoffeeScript TextMate bundle above provides syntax highlighting and snippet expansion.
  • Textadept: rgieseke's CoffeeScript Textadept module — provides snippets, additional key commands and indentation support.
  • TextMate: jashkenas's CoffeeScript TextMate bundle — provides syntax highlighting, snippet expansion, and the ability to run bits of CoffeeScript from within TextMate itself.
  • Vim: kchmck's Vim CoffeeScript — adds Vim syntax highlighting and indentation support.
  • Vim snippets collections carlosvillu's CoffeeScript Vim Snippets - add snippets to be used with the snippets vim plugin.
  • Vim: claco's plugin for jasmine testing in vim with support for CoffeeScript Jasmine/CoffeeSCript Vim Plugin
  • Vim: clvv's fork of a.vim - support for switching between .coffee and compiled .js files.
  • Visual Studio:
    • CoffeeLite
    • Mindscape Web Workbench - works with CoffeeScript, Sass, and LESS. Free version provides syntax highlighting and compiles CoffeeScript files automatically on save. Pro version adds automatic minification of JavaScript files.
  • BBEdit: pmuellr's CoffeeScript BBEdit Language Module / plist - not perfect, but seems to handle most things in an acceptable fashion.
  • Eclipse: provided by Titanium (Aptana) Studio. For now just syntax coloring and a basic class/method outline.
This was ripped directly from the page itself, so I'm not claiming any rights here at all.


 NetBeans.

Let's run down the scorecard:


syntax hilighting/coloring [check]
compiling to javascript [check] and it autocompiles in the background
live debug [check]
ability to handle .coffee files/support coffeescript [via https://github.com/dstepanov/coffeescript-netbeans]
refactoring [check]
indentation support/text formatting [check]
simple expansion [check]
very low entry level [not so much]
free and open source [check]
Javascript support [check]
support for node.js [check: on linux/mac]



It just seems like a more fleshed out IDE, although if you are use to something like c# in vs2010 it will feel lacking.  Everything on the wiki list is worth a look though, because people spent quite a bit of time developing the coffee script plugins.

Cloud9 IDE

The currently most popular IDE and probably the tie for first place is Cloud9 IDE.  It fulfills every requirement in spades, and it's the future of IDEs, without a doubt.  My only concern is it's newness.  So that's an issue that will resolve itself.  Possibly the other concern would be no offline support.  But I'd have a hard time remembering when I wasn't connected to the internet in some fashion.  The big buzz is centered around it.  And support for new technologies is abundant.


A link to the Coffee Script Cloud9 live plugin



Problems with very complicated IDEs I have found in the past are not with the IDE, but with myself.  The more complex something is the more of a distraction it is.  The "I need to know" syndrome.  And after years of screwing around with different IDEs or just complex software: I *don't* need to know.  I just have to realize that it is a tool and I just need the basic skills to operate the tool.  At one point I had forced myself to not use complex software for much of anything, because I had thought that it was the software's fault that I got nothing done because I had spent all of my time writing plugins or learning all of the key commands, etc.   So I had switched to a bare bones text editor.  Wow, great, focus.... so where's that one useful tool that I used 1,000 times a day... it's not there, period.  So you make due, and in the end you get more done but at the cost of 1.5x the amount of work.  That's not smart.  The solution: A complicated IDE being used as a simple IDE.  Hide everything unless you use it, but don't forget it's there.  If you need a plugin then someone else probably has written it, or you're making a mountain out of a mole hill.  I could go on and on.



If you feel differently about any of this let me know in the comments.

Wednesday, November 30, 2011

Language

Language:

There's quite a few to choose from, but if we are talking almost strictly web based, the first thing that comes to mind for most people is javascript.  The big trend I have been seeing a lot of lately is coffee script.

From their website:

CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
The golden rule of CoffeeScript is: "It's just JavaScript". The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript.


Honestly do yourself a favor and take a look at their website.  Coffee script will change how javascript is written in general, I have very little doubt about that.

So I'd like to state here that any code I post on this blog will either be in javascript or coffee script, this isn't set in stone, but close.

Threenode.js

Just found out about ThreeNodes.js


It's a visual Webgl interface written in javascript.
Just link together elements and you're off and running.
Live demo: http://idflood.github.com/ThreeNodes.js/

While I love the idea, any kind of visual programming where someone with little to no programming experience can pick it up, this one looks better than most.  I have played with Waterbear and things like it, ThreeNodes.js is just more fun.  I do wish there was a Canvas version of ThreeNodes.... idea.

I don't really want to get into why someone would use canvas over webgl or the other way around.  That's something for another post.