From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | Re: Macros for time magic values |
Date: | 2011-03-14 14:42:46 |
Message-ID: | 201103141442.p2EEgkv21825@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Simon Riggs wrote:
> On Sat, 2011-03-12 at 22:29 +0200, Peter Eisentraut wrote:
> > On fre, 2011-03-11 at 12:50 -0500, Bruce Momjian wrote:
> > > It has bothered me that many of our time routines use special magic
> > > constants for time values, e.g. 24, 12, 60, etc.
> > >
> > > The attached patch changes these magic constants to macros to clarify
> > > the code. I would like to apply this for 9.1 as a cleanup.
> >
> > I think it's much clearer with the plain numbers.
>
> Yeh. It's not like the values 24, 12 or 60 were going to change.
Well, I find the macro names clearer because it removes domain-specific
knowledge from code that is already complex, e.g '24' represents what?
It is similar to the argument of why use C when you can use assembler.
I find the macros a pure code clarity win. If most people don't we
should remove them consistently.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2011-03-14 14:50:00 | Re: Macros for time magic values |
Previous Message | Susanne Ebrecht | 2011-03-14 14:42:09 | Re: Collations versus user-defined functions |