Re: [xml-dev] Special case code is evil … properties of programming languages that enable avoidance of special case code

From
Mukul Gandhi <>
To
Roger L Costello <>
Date
2021-06-28T11:31:03Z
ID
<CANGHzgBNG-xxroZJn_HOb-E7KZ2XUo6_=1yJkquoRXVgvXmi=>
Thread
Re: [xml-dev] Special case code is evil … properties of programming languages that enable avoidance of special case code
On Fri, Jun 25, 2021 at 9:52 PM Roger L Costello <[email protected]> wrote:

To recap:

  • Special case code is evil.
  • Are there properties that a programming language must possess that enable programmers to write code that is free of special case code?
  • Is it theoretically possible to never have to write special case code?

Are you suggesting that, control flow constructs like "if" in the programming languages should be deprecated? If that is so, I strongly disagree.

Please take for example, following logic (written in pseudo-code),

if (age < 15) {
     // do something
else if (age >= 15 and age < 30) {
    // do something different
}
else {
    // do something else
}

The above example, is a specific functional implementation driven by a real world requirement, that can only be implemented by programming constructs like "if".


--
Regards,
Mukul Gandhi