• Keith Williams (unregistered)

    I don't think this really gives a great insight into the issue. I would rather have seen the code that goes around this interface, perhaps some code behind that calls into the component...

  • MP79 (unregistered)

    Real programmers use spreadsheets.

    obligatory xkcd: http://xkcd.com/378/

  • tjb (unregistered)

    trwtf: someone let a VB6 Monkey design a system.

  • Mr Clever Ideas (unregistered)

    All we need is Microsoft to make a VB.NET version of Groovy, and this sort of design won't be a problem! ;-)

  • justsomedudette (unregistered)

    Arggg where's the closing bracket? My inner parser is having a fit.

  • (cs)

    It is probably bad that the first thing I noticed was the spelling error in row 24.

  • (cs)

    I once designed a menu system for an embedded device that maintained something like 30 attributes in an Excel spreadsheet. At least 3 of the attributes were function pointers. There was an accompanying VB.NET winforms utility that read the spreadsheet and generated a .c file used in the device codebase. Management loved it.

  • Kryptus (unregistered)

    msgBox("First to say Frist !")

  • (cs)

    Some of our applications have Java class names in the database. I've been arguing for a long time, and not always successfully, to start using things like the ServiceLoader interface.

  • I forget (unregistered)

    Yea, let's rewrite it in .net, that will magically solve all of our problems.

  • Crisw (unregistered)

    Needs a .net wrapper.

  • (cs) in reply to I forget
    I forget:
    Yea, let's rewrite it in LISP, that will magically make us forget all of our problems.
    FTFY
  • (cs) in reply to Keith Williams
    Keith Williams:
    I don't think this really gives a great insight into the issue. I would rather have seen the code that goes around this interface, perhaps some code behind that calls into the component...
    I think the OP meant: the application looks for msr_SDI_ID, msr_par_ID, ... msd_Order in the database, and then just executes the string it found. That's just plain awful. It sounds like a bad implementation of a state table. But not only that, sometimes they modify this string in the VB app, while they obviously could have done so in the database.
  • (cs)

    ... and just how many options do you apparently need to end a program anyway?!!?

  • Annon Too (unregistered)

    So is the real WTF not using XML?

  • Mr Clever Ideas (unregistered) in reply to Annon Too
    Annon Too:
    So is the real WTF not using XML?
    Unless anyone wants to speculate what a VB equivalent of JSON would look like...
  • Zapakh (unregistered)

    Other obligatory xkcd: http://xkcd.com/378/

  • Keith Williams (unregistered) in reply to TGV

    That wouldn't make much sense...why would it need to interact with a third party component to provide windows and context menus if it 'only' ran the VB string it found in the database?

  • JimboJones (unregistered)

    My recollection of Visual Basic 6 (and earlier) is that they didn't have any native Execute() / Eval() functions - they couldn't execute strings containing arbitrary Visual Basic code. I suppose it's possible, however, that they made use of the Microsoft Script Control, registered various objects with it, and then executed syntactically similar VBScript code from a string instead...

  • (cs)

    All VB6 programmer give programing a bad name. VB .NET slight better. that like saying central govt slight better then state govt.

    God saves us all in after-life.

  • Captcha: paratus (unregistered) in reply to Zapakh
    MP79:
    Real programmers use spreadsheets.

    obligatory xkcd: http://xkcd.com/378/

    Zapakh:
    Other obligatory xkcd: http://xkcd.com/378/

    I'm not an xkcd-hater, but that one doesn't even fit here.

  • LANMind (unregistered)

    People who complain about "soft coding" are generally too stupid to recognize the subtle horror of hard coding. Sure you can go too far the other way, but the worst case soft code is far better than the worst case hard code.

  • KJ (unregistered) in reply to JimboJones
    JimboJones:
    My recollection of Visual Basic 6 (and earlier) is that they didn't have any native Execute() / Eval() functions - they couldn't execute strings containing arbitrary Visual Basic code. I suppose it's possible, however, that they made use of the Microsoft Script Control, registered various objects with it, and then executed syntactically similar VBScript code from a string instead...
    Yeah, VB6 is not an interpreted language. I am not sure how they are pulling that off. But then are we assuming they are calling that "code"? Why would you MsgBox("Edit") and MsgBox("Paste") off a menu item? Really, every time you when Edit/Paste you would get two message boxes? There's more to the story that we aren't being told so we are assuming that is how that table is being handled.
  • Scrummy (unregistered)

    This just stinks of a Waterfall-developed project. When you allow for no refactoring of code, you end up with brilliant ideas like storing function calls in a database. By the time you hit one of your "milestones," it is far too late to do anything about it.

  • big picture thinker (unregistered)

    I disagree. Too much "soft-coding" (planning for extensibility that will never be useful) is a huge problem. Nobody is going to fiddle with a table like this to change words on a menu. Most likely, the only reason anyone would ever need to edit the menu would be to add a new option or change the way an existing option worked (which would require access to source code in either case).

    CAPTCHA: enim. Give your projects an enim by getting rid of unnecessary abstraction.

  • (cs) in reply to Scrummy
    Scrummy:
    This just stinks of a Waterfall-developed project. When you allow for no refactoring of code, you end up with brilliant ideas like storing function calls in a database. By the time you hit one of your "milestones," it is far too late to do anything about it.

    Always go with Agiel-Scrum, I think.

  • (cs) in reply to big picture thinker
    big picture thinker:
    I disagree. Too much "soft-coding" (planning for extensibility that will never be useful) is a huge problem.
    But with too much hard coding, you've got something that's not just instantaneously obsolete, but also dangerously brittle (e.g., server software only works on one machine because of all the hard-coded paths to a developer's pen drive that was mounted in a strange location).

    Not that you're wrong as such. More that you're doomed either way. Sometimes even both at once…

  • (cs)

    In addition, just to show this isn't a VB issue.

    I'm workign on a C++, C# project right now where nearly every call uses a guid to look up in a database for an entity to grab the next guid, to reference a function call elsewhere.

    You can't trace through code without also doing database lookups just to see where the code is going to take you next.

    This is essentially the same thing as listed in the OP.

    One other thing about this, C programmers are just as bad if not worse then VB programmers, it's just VB code when done poorly was easier to read then C, so we all thought it was VB. No VB just showed the problem in a plainer syntax. Kinda makes you wonder if VB wasn't the real WTF, only the means of exposing them eaiser.

  • Scrummy (unregistered) in reply to KattMan
    KattMan:
    In addition, just to show this isn't a VB issue.

    I'm workign on a C++, C# project right now where nearly every call uses a guid to look up in a database for an entity to grab the next guid, to reference a function call elsewhere.

    You can't trace through code without also doing database lookups just to see where the code is going to take you next.

    This is essentially the same thing as listed in the OP.

    One other thing about this, C programmers are just as bad if not worse then VB programmers, it's just VB code when done poorly was easier to read then C, so we all thought it was VB. No VB just showed the problem in a plainer syntax. Kinda makes you wonder if VB wasn't the real WTF, only the means of exposing them eaiser.

    You really should give Agile development a shot. Enforcing pretty strict TDD would force a removal of all the tight coupling in your codebase.

  • Zapakh (unregistered) in reply to Captcha: paratus

    [quote user="Captcha: paratus"][quote user="MP79"]Real programmers use spreadsheets. [quote user="Zapakh"]Other obligatory xkcd: http://xkcd.com/378/[/quote]

    I'm not an xkcd-hater, but that one doesn't even fit here. [/quote]

    Sorry, meant http://xkcd.com/859/

  • (cs) in reply to Scrummy
    Scrummy:

    You really should give Agile development a shot. Enforcing pretty strict TDD would force a removal of all the tight coupling in your codebase.

    Trust me, I would, I just have no power at all here.

    There is another team working on re-writitng the entire system, once again waterfall though, going to get it all written before handing it over to testers.

    One other thing to note, the source will compile on first check out, but will not run. It's all those soft references that get you.

  • (cs) in reply to Captcha: paratus
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...
  • (cs) in reply to KattMan
    KattMan:
    I'm workign on a C++, C# project right now where nearly every call uses a guid to look up in a database for an entity to grab the next guid, to reference a function call elsewhere.

    You can't trace through code without also doing database lookups just to see where the code is going to take you next.

    Vary it by sometimes putting compiled code in the database, preferably with anti-decompilation hacks applied. Don't keep the original source anywhere.

  • (cs) in reply to dkf
    dkf:
    Vary it by sometimes putting compiled code in the database, preferably with anti-decompilation hacks applied. Don't keep the original source anywhere.

    With the [lack of] code reviews here, I could get away with that and perhaps improve the system while doing so.

    Oh did I say We all sit in one big room, not even cubicals, just long thin desks [tables] we all work side by side on. Hey it increases collaboration right?!?!

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...

    And Christians.

  • (cs) in reply to KattMan
    KattMan:
    dkf:
    Vary it by sometimes putting compiled code in the database, preferably with anti-decompilation hacks applied. Don't keep the original source anywhere.

    With the [lack of] code reviews here, I could get away with that and perhaps improve the system while doing so.

    Oh did I say We all sit in one big room, not even cubicals, just long thin desks [tables] we all work side by side on. Hey it increases collaboration right?!?!

    That's like where I work. It's really cool.

  • (cs)

    Hard coding or Soft coding isn't the issue.

    The real trick to computer programming is not being a fucking idiot.

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    C-Octothorpe:
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...

    And Christians.

    Who would be left?

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    KattMan:
    dkf:
    Vary it by sometimes putting compiled code in the database, preferably with anti-decompilation hacks applied. Don't keep the original source anywhere.

    With the [lack of] code reviews here, I could get away with that and perhaps improve the system while doing so.

    Oh did I say We all sit in one big room, not even cubicals, just long thin desks [tables] we all work side by side on. Hey it increases collaboration right?!?!

    That's like where I work. It's really cool.

    Stand up and cough and I'll wave to you, if I don't instead throw my mouse at you.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Matt Westwood:
    C-Octothorpe:
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...

    And Christians.

    Who would be left?
    Me and maybe Matt, it's a sad state, but hey, free beer for everyone left!

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...
    In that case, he probably meant: http://dynamic.xkcd.com/random/comic/
  • Jay (unregistered)

    I'm all for making systems data driven and flexible. Making it possible to change how the program works without modifying code has been the Holy Grail of programming for decades. The catch is when someone says, "You can change the logic without writing any code!" and it turns out that what they mean is that they've invented their own custom language instead of using a standard language. Like instead of writing a line of, say, VB that says:

    amount=price+tax
    

    you can simply write a block of XML that says

    <operation>
    <params>
    <param seq="1" name="price"/>
    <param seq="2" name="tax"/>
    </params>
    <operation op="add">
    <result name="amount">
    </operation>
    

    I've seen programmers do this time and again. I ask, "Wouldn't it be easier to just write the one line of Java or VB code?" And they start at me with incredulity and explain, "But this way you can change the logic without having to write code! We don't have to recompile when we make a change. Users who don't know anything about programming can make changes for themselves." Etc. I'll point out that, sure, you don't have to recompile, but you still have to run your XML preprocessor or whatever "non-computer language" processor you have for these instructions in, so you haven't gained anything. Or that your custom language is harder to read and understand than VB. And they look at me like I'm an idiot. "Don't you understand why it's better to not have to make code changes?" they ask condescendingly.

  • (cs) in reply to Jay
    Jay:
    I'm all for making systems data driven and flexible. Making it possible to change how the program works without modifying code has been the Holy Grail of programming for decades. The catch is when someone says, "You can change the logic without writing any code!" and it turns out that what they mean is that they've invented their own custom language instead of using a standard language. Like instead of writing a line of, say, VB that says:
    amount=price+tax
    

    you can simply write a block of XML that says

    <operation>
    <params>
    <param seq="1" name="price"/>
    <param seq="2" name="tax"/>
    </params>
    <operation op="add">
    <result name="amount">
    </operation>
    

    I've seen programmers do this time and again. I ask, "Wouldn't it be easier to just write the one line of Java or VB code?" And they start at me with incredulity and explain, "But this way you can change the logic without having to write code! We don't have to recompile when we make a change. Users who don't know anything about programming can make changes for themselves." Etc. I'll point out that, sure, you don't have to recompile, but you still have to run your XML preprocessor or whatever "non-computer language" processor you have for these instructions in, so you haven't gained anything. Or that your custom language is harder to read and understand than VB. And they look at me like I'm an idiot. "Don't you understand why it's better to not have to make code changes?" they ask condescendingly.

    ... to which you look them in the eye with an open expression and say, politely, "No. Why?"

  • (cs) in reply to dkf
    dkf:
    But with too much hard coding, you've got something that's not just instantaneously obsolete, but also dangerously brittle (e.g., server software only works on one machine because of all the hard-coded paths to a developer's pen drive that was mounted in a strange location).

    Not that you're wrong as such. More that you're doomed either way. Sometimes even both at once…

    I guess it depends on what exactly one considers worse: something that breaks quickly and obviously the second it's run outside its usual environment and needs every fix to be done in 25 different places, or a quagmire of empty layers of indirection and inner platforms where any change needs to be done only once, but there's 25 different places where it could be done, all of which have been used for various changes in the past, and each of which requires hours of research to understand.

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    Jay:
    And they look at me like I'm an idiot. "Don't you understand why it's better to not have to make code changes?" they ask condescendingly.
    ... to which you look them in the eye with an open expression and say, politely, "No. Why?"

    And then they explain their change request process and their deployment process to you, and you start to see their point, at least a little.

    Of course, the correct solution would be to fix those processes, but good luck with that...

  • (cs) in reply to Jay
    Jay:
    Or that your custom language is harder to read and understand than VB. And they look at me like I'm an idiot. "Don't you understand why it's better to not have to make code changes?" they ask condescendingly.

    Seen it. Nothing like a zealot that has no idea what coding is. Like this:

    BrickZealot:
    We use bricks to 'brick' in nails here, because 'bricking' is so much better than hammering. Hammering is hard work and we created this so we won't have to do anymore hammering.

    A rose by any other name ...

  • aew (unregistered) in reply to LANMind
    LANMind:
    People who complain about "soft coding" are generally too stupid to recognize the subtle horror of hard coding. Sure you can go too far the other way, but the worst case soft code is far better than the worst case hard code.
    Uhm....look at the paisely horses....
  • co (unregistered) in reply to dkf
    dkf:
    big picture thinker:
    I disagree. Too much "soft-coding" (planning for extensibility that will never be useful) is a huge problem.
    But with too much hard coding, you've got something that's not just instantaneously obsolete, but also dangerously brittle (e.g., server software only works on one machine because of all the hard-coded paths to a developer's pen drive that was mounted in a strange location).

    Not that you're wrong as such. More that you're doomed either way. Sometimes even both at once…

    Conversely with too much soft coding you haven't actually got anything except a program written as a series of variables.

    Any concept can be misused (badly). Sometimes the effort to hard code now coupled with the effort to make a value configurable later is only just more than making something configurable now and never having to configure it....

    That said, most of it comes down to planning. Good planning hopefully sees the right decision being made on hard coded vs soft coded most of the time. The rest of the time (hopefully) it's a minor inconvenience... Something like a time zone might reasonably need to be configurable. Something like the length of a day (not the length of a workday, but 24hrs) can probably be hard coded because the likelihood of it changing in the life of your app is fairly small, and the effort to make it configurable outweighs the risk.

  • Prashant (unregistered) in reply to Matt Westwood
    Matt Westwood:
    C-Octothorpe:
    Captcha: paratus:
    I'm not an xkcd-hater
    I am, and anybody sadistic enough to perpetuate the shit should die a painful death designed for pederasts and liberals...

    And Christians.

    Couldn't help but wonder the uproar if instead of Christian you'd said Muslims....

    What a funny ol' world we live in where discrimination, predjudice and vilification only count only for certain groups. eg: Sexism is discrimination against females (not often you see it the other way) Racism is discrimination against Asians, Indians, Africans, Aborigines and generally anyone who isn't Caucasian Sexual Discrimination is only when someone is homeophobic etc...

    No wonder I don't enjoy being a married, Christian, white, heterosexual male anymore. People can bag me as much as they like, and as soon as I reply I'm discriminating against them based on some group (generally minority) that they choose to align themselves with.

  • Cheong (unregistered)

    I think this is designed to allow features written as delay-loaded modules that could be configured to add to the menu.

    Sounds like reasonably flexible design in the age of VB6.

Leave a comment on “The Extensible Menu”

Log In or post as a guest

Replying to comment #:

« Return to Article