b3ta.com links
You are not logged in. Login or Signup
Home » links » Link 846739 | Random (Thread)

This is a normal post And that's why JS is shit
For those exact reasons, lack of encapsulation means it's a maintenance clusterfuck. Write once, run away and try and forget it Many.

Such a shame browsers don't have a propah langwidge
(, Tue 21 Aug 2012, 18:14, Reply)
This is a normal post Ahem
Closures
(, Tue 21 Aug 2012, 19:00, Reply)
This is a normal post But closures are just syntactic sugar, really.

(, Tue 21 Aug 2012, 20:11, Reply)
This is a normal post Syntactic sugar that good developers use to avoid a maintenance clusterfuck
and because it's nice to do things well
(, Tue 21 Aug 2012, 20:16, Reply)
This is a normal post Nah. They just help you write less code.
It doesn't make any real difference to your maintenance. Once you need to do anything complex in the closure, you're better of splitting it out into a proper function anyway.

JavaScript can be used well, of course it can; but it's a lot like C or C++: it takes a lot of discipline to use well. And the end result will still perform like a dog's breakfast.
(, Tue 21 Aug 2012, 20:28, Reply)
This is a normal post They are far from syntactic sugar.
They let you nest all kinds of code, callback and events, yet still get back out to a class based scope for sanity/maintainability.
(, Tue 21 Aug 2012, 21:35, Reply)
This is a normal post What makes you think this can't be done any other way?
(And sensibly, not doing crazily complicated stuff.)
(, Tue 21 Aug 2012, 21:38, Reply)
This is a normal post Also, there are always several ways of doing something in any language
The trick to maintainability is picking the right way. Hindsight's always a bit of a bugger here...
(, Tue 21 Aug 2012, 22:23, Reply)
This is a normal post In many languages, there are often several sensible ways of doing something.
Not necessarily any single *right* way.
(, Wed 22 Aug 2012, 1:42, Reply)
This is a normal post Closures are a memory/performance nightmare

(, Wed 22 Aug 2012, 21:34, Reply)
This is a normal post well, no, 6 months ago, i was shit at js
But thought i was good. Now i'm ok and think i can be better. Closures, bind, call, collections, signals, they all wrap each other beautifully now, where before i was trying all kinds of things with classes, prototypes and basically creating an unmaintainable mess.
(, Tue 21 Aug 2012, 21:33, Reply)