Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
insin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
46 ms
·
601.
▲
by
insin
14y ago
It's the tenth most used tag on Stack Overflow: http://stackoverflow.com/tags
602.
▲
by
insin
14y ago
You might also be interested in: https://github.com/deoxxa/node-ginger https://github.com/chrisdickinson/plate https://github.com/paularmstrong/swig Sounds like my reasons for liking Jade are the same as yours for not liking it: simpl
603.
▲
by
insin
14y ago
Person will also have anything you add to Spy's prototype if you do that. Attaching the "parent" prototype you want to have in the "child" prototype chain to a dummy constructor and new-ing that will do the trick for widest compatibility, a
604.
▲
Menshn, a new social network: "talk, on topic"
(menshn.com)
1 points
by
insin
14y ago
|
0 comments
605.
▲
by
insin
14y ago
Also worth looking at prefetch_related(), which landed in 1.4, which can be used to alleviate common O(n) situations: https://docs.djangoproject.com/en/dev/ref/models/querysets/#... I've also used this in the past to do something similar,
606.
▲
by
insin
15y ago
Here's another one I did: https://github.com/insin/DOMBuilder/ It also allows you to generate HTML strings from the same code and create templates, with template inheritance, using the same sort of syntax.
607.
▲
by
insin
15y ago
There are other options here too but, given the OP, people seem to get irate when you use the features the language specification guarantees :'/ alert(1) void function(){alert(2)}()
608.
▲
by
insin
15y ago
I can see how it would give that impression due to taking a high-visibility feature in significant whitespace from Python, but other than list comprehensions, much of the rest is taken from Ruby: Implicit returns, new conditional keywords (
609.
▲
Derby v0.3.0
(blog.derbyjs.com)
2 points
by
insin
15y ago
|
0 comments
610.
▲
by
insin
15y ago
s/professionals/Ruby fans/
611.
▲
by
insin
15y ago
You could use Closure Compiler for that instead: https://developers.google.com/closure/compiler/docs/js-for-c...
612.
▲
by
insin
15y ago
Yes, it's perfect for building templates in code based on an object defining your templating API - code which is run once at startup with little or no assignment and no ambiguity between the contents of the context object and anything else,
613.
▲
by
insin
15y ago
I have a library for this sort of thing (but without the HAML-style # and . niceties :-/) which can also output DOM Elements or HTML (escaped by default) from the same code by flipping its output mode: https://github.com/insin/DOMBuilder
614.
▲
JavaScript Jabber 5: Javascript Objects
(javascriptjabber.com)
2 points
by
insin
15y ago
|
0 comments
615.
▲
by
insin
15y ago
Sure there are - why are so many Crockford pronouncements taken as a signal to stop thinking? Notice that his "with is bad" examples (which are usually bad examples and bad usages [1]) always involve contrived examples of potentially ambigu
616.
▲
by
insin
15y ago
You could use anything which separates statements or ensures the function is treated as an expression. Two examples which are more in keeping with the intended use of the operators in question: ;function() { // Some initialization.
617.
▲
by
insin
15y ago
The results aren't unpredictable - they're specified exactly, which makes it safe to omit semicolons except where necessary. You might not know that the return statement is a restricted production, but you do know when you shouldn't immedia
618.
▲
by
insin
15y ago
Along with not inserting a linebreak immediately after a return (which you must learn whether you use semicolons or not), watching out for lines starting with braces accounts for the vast majority of potential ASI errors you're likely to en
619.
▲
Jslint Is Not A Code Quality Tool For 3rd Party Code
(hughfdjackson.com)
29 points
by
insin
15y ago
|
8 comments
620.
▲
by
insin
15y ago
Unfortunately, it is an issue if you're not a regular CoffeeScript user yourself. If you're making significant use of any framework, at some point you're going to have to dive into the internals and figure out how it works or why is isn't
621.
▲
by
insin
15y ago
Leaving aside the global variable, I think this example's biggest issue is the complete lack of whitespace and the big stack of chained calls (which I'm not personally a fan of, but your house, your rules :)) - this is it with a few reader-
622.
▲
by
insin
15y ago
I see crossroads also lets you use the same code on both ends. Added it to a document I recently started for components, frameworks and articles of interest to people trying to share the same codebase on the client and server: http://insin
623.
▲
by
insin
15y ago
I always wonder what percentage of that consists of included dependencies.
624.
▲
Introducing Flatiron
(blog.nodejitsu.com)
2 points
by
insin
15y ago
|
0 comments
625.
▲
by
insin
15y ago
This is more like what you would write by hand for the above code if the core constructors had a Backbone-style .extend function [1], which it likely would have if normal JavaScript usage was considered for the initial release (which I reco
626.
▲
by
insin
15y ago
POWDER is worth looking at as a starter - it feels like a scaled-down, more accessible NetHack with much of the the identification fun and unexpected combinations of interactions, and it's just as playable with a control pad, due to its GBA
627.
▲
by
insin
15y ago
I started coming to a similar conclusion about pure-JavaScript templating in terms of ease of writing and maintenance after getting most of the way into implementing a templating plugin for my DOMBuilder library, based on this speculative A
628.
▲
by
insin
15y ago
You don't want to have to actually instantiate an object using the parent constructor in order to get an object with the parent's prototype chain attached for inheritance purposes, as you'd either have to code all constructors which will be
629.
▲
by
insin
16y ago
On that note, I like the parting words in Google's JavaScript Style Guide ( http://google-styleguide.googlecode.com/svn/trunk/javascript... ): BE CONSISTENT. If you're editing code, take a few minutes to look at the code around you and