Open Leonidas-from-XIV opened 12 years ago
sorry for not fixing this quickly. I am a bit stuck on it for two reasons:
simple_date
is the timeFn for simple date, whereas simpleDate
is sort of a class that provides date functionality. But how would one call that? 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?
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.
simple_date
something like timeFn
, or now
. simpleDate
would be something like DateController
or something. These names are not perfect but I think a bit better than they are at the moment. I guess I'll move them some time into the library, so it would be good if I knew what they are good for :)new Chronograph()
or Chronograph()
then? If it is meant as a kind of constuctor returning an "instance" it should have a name starting with upper case.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.
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).
simple_date
andsimpleDate
(names in JS are supposed to beinitiallyLowerCaseCamelCase
),chronograph
(funtion names should be verbs or at least describing what the function is).