Joined July 2012

Dan Tao

San Francisco

Posted to Bootstrap without all the debt over 1 year ago

@milesj: I definitely know what you mean. I have also seen myself that @extend is not a perfect solution because it can sometimes be tricky to figure out what to extend (you have to dig through Bootstrap's source to figure out where certain styles are actually defined).

That said, I would point to my closing remarks about "graduating" from Bootstrap. True to its name, the framework can be useful for standing up a pretty-looking site very quickly, without putting much thought into design. I'm simply suggesting a way to use it for this purpose without incurring all the tech debt associated with having it scattered throughout your markup. That doesn't mean it's a good long-term investment or something you should be spending a lot of time on to get things looking perfect (i.e. inspecting CSS rules in dev tools)--just the opposite, in fact.

To be honest, for a new project where good design is a priority I would likely advise against Bootstrap as well. But more importantly, I would encourage any team on such a project to try not to couple their markup too tightly to any particular framework. And that's really what I hoped to get across in this post.

@hauleth Oh right, %i (I'm on my phone; probably should have checked before posting). And I didn't know about double splat either! I'll have to play around with that.

You've now taught me two new things in the comments! My hat's off to you.

@jonahoffline Ah yes, good ol' %w. That is a nice feature. Did you know there is also %r for regexes and in Ruby 2 there's %s (I believe) for an array of symbols?

@hauleth Sweet! That is indeed a nice trick that I didn't know about. +1 from me.

@petkaantonov Haha, in that case, sorry for getting defensive. The thing is I feel that the method invocation case is much more complicated, and seemingly more controversial; so I've tried to steer clear of putting too much interpretation into that side of the equation. But you bring up an interesting point. It's probably worth further investigation. But yeah, in this case I was just focusing on object creation since I actually think the "you aren't creating that many objects" argument is very circumstantial at best and generally inaccurate at worst.

@planet I'm inclined to agree with @sorella here: since one of the hugest benefits to using the prototype system is in making object creation efficient, applying it to defining singletons seems like an overly complicated approach with no real payoff.

That said, if you just like the way prototypes work aesthetically, and you prefer to use this style, I can't say you're "wrong"; it just seems unnecessary to me.

@petkaantonov I don't mean to be a Scrooge; but it seems to me you're arguing with a straw man. I stated both in this post and in the Reddit thread that the real difference between the two approaches is in object creation; i.e., the real "meat" of the performance discrepancy here is in the lines createValueObject() vs. new ValueObject(). The new jsPerf you posted compares only method invocation, which—despite there still being a perceived performance difference (though as you point out this is a flawed conclusion)—is much less significant here.

@planet That's neat and all, but... why exactly do you encourage that?

@tencircles I think that will give you a stack overflow. (You'd need to go with something like this._value instead.)

Edit: Ah, I see what happened. You did go with this._value, and then Coderwall interpreted your comment using Markdown and italicized half your code instead. Ha!

3,657 Karma
164,216 Total ProTip Views