in reply to Re^3: defining methods on the fly
in thread defining methods on the fly

Cool it not an antonym of good practice.

..How the programmer *feels* about the code is irrelevant...

Exactly. The "coolness" is irrelevant when determining the quality of the code. Which means "Cool is not an antonym of good practice".


Flexible is not an antonym of well defined.

"This function is ultimately flexible, just like a Turing machine!!! In fact, it emulates a Turing machine!" Which means, means, by definitiion, that it's impact on the problem to be solved is vaguely defined; absolutely nothing has been specified about the behaviour of how the final result will be generated. Running one turing machine inside another is the ultimate in power, flexiblity... and pointlessness.

Besides the fact this is a blatant straw man argument, Turing machines are also well defined. Which means "Flexible is not an antonym of well defined".


Clever is not an antonym of simple.

Clever code requires thought to understand, because it's clever and tricky, and showcases the ego of the programmer. Simple code instead seeks to document the program requires, even as it fulfills them.

I totally agree. "Tricky is an antonym of simple". Don't know why you brought it up as part of "Clever is not an antonym of simple" though.

Replies are listed 'Best First'.
Re^5: defining methods on the fly
by Anonymous Monk on Aug 03, 2006 at 21:00 UTC
    Besides the fact this is a blatant straw man argument, Turing machines are also well defined. Which means "Flexible is not an antonym of well defined".

    1) That's not just some straw man. Unfortunately, that's an example from real life. I've maintained code that had a finite state machine to emulate function calls embedded in... Perl, which does function calls: that is, a general state machine calling another general state machine. The author maintained that adding the list of functions to be called (with different names) as a list instead of "recursive function calls" was somehow easier to understand. He was proud of how flexible and dynamic it was. He's one of many bad Perl coders I wish I'd never met. :-(

    2) The machine is well defined. It's operation is not; it varies depending on the input, which is not specified. Is that specific enough for you?

      It is a straw man argument because you chose a single easy example where something was flexible but ill defined to refute the claim that flexible is not an antonym of well defined.

      All you did was show that flexible is not a synonym of well defined, but that was never assertion.


      The author maintained that adding the list of functions to be called (with different names) as a list instead of "recursive function calls" was somehow easier to understand.

      So he was doing exactly what you are arguing for: Removing the cleverness. In his mind, instead of using the fancy-dancy clever recursive function calls, he used a simple-straight forward state machine. Anyone can understand a state machine! You can always break it down into a series of boolean logic statements, what's simpler than that?

      Its exactly what BrowserUK is pointing out. What is "clever" and what is "simple" depends entirely on your level of understanding, and your training.