Re:Skit – I built another JavaScript framework
by taylorhughes on Wednesday April 08, 2015 @01:59PM
(#9342594)
Yeah, all this stuff in skit is my personal preference .. as you can tell from the post, I am not big on brevity. Agree that this stuff could be more elegant, though.
Re:Skit – I built another JavaScript framework
by 1day1day on Wednesday April 08, 2015 @11:57PM
(#9345722)
I prefer the more verbose, approach. Less magic = less errors. Don't let people show you some snippet that is "less characters = must be better"mentality
Re:Skit – I built another JavaScript framework
by johnmaguire2013 on Thursday April 09, 2015 @12:37AM
(#9345806)
I don't think that's the argument. In English, the words "yes" and "no" are very short. Why? Because they're used often. They're not particularly hard to screw up. They're quick to say and quick to write. Similarly, it's good if a framework can use, sure, brevity, in its more common function calls.
Similarly, in jQuery, the most common function call is one character that's obvious if you mess up. You don't have to go to such extremes as `$`, but you should think about that sort of thing when you're designing APIs, imo.
First criticism, this:
events.listen(dom.get('.thing'), 'click', function() {
That is a longer way of saying
$('.thing').on('click', function(){
Which could really just be:
on.click('.thing', function(){
As in, make the most common things more concise. Your current way isn't bad at all; it's just longer than it needs to be. Could be reorganized, I think.