On Sat, Jan 02, 2010 at 05:15:53AM +1300, Ralph Versteegen wrote:
> 2009/12/31 James Paige <[email protected]>:
> > On Thu, Dec 31, 2009 at 07:36:13AM +1300, Ralph Versteegen wrote:
> >> 2009/12/31 Mike Caron <[email protected]>:
> >> > Just out of curiosity, what's wrong with something like:
> >> >
> >> > GetPrefInt(name as string, optional section as string = "default") as 
> >> > integer
> >> >
> >> > Etc.
> >> >
> >> > --
> >> > Mike Caron
> >>
> >> Called from within the backend?
> >>
> >> Seems fine, but
> >> 1) the backend can parse its own damn ints
> >
> > I disagree. String parsing is most definitely not a backend task.
> >
> > ---
> > James
> 
> Heh, it just seems like an unnecessary extra function. My reply:
> string parsing is an extremely common computer program task, and
> backends are programs. It's just a call to atoi. This is starting to
> sound like a holy war.

I think my complaint is a reasonably scientific one. Although 
string-to-integer conversion is a common tas, there is more than one way 
to do it.

Consider the differences between C++'s atoi and FreeBasic's valint, 
differences in how they handle bad input, whether or not round decmals 
or fail on decmals, whether they tolerate trailing garbage, etc.

---
James Paige
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to