[Home] [By Thread] [By Date] [Recent Entries]

  • From: Mukul Gandhi <mukulg@s...>
  • To: Roger L Costello <costello@m...>
  • Date: Mon, 28 Jun 2021 17:01:03 +0530

On Fri, Jun 25, 2021 at 9:52 PM Roger L Costello <costello@m...> 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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member