[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [OT] Lua community and Go language
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Thu, 08 Aug 2013 15:20:16 +0200
On 08/08/2013 0.40, Rena wrote:
> On Tue, Aug 6, 2013 at 10:54 AM, Craig Barnes <email@example.com
> <mailto:firstname.lastname@example.org>> wrote:
> On 6 August 2013 15:23, Miles Bader <email@example.com
> <mailto:firstname.lastname@example.org>> wrote:
> > Nasty... Go is like a bundle of bad decisions all nicely packaged for
> > convenient use. ><
> > -miles
> Semicolon insertion is the only obviously ugly thing I've found with
> Go so far. What else is there?
> Check out how it handles dates: http://golang.org/src/pkg/time/format.go
> Sent from my Game Boy.
I never looked at the implementation, but the way you specify dates is
I've always thought it was difficult to remember all those C time format
strings (%H, %Y, %whatever...) ... until I saw Go time package!
At least most C placeholders make sense.
I remember I spent half an hour to try to understand why a stupid
20-liner didn't work - then I reread very carefully the docs just to
discover that I gave for granted they used C-like format strings (mental
note to myself ALWAYS RTFM - you really *never* know :-)
I had to reread the API docs of Time.Format a couple of times before my
brain accepted the fact that they wanted me to remember a SPECIFIC date
(wait, ... was it 5 seconds or 5 minutes? And the year? ugh!)
Let alone all those magic numbers sprinkled all over the code!!!
The rationale behind that choice is utterly incomprehensible to me. What
should the advantage be of writing:
instead of say (made up syntax):
Supposed readability? For an absolute newbie in programming maybe, but
any mediocre programmer should be well aware of the meaning and
advantages of symbolic representations.
<hyperbole> That's even worse than sprinkling math code with 3.14
numbers instead of some PI constant. In this latter case, at least, 3.14
is a well known beast. </hyperbole> :-)
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments