Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: need help using split()

by amelinda (Friar)
on Mar 22, 2001 at 03:38 UTC ( [id://66189]=note: print w/replies, xml ) Need Help??


in reply to need help using split()

Or you could go to the same system your school probably uses for this purpose. Replace "Th" with "R" and all is well. Since the chances of a Sunday class are very low , using "S" for Saturday is probably a reasonable choice, as well.

Yes, I know, not a perl/split solution, but since it sounds like he's generating his own input data, why not be lazy where it's easiest?

Replies are listed 'Best First'.
Re: Re: need help using split()
by Tyke (Pilgrim) on Mar 22, 2001 at 14:05 UTC
    Arrghhh!

    Laziness is all well and good, but when you start to change the outside world in order to make your code simpler, then you're heading for problems. Forcing users to undestand 'R' to mean 'Th' is a case in point.

    The point of programming is to encapsulate the complexity in our own code (where we know(?) that we can handle it), rather than downloading it on users. That way one person (the coder) is inconvenienced, rather than the entire user community.

    Here endeth the pontification

      I thought it was pretty clear that the author was writing this just for himself. As he's the only user, why not change his perspective? Like I said, apply the principle of laziness in the most efficient manner. :grin:

      As for forcing users to use R to stand for Thursday, schools (well, tertiary, not secondary) across the country do it already. It's not exactly a sudden change. It generates a more consistent user interface (all days are one char). If you want to use multiple-char days, why not just go to all 2-char or all 3char?

      On a grand scale, putting the complexity into the program rather than in the interface is a good thing (from a user persective, at least). Yet would you truly paint all problems with the same brush?

Re: Re: need help using split()
by deryni (Beadle) on Mar 22, 2001 at 06:53 UTC
    I had indeed thought of going to the single letter 'R' to represent thursday but decided that I'd rather spend the time and bend the program to my will instead of rethinking my input model to make programming easier. especially since it's not an important project and I'm just doing it for myself.

    but most of all I didn't do that because I don't like the letter r very much!

         -Etan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://66189]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-23 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found