Open stefanmaric opened 10 years ago
For JavaScript: I think I prefer http://requirejs.org/ and something like Mozilla's dryice.
Or what about Riot? I think we can get something good done with Riot + jquery + grunt/dryice (to compress and unify the scripts)
I usually follow the npm-style standard for writing JS
@sadasant I can't see any coding style in requirejs, dryice, nor Riot (Riot looks interesting due its minimalism).
I meant coding styles like the one @adrianObel mentioned: npm-style. Am I missing something?
@stefanmaric yes, you're right, I was thinking on what framework should we use.
@stefanmaric you both can pick the coding styles, a couple of things I prefer:
For JS:
If it was up to me I'd just do it in coffee ;)
How does npm-style sound? var for first variable only, comma first, and ditch the semi-colons
I just ditched coffee and I'm loving my complete syntax and not ugly-looking npm-style javascript xD
I think nodeguide.com/style.html is pretty good. And https://github.com/meteor/meteor/wiki/Meteor-Style-Guide
Just for extra-clarity: I like code like this, don't know what you guys think https://github.com/ghostbar/twitter-rest-lite/blob/master/lib/api.js
I like that, but let's define every variable with it's own var, what do you think?
I closed it by error.
Hmmm... Why that? If we use:
var hey = "this is me",
hoy = "I'm another one";
Should be enough to get it organized or even:
var hey = "duh",
what = "it's up!";
It enforces consistency when moving lines and avoids spaces/tabs to change the style.
var hey = "duh";
var what = "is up!";
Here's an example:
(function() {
var my_variable = "variable";
var my_other_variable = false;
// Let's move one of those variables inside the function below.
return function() {
var variables = "inside";
var the_crazy = "return function";
// We can just put any of those variables here, or everywhere,
// it doesn't matter, there's no need of correcting the last character,
// or removing anything, just paste and it's done.
}
})();
I think we have a winner here :D
Let's get a coding standard, for HTML, CSS, JS, and whatever else we will be working with. Discussion here. ( @sadasant , @adrianObel , @ghostbar )
After that: