in reply to Re: How to split a string
in thread How to split a string

I object! There are valid cases where a digit can be embedded in a variable name that aren't sequential.

$payload_32 $sensor_7 $sensor_125 $thermistor_10um_1

I won't use your tyrannical anti-numerical variable name future language. You'll have to educate people instead.


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

Replies are listed 'Best First'.
Re^3: How to split a string
by Aristotle (Chancellor) on Jan 28, 2005 at 20:57 UTC
    $payload_32 $sensor_7 $sensor_125

    Didn't you just prove merlyn's point?

    Makeshifts last the longest.

      No, I don't think so. My examples correspond to pin out locations and are hardly ever sequential. I guess I could use an array to store them but it would be extremly sparse.

      I believe merlyn's point (if I may bo so bold) is that a developer shouldn't just enumerate variables. IE ($t1, $t2, $t3, etc). Which I agree with whole heartedly.

      However I disagree that digits should be disallowed from a variable name in a language to avoid the problem. There are a lot of valid uses for a digit in a variable. The only way to keep developers from doing this is to educate them on the disadvantages.


      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

        My examples correspond to pin out locations and are hardly ever sequential. I guess I could use an array to store them but it would be extremly sparse.

        Hmm. You could use a hash or use named constants to say something like $pin[ FOO_SENSOR ], then.

        Makeshifts last the longest.