Comment On The Extensible Menu

"The product we maintain has come a long way," writes Tod Hoven, "the backbone is a three-tier VB6 application that is slowly being ported and rewritten in .NET languages (VB.NET / C#)." [expand full text]
« PrevPage 1 | Page 2Next »

Re: The Extensible Menu

2012-05-29 09:02 • by 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...

Re: The Extensible Menu

2012-05-29 09:03 • by MP79 (unregistered)
Real programmers use spreadsheets.

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

Re: The Extensible Menu

2012-05-29 09:03 • by tjb (unregistered)
trwtf: someone let a VB6 Monkey design a system.

Re: The Extensible Menu

2012-05-29 09:04 • by 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! ;-)

Re: The Extensible Menu

2012-05-29 09:08 • by justsomedudette (unregistered)
Arggg where's the closing bracket? My inner parser is having a fit.

Re: The Extensible Menu

2012-05-29 09:11 • by ThomsonsPier
It is probably bad that the first thing I noticed was the spelling error in row 24.

Re: The Extensible Menu

2012-05-29 09:24 • by frits
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.

Re: The Extensible Menu

2012-05-29 09:30 • by Kryptus (unregistered)
msgBox("First to say Frist !")

Re: The Extensible Menu

2012-05-29 09:32 • by Severity One
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.

Re: The Extensible Menu

2012-05-29 09:35 • by I forget (unregistered)
Yea, let's rewrite it in .net, that will magically solve all of our problems.

Re: The Extensible Menu

2012-05-29 09:50 • by Crisw (unregistered)
Needs a .net wrapper.

Re: The Extensible Menu

2012-05-29 10:12 • by toshir0
382070 in reply to 382067
I forget:
Yea, let's rewrite it in LISP, that will magically make us forget all of our problems.
FTFY

Re: The Extensible Menu

2012-05-29 10:29 • by TGV
382072 in reply to 382057
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.

Re: The Extensible Menu

2012-05-29 10:51 • by MeesterTurner
... and just how many options do you apparently need to end a program anyway?!!?

Re: The Extensible Menu

2012-05-29 11:22 • by Annon Too (unregistered)
So is the real WTF not using XML?

Re: The Extensible Menu

2012-05-29 12:01 • by Mr Clever Ideas (unregistered)
382076 in reply to 382074
Annon Too:
So is the real WTF not using XML?

Unless anyone wants to speculate what a VB equivalent of JSON would look like...

Re: The Extensible Menu

2012-05-29 12:45 • by Zapakh (unregistered)
Other obligatory xkcd:
http://xkcd.com/378/

Re: The Extensible Menu

2012-05-29 12:49 • by Keith Williams (unregistered)
382078 in reply to 382072
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?

Re: The Extensible Menu

2012-05-29 12:50 • by 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...

Re: The Extensible Menu

2012-05-29 12:54 • by Nagesh
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.

Re: The Extensible Menu

2012-05-29 13:23 • by Captcha: paratus (unregistered)
382081 in reply to 382077
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.

Re: The Extensible Menu

2012-05-29 14:08 • by 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.

Re: The Extensible Menu

2012-05-29 14:15 • by KJ (unregistered)
382083 in reply to 382079
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.

Re: The Extensible Menu

2012-05-29 14:38 • by 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.

Re: The Extensible Menu

2012-05-29 14:42 • by 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.

Re: The Extensible Menu

2012-05-29 15:05 • by Nagesh
382088 in reply to 382084
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.

Re: The Extensible Menu

2012-05-29 15:33 • by dkf
382089 in reply to 382087
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…

Re: The Extensible Menu

2012-05-29 15:41 • by 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.

Re: The Extensible Menu

2012-05-29 15:59 • by Scrummy (unregistered)
382091 in reply to 382090
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.

Re: The Extensible Menu

2012-05-29 16:02 • by Zapakh (unregistered)
382092 in reply to 382081
[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/

Re: The Extensible Menu

2012-05-29 16:03 • by KattMan
382093 in reply to 382091
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.

Re: The Extensible Menu

2012-05-29 16:06 • by C-Octothorpe
382094 in reply to 382081
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...

Re: The Extensible Menu

2012-05-29 16:07 • by dkf
382095 in reply to 382090
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.

Re: The Extensible Menu

2012-05-29 16:14 • by KattMan
382096 in reply to 382095
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?!?!

Re: The Extensible Menu

2012-05-29 16:39 • by Matt Westwood
382097 in reply to 382094
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.

Re: The Extensible Menu

2012-05-29 16:40 • by Matt Westwood
382098 in reply to 382096
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.

Hard or Soft

2012-05-29 16:40 • by bgodot
Hard coding or Soft coding isn't the issue.

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

Re: The Extensible Menu

2012-05-29 16:42 • by C-Octothorpe
382100 in reply to 382097
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?

Re: The Extensible Menu

2012-05-29 16:45 • by KattMan
382101 in reply to 382098
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.

Re: The Extensible Menu

2012-05-29 16:46 • by KattMan
382102 in reply to 382100
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!

Re: The Extensible Menu

2012-05-29 16:50 • by TGV
382103 in reply to 382094
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/

Re: The Extensible Menu

2012-05-29 17:44 • by 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.

Re: The Extensible Menu

2012-05-29 17:51 • by Matt Westwood
382106 in reply to 382104
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?"

Re: The Extensible Menu

2012-05-29 17:52 • by brazzy
382107 in reply to 382089
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.

Re: The Extensible Menu

2012-05-29 17:58 • by brazzy
382108 in reply to 382106
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...

Re: The Extensible Menu

2012-05-29 18:24 • by Coyne
382109 in reply to 382104
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 ...

Re: The Extensible Menu

2012-05-29 19:38 • by aew (unregistered)
382110 in reply to 382082
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....

Re: The Extensible Menu

2012-05-29 19:44 • by co (unregistered)
382111 in reply to 382089
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.

Re: The Extensible Menu

2012-05-29 19:55 • by Prashant (unregistered)
382112 in reply to 382097
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.

Re: The Extensible Menu

2012-05-29 21:36 • by 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.
« PrevPage 1 | Page 2Next »

Add Comment