Thats not only the Pharo, the Squeak, way, the Python way, the Ruby way
..... its the logical way

GregorianDate >>  toJulian

You have a class then you have a method . You want to extend your method ?
why  increase the size of method ? You just create a new class for it.

I have 3 rules when I code

1) Keep it small

2) Keep it simple

3) Keep it obvious

Also I cant recommend this book highly enough, its not only the best book I
have read, its a goldmine of concentrated wisdom. No vague theories, no
assumptions, just a bombarbment of practical examples ->
http://www.amazon.com/Smalltalk-Best-Practice-Patterns-Kent/dp/013476904X

it wont show you just proper naming it will show you everything. Its the
kind of book that you will keep coming back to. This something that every
coder should have.

and yes Java is doing it wrong, its doing it very wrong.


On Wed, Nov 13, 2013 at 10:19 AM, Bahman Movaqar <bah...@bahmanm.com> wrote:

> On 11/13/2013 11:39, Bahman Movaqar wrote:
> > On 11/13/2013 11:13, Bahman Movaqar wrote:
> >> Let's say I have a method with signature in a language like Java as
> below:
> >>   gregorianDayToJulianDay(year, month, day)
> >>
> >> What could be a proper naming for this method in Smalltalk?  I'm a bit
> >> confused as I'm so used to the concept of methods being "verbs" which
> >> accept some arguments.
> >>
> >> I'd appreciate any help/idea.
>
> After reading Sven's reply, I came up with this design.  Is it the
> idiomatic way to handle this problem in Smalltalk:
>
> <pseudo-design>
> class JulianConverter:
>     instance variable: 'day'
>
>     #toGregorian
>     #toIranian
>
> class GregorianConverter:
>     instance variable: 'year month day'
>
>     #toJulian
>
> class IranianConverter:
>     instance variable: 'year month day'
>
>     #toJulian
>
> </pseudo-design>
>
> --
> Bahman Movaqar  (http://BahmanM.com)
>
> ERP Evaluation, Implementation & Deployment Consultant
> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
>
>
>

Reply via email to