Leonidas-from-XIV / floatinghands

A watch, as a CoffeeScript jQuery plugin. Or somethin'
3 stars 0 forks source link

Poor naming in watch.html #15

Open Leonidas-from-XIV opened 12 years ago

Leonidas-from-XIV commented 12 years ago

simple_date and simpleDate (names in JS are supposed to be initiallyLowerCaseCamelCase), chronograph (funtion names should be verbs or at least describing what the function is).

watchdesigner commented 12 years ago

sorry for not fixing this quickly. I am a bit stuck on it for two reasons:

watchdesigner commented 12 years ago

oh, regarding the function currently called chronograph: that one creates a new instance of an object, so I think it basically does what new does, so I thought we might want to call it newChronograph(). Would you agree to that?

watchdesigner commented 12 years ago

sorry for commenting several times.

when providing any functions etc. that are supposed to be used in the watch model definition section, my top1 prospective was to make the model definition look short, understandable, and declarative. Therefore I would tend to sacrifice common style rules. I think this could be seen a bit as Language-Oriented Programming.

Leonidas-from-XIV commented 12 years ago

What you mean is Domain Specific Languages, not Language-Oriented Programming see RSpec or specs. We can build that, but naming thigs strangely is not DSL, its just inconvenient. Trust me on this one.

If you want to create an internal DSL, I would recommend using CoffeeScript, where you can omit braces and chain stuff together so it looks more like an english sentence than a function call. But we need to plan for this and we need to have a "stable" library interface. ATM, it changes way too often, to be worth constructing a DSL.

Leonidas-from-XIV commented 12 years ago

Plus, something like chronograph is not possible anyway. $().floatinghands().something is the best we can do.

If we were going for a DSL, we can just bind $().floatinghands() to a local name, like floatinghands, which will make it less line-noisey (I was pressed to say Perlish, but decided against it).