Tagged Questions
1
vote
1answer
125 views
Object Chain through an Interface
Say I have 3+ types of objects:
function Sea() {
var logs = [Logs];
this.getLog = function(ind){return logs[ind]}
}
function Log() {
var bumps = [Bumps];
this.getBump = ...
2
votes
4answers
130 views
Should our team order Javascript class methods/properties consistently? If so, how?
As our team is growing I've noticed that different developers put their class methods in different orders. For instance:
var Foo = Backbone.Model.extend({
someVar: {},
initialize: ...
2
votes
1answer
88 views
equivalence in callback and non-callback javascript
I'm pretty sure that the following two snippets are equivalent but I wanted to double check:
CALLBACK STYLE
function foo(input, callback) {
// do stuff with input
callback();
}
function ...
14
votes
2answers
543 views
Creating nested functions for purely aesthetic reasons?
I've always wondered what other programmers think about the idea of creating pure aesthetic functions.
Say I have a function that processes a chunk of data: Function ProcessBigData. Say I need ...
0
votes
3answers
174 views
Javascript Naming Convention [closed]
I've been using Javascript for quite a while, but I've always ignored the common naming conventions that I see online (camelCase). I know it all depends on the developer's preference, but why camel ...
1
vote
4answers
1k views
Switching from ActionScript to JavaScript, tips for writing code?
I am quite comfortable with using actionscript3 and flash. I also have some experience with Java. But recently, I started learning JavaScript and node.js. I ultimately want to make a 3d game in ...
33
votes
16answers
4k views
Should I continue my self-taught coding practice or learn how to do coding professionally? [closed]
Lately I've been getting professional work, hanging out with other programmers, and making friends in the industry. The only thing is I'm 100% self-taught. It's caused my style to extremely deviate ...
10
votes
4answers
2k views
How do you keep code with continuations/callbacks readable?
Summary: Are there some well-established best-practice patterns that I can follow to keep my code readable in spite of using asynchronous code and callbacks?
I'm using a JavaScript library that ...
0
votes
2answers
187 views
Where can I find language specific programming standards and style guides?
Is there a good source of best practices, programming standards and coding styles for different languages, specifically Ruby and Javascript?
20
votes
6answers
2k views
Why the recent shift to removing/omitting semicolons from Javascript?
It seems to be fashionable recently to omit semicolons from Javascript. There was a blog post a few years ago emphasising that in Javascript, semicolons are optional and the gist of the post seemed to ...
8
votes
3answers
640 views
Should I nest functions in languages that allow me to do that or should I rather avoid it?
In JavaScript, PL/SQL and some other languages, functions can be nested, i.e. declared within another function. This could be used to break a large function into smaller pieces, but keep those pieces ...
6
votes
6answers
537 views
Returning an object or false in dynamic languages
Consider the following JavaScript function:
function Foo() {
function getPreferences() {
if ([there is an existing preferences object]) {
return preferences;
}
return false;
}
}
...
1
vote
5answers
2k views
Mixing jQuery with JavaScript
I just asked this question at SO about some bugginess I am experiencing with jQuery and IE8, and someone commented that he was appalled that I would mix JavaScript with jQuery (he has since deleted ...
17
votes
8answers
8k views
Why Should I Avoid Inline Scripting?
A knowledgeable friend recently looked at a website I helped launch, and commented something like "very cool site, shame about the inline scripting in the source code".
I'm definitely in a position ...