• (cs) in reply to ammoQ

    Since the VB programmer was reading the text on forms that he had access to in VB, I'm thinking there are definate paths to finding out what the state of an operation was other than this approach.

    He's in FoxPro for crying out loud... you already have an object model for getting at FoxPro data!

  • (cs) in reply to ammoQ
    ammoQ:
    John Smallberries:
    ammoQ:

    We all know, sometimes a well-meaning SW designer hides just too much of the (supposedly) internal state of a module, so other modules have to rely on side effects to find out what's actually going on. Of course the right way to solve that would be to change the model, but there may be other constraints (like: no time left) that make it difficult to do so; the coder of this WTF obviously thought that relying on the color is less problematic (less likely to change) than relying on the text of the label.

    Nice try, but you just can't justify this level of WTFery.
    Simply changing
    Call SaveNewClientData

    <FONT size=3>to</FONT>
    result =  SaveNewClientData()

    would go a long way



    But this requires access to the source of the SaveNewClientData procedure, which may not be the case in this project.

    I think what you are saying is that this isn't so much a WTF than it is a work-around to another WTF.

    In any event, if this were the case, it makes it even more dangerous because it would be coupling the code to a secondary or tertiary property of somone else's module.  No reasonable developer is going to consider the color of the component to be an unchangeable contract.  In other words, developers don't think, "hmm if I change the color of this label, it might break somone's code."

  • (cs) in reply to ammoQ
    ammoQ:

    But this requires access to the source of the SaveNewClientData procedure...

    Yes, I realize that...
    ammoQ:

    ...which may not be the case in this project.

    Granted, I know next to nothing about FoxPro program structure, but SaveNewClientData is modifying elements of the form, right? So it either exists in the same module, or a reference to the form was passed to it. I would bet the former. Also, SaveNewClientData is not qualified as to namespace or library/class, so I would guess it's local.

    Please correct me if I'm wrong. Is everything "global" in FoxPro?



  • (cs) in reply to ReligousFlameWarrior

    Anonymous:
    AmmoQ - with all of the defense of these WTFs the past couple of days, I beginning to think you authored quite a few yourself.

    No really, why are defending such code.  If what you speculate is true, then this code, and code like it, should never see the light of day.

    I'm confident that AmmoQ is a very competent developer.  Perhaps he's playing devil's advocate.  I think his point here is that sometimes, you're given a WTF, and no time to fix it so you just pile it on.  I know I have done this.  Sometimes it's the most reasonable approach.

  • (cs) in reply to dubwai
    dubwai:

    I swear some people are writing code on acid.  I'd love to be there when someone wants to change the color scheme.

    [manager] We've been asked to update the color scheme to fit the corporae standard.  I've got the intern on it.

    [developer] Wait, the logic depends on the RGB values of the components.

    [manager] What?  Why?!

    Now here's the game, kind of like madlibs:  What's the developers response?  I'd get it going but I can't even think of a reason.  I need to eat.

    By changing the background colors rapidly, we get the users to lapse into epileptic fits.. It's a million laughs, dude, ya gotta see it... Really!

    OR

    It's all part of our Logic Reduction Program which, by the way, is really coming along quite well.

    OR

    I.... Am... Job...  Yes?   I code you like boy howdy... Yes?

  • (cs) in reply to Mung Kee

    Mung Kee:
    What's wrong with a business logic color coding scheme?  If it's good enough for the Dept. of Homeland Security....er....I mean......nevermind. 

    Hold on there, Mung Kee.  Homeland Security is not supposed to be paying any attention to color.  Are you saying they are profiling?

  • (cs) in reply to John Smallberries

    John Pickleberries:

    Please correct me if I'm wrong. Is everything "global" in FoxPro?

    Everything is a WTF in FoxPro.  I've never used it to progam but I've had to use FoxPro 'databases' in PowerBuilder.  It's really fun because there are no uniqueness requirements at all.  You can have a table with100 identical rows.  It's loads of fun trying to get a datawindow or datapipeline to work properly with that kind of data.

  • David P. Murphy (unregistered)

    Everyone seems to have focused on the perfectly legitimate use of color and ignored the real WTF:  there is no ELSE branch.
    So, sometimes the poor user will save his new client data but not see a warm & fuzzy message box!   How could you people
    not see this blindingly obvious error?

    ok
    dpm

  • RAE (unregistered) in reply to John Smallberries

    Well, it is in the RGB color system...

  • RAE (unregistered) in reply to John Smallberries

    John Smallberries:
    Anonymous:
    I get it - the WTF is that the colors don't match.  And that everything is primary colors, which would make your eyes hurt after a while...

    --Daniel T

    Green is a primary color?

    (sorry, sometimes I can't help being an asshole...)

    Well, it is in the RGB color system...

  • (cs) in reply to RAE
    Anonymous:

    John Smallberries:
    Anonymous:
    I get it - the WTF is that the colors don't match.  And that everything is primary colors, which would make your eyes hurt after a while...

    --Daniel T

    Green is a primary color?

    (sorry, sometimes I can't help being an asshole...)

    Well, it is in the RGB color system...


    Indeed. That still doesn't make G a primary color.
  • (cs) in reply to dubwai
    dubwai:

    John Pickleberries:

    Please correct me if I'm wrong. Is everything "global" in FoxPro?

    Everything is a WTF in FoxPro.  I've never used it to progam but I've had to use FoxPro 'databases' in PowerBuilder.  It's really fun because there are no uniqueness requirements at all.  You can have a table with100 identical rows.  It's loads of fun trying to get a datawindow or datapipeline to work properly with that kind of data.


    Gotcha. All WTF, all the time.

    I guess even in SQL Server, if you choose not to define a PK, you can shoot yourself in the foot also.
    You've made your WTF, now you lie in it.
  • (cs) in reply to ReligousFlameWarrior
    Anonymous:
    AmmoQ - with all of the defense of these WTFs the past couple of days, I beginning to think you authored quite a few yourself.

    Definitely not. That doesn't mean I haven't made WTFs, it's just nobody has ever posted them here. ;-)

    No really, why are defending such code.  If what you speculate is true, then this code, and code like it, should never see the light of day.

    I'm just guessing why someone would create such code. From a global point of view, it's a WTF, no question.

    dubwai:

    I think what you are saying is that this isn't so much a WTF than it is a work-around to another WTF.

    In any event, if this were the case, it makes it even more dangerous because it would be coupling the code to a secondary or tertiary property of somone else's module.  No reasonable developer is going to consider the color of the component to be an unchangeable contract.  In other words, developers don't think, "hmm if I change the color of this label, it might break somone's code."


    It depends on the circumstances. This code looks like legacy to me, maybe the source for "SaveNewClientData" is no longer available or it is to complicated (unreadable) to savely change anything in it. Maybe the whole program is totally opaque and the programmer who did that change - who is probably not the original programmer - wanted to keep his changes as small and local as possible. In such a case, when "SaveNewClientData" will never ever use other colors and the whole system will be dropped soon anyway, it might be the easiest and cheapest way to do it.

    dubwai:

    Anonymous:
    AmmoQ - with all of the defense of these WTFs the past couple of days, I beginning to think you authored quite a few yourself.

    No really, why are defending such code.  If what you speculate is true, then this code, and code like it, should never see the light of day.

    I'm confident that AmmoQ is a very competent developer.  Perhaps he's playing devil's advocate.  I think his point here is that sometimes, you're given a WTF, and no time to fix it so you just pile it on.  I know I have done this.  Sometimes it's the most reasonable approach.



    Right. Of course we all deeply want to do the right thing but there's a lot of WTF legacy out there that wont be any better if you break the consistent uglyness.


  • Allan (unregistered) in reply to David P. Murphy

    I was wondering when someone would point that out (and preparing to do it myself if no one else did). Not that I'm real thrilled with the color logic, but at least if you're going to do it, do it right.

  • k (unregistered)

    One thing for sure, the developer is not color-blinded. [H]

  • (cs) in reply to dubwai
    dubwai:

    John Pickleberries:

    Please correct me if I'm wrong. Is everything "global" in FoxPro?

    Everything is a WTF in FoxPro.  I've never used it to progam but I've had to use FoxPro 'databases' in PowerBuilder.  It's really fun because there are no uniqueness requirements at all.  You can have a table with100 identical rows.  It's loads of fun trying to get a datawindow or datapipeline to work properly with that kind of data.



    Of course, since FoxPro databases are AFAIK dbase files. These were pre-SQL "databases" (I'm not sure if they deserve that name) where you would step through the records sequentially, each record has a given "record number" etc. Newer tools that think in terms of SQL databases have difficuties with these file-based "databases".
  • (cs) in reply to RAE
    Anonymous:

    John Smallberries:
    Anonymous:
    I get it - the WTF is that the colors don't match.  And that everything is primary colors, which would make your eyes hurt after a while...

    --Daniel T

    Green is a primary color?

    (sorry, sometimes I can't help being an asshole...)

    Well, it is in the RGB color system...



    And we know ALL the colors in the RGB color system are primary colors.  In fact, they're changing the name to the "RYB" color system.
  • (cs) in reply to Mike R

    Mike R:
    ..snipped random attempts at flaming

    First, any modern operating system (don't use DOS...if you really want to say DOS was a good OS, you are in serious need of therapy) REQUIRES AT LEAST 4-5 Meg of supporting files.  Java (which you agree is piggish) requires 20ish.  You CAN get away with crt.dll (only 186k) on Windows, but you will also be using several other OS dll files to make up for it.  This is assuming you aren't using MFC.dll. 

    Now, you can argue that MFC is evil..I won't fight it, but if you are using C++ and NOT using it, good luck making any kind of time to market.  If Time to market is not a concern to you, well, you don't really have an opinion that matters.  Time to market is pretty much ALL that anyone who signs our checks really gives a damn about.  If they stop signing, you will likely end up as a fry cook with those amazing social skills of yours.

    Once again, I say...EVERY MODERN PROGRAMMING LANGUAGE HAS A RUNTIME.  VB wasn't the first, and I agree at the time it was a good bit, but it really didn't wear that albatross solo for long (ok, actually Visual C was the first, but MS included the runtime with the OS, a promise they made to VB programmers that they never made good on, much like adding .NET runtimes to the OS).

    The P-Code advantage was NOT portability.  Hell, JAVA was never supposed to actually be portable.  That's somehting marketing made up and the team had to make good on.  P-Code existed to take little harddrive space.  P-Code was a concept developed by ex-mainframe folks who thought every tiny bit of storage needed to be hoarded.  It was a natural extension of dll files.  Add a runtime (which is actually nothing more than a group of dll files) and your exe's are much smaller than an app that doesn't require it.  That 5 meg runtime along with 6 applications takes up less space than 6 apps written in C that are 2 megs each.  This was a time when harddrives were still sub-gig and businesses took storage space as a serious issue.  Technology broke us out of this sink, but for the time, it WAS actually a good solution.  For a GUI application, P-Code could wait just as fast as anything else for a user to click a button.  Did you know Excel was once written in P-Code?  It existed as P-Code (with a runtime bootstrapper) long before VB4 (VB3 was purely interpreted).

    Now, that stated, I hate VB as a language.  I never liked it.  It WAS however, the solution to what most businesses needed.  It IS the reason so many of us actually have jobs currently.  It MADE the IT department in most corporations.  Like it or not, it opened the door for corporate acceptance of desktop applications.  C++ would have failed miserably and Delphi (the only RAD competition and actually a superior product) had Borland to mismanage and screw it up.  VB is a horrible mess as a language, but it filled a void that our industry needed.

    Learn to research, then form an opinion.  Otherwise, your opinion means nothing.  Hell, if you are going to hate something, hate it for valid reasons (like the almost but not quite OO abortion that VB was).   It was a programming language.  It was a successful programming language (as in, projects that were coded in it are still in use in a widespread manner).  It was responsible for a lot of our peers to make a paycheck every month.  How people can hate an abstract like a programming language with such furor is simply beyond me.  It's not a fucking religion.  Bad code was and is written in every language. 

    That said, I'm 39.  I wish I was still a kid. 

  • John (unregistered) in reply to John Smallberries

    "Indeed. That still doesn't make G a primary color."

    I think maybe you need to review what it means to be a primary color.

    But, just for review, from yourdictionary.com:

    A color belonging to any of three groups each of which is regarded as generating all colors, with the groups being:

    a. Additive, physiological, or light primaries red, green, and blue. Lights of red, green, and blue wavelengths may be mixed to produce all colors.

    b. Subtractive or colorant primaries magenta, yellow, and cyan. Substances that reflect light of one of these wavelengths and absorb other wavelengths may be mixed to produce all colors.

    c. Psychological primaries red, yellow, green, and blue, plus the achromatic pair black and white. All colors may be subjectively conceived as mixtures of these.

    (if you're wondering where "red/yellow/blue" is, it's the 2nd one (subtractive/reflective/pigment-based), corrected to the actual color values ... also, I think c is more physiological than psychological, in that it's about how the human eye identifies colors with its different receptors)

  • John (unregistered) in reply to TheDauthi

    "I think this is my favorite WTF ever.  I think I want to use this concept in my current code, except I program IVRs, so I'd have to use tone of voice..."

    Hm. (with apologies to monty python)

    Coworker 1: "I expected the voicemail menu to have an argumentative tone, and instead I got an insulting one!"

    Coworker 2: "Oh, that means you entered the wrong voicemail box."

  • Some Juan (unregistered)

    I believe the politically correct term is "African-American Logic".

  • David P. Murphy (unregistered) in reply to John

    Mike R:

    It's VB!!!! the only programming language I know of that requres four floppies of runtime for a simple measly "Hello World" app.


    scheky:

    > Learn to research, then form an opinion.  Otherwise, your opinion means nothing.

    His opinion meant something to me.  He supplied a context which gave it meaning:  "four floppies" obviously referred to
    an earlier era in which that amount far exceeded the norm for a runtime.  Granted, he should have s/requres/required/
    but I in turn expect you and other WTFers to read between the lines.

    P.S.  Your function names are too blue.   STR.

    ok
    dpm

  • (cs) in reply to John Smallberries
    John Smallberries:

    Please correct me if I'm wrong. Is everything "global" in FoxPro?


    No, and it has been like that since it was first released.  Later versions have even more non-globals.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to John
    Anonymous:
    "Indeed. That still doesn't make G a primary color."
     I think maybe you need to review what it means to be a primary color.

    You were right...and I did.
    I humbly stand corrected. I knew that light emitting devices used RGB, but I was unaware that these were classified as primary.

    Mea culpa. My apologies.

  • (cs) in reply to David P. Murphy

    I've been reading this blog/forum for a while now, and this is the first time I've really, really, i mean REALLY felt the urgent need to create an account and make a comment.

    Why?
    Because I work for a company that does this kind of thing ALL the goddamn time, and it has  pissed me off from day one.
    They (a specific department of the company, which is actually the main department, which I fortunately do not work for a lot of the time but which I am made to lend a helping hand once in a while) are insistant on using Borland C++ Builder for their apps, which I find to be one of the most annoying programming environments I've ever used.  They are so proud and happy to be using a Rapid Application Development environment... every time I have to work on one of their applications I feel like screaming and pulling my hair out.  RAD? Give me make, emacs and a command-line any day of the week.  Actually for Windows-specific stuff I find VC++ way better than Builder and their kludge of a toolkit, VCL, which was very obviously not designed for use in C++ but meant for Pascal/Dephi.

    Anyways, I digress.. The point is that their main application is a graphical terminal for controlling "reliable" fiber optics equipment for expensive long-distance communications links.
    The hardware itself isn't so bad but the code in the PC-side software is so incredibly awful, I've always been tempted to submit half of it to this site.  (The firmware isn't a hell of a lot better.)
    They are constantly using edit box colors (named, appropriately, Edit1, Edit2, Edit3, whatever their actual function happens to be) to not only signify things to the user, but to affect program flow.  Fortunately they use things like RED=RGB(255,0,0) .... for the most part anyway ... but it is still horrible to look at and debug.

    Ah, obviously I could go on here but I would stride way off-topic...

    Perhaps I'll post a specific example if I have time to go find one.

  • (cs) in reply to John
    Anonymous:
    also, I think c is more physiological than psychological, in that it's about how the human eye identifies colors with its different receptors)


    That would about be it. There are various colour receptors in the eye, ranging from those reacting most strongly to red over those that react to green (those are the most numerous and sensitive) to those that react to blue and finally violet. Colours can also result from stimulating several of these at once.

    The psychological model is most closely represented by the HSV model. H for Hue is the angle in a colur wheel. S for Saturation is how, well, saturated the colour appears. Lack of S means grey. V for Value is the brightness, ranging from black to white. (Depending on the exact model.)
  • (cs) in reply to dubwai
    dubwai:

    John Pickleberries:

    Please correct me if I'm wrong. Is everything "global" in FoxPro?

    Everything is a WTF in FoxPro.  I've never used it to progam but I've had to use FoxPro 'databases' in PowerBuilder.  It's really fun because there are no uniqueness requirements at all.  You can have a table with100 identical rows.  It's loads of fun trying to get a datawindow or datapipeline to work properly with that kind of data.



    That would depend on version.  If you are using a version from ten years ago, you might be right.  For the last about ten years, just define a primary key.

    Sincerely,

    Gene Wirchenko

  • Sacha (unregistered) in reply to scheky
    scheky:
    The P-Code advantage was NOT portability.

    Not that I know anything, but wikipedia disagrees with you:

    • http://en.wikipedia.org/wiki/P-Code_machine
    • http://en.wikipedia.org/wiki/UCSD_p-System

    "The machine independence was achieved by defining a virtual machine called the p-Machine... with its own instruction set called p-Code (or pseudo-code)."

    scheky:
    Did you know Excel was once written in P-Code?  It existed as P-Code (with a runtime bootstrapper) long before VB4 (VB3 was purely interpreted).

    Hmm... I highly doubt that any application was written in p-Code. It may have been written in Pascal and compiled to p-Code...

    sacha

  • (cs) in reply to ammoQ
    ammoQ:
    Of course, since FoxPro databases are AFAIK dbase files. These were pre-SQL "databases" (I'm not sure if they deserve that name) where you would step through the records sequentially, each record has a given "record number" etc. Newer tools that think in terms of SQL databases have difficuties with these file-based "databases".


    FoxPro has had SQL for about fifteen years.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to scheky
    scheky:

    Mike R:
    ..snipped random attempts at flaming

    First, any modern operating system (don't use DOS...if you really want to say DOS was a good OS, you are in serious need of therapy) REQUIRES AT LEAST 4-5 Meg of supporting files.  Java (which you agree is piggish) requires 20ish.  You CAN get away with crt.dll (only 186k) on Windows, but you will also be using several other OS dll files to make up for it.  This is assuming you aren't using MFC.dll. 

    Now, you can argue that MFC is evil..I won't fight it, but if you are using C++ and NOT using it, good luck making any kind of time to market.  If Time to market is not a concern to you, well, you don't really have an opinion that matters.  Time to market is pretty much ALL that anyone who signs our checks really gives a damn about.  If they stop signing, you will likely end up as a fry cook with those amazing social skills of yours.

    Once again, I say...EVERY MODERN PROGRAMMING LANGUAGE HAS A RUNTIME.  VB wasn't the first, and I agree at the time it was a good bit, but it really didn't wear that albatross solo for long (ok, actually Visual C was the first, but MS included the runtime with the OS, a promise they made to VB programmers that they never made good on, much like adding .NET runtimes to the OS).

    The P-Code advantage was NOT portability.  Hell, JAVA was never supposed to actually be portable.  That's somehting marketing made up and the team had to make good on.  P-Code existed to take little harddrive space.  P-Code was a concept developed by ex-mainframe folks who thought every tiny bit of storage needed to be hoarded.  It was a natural extension of dll files.  Add a runtime (which is actually nothing more than a group of dll files) and your exe's are much smaller than an app that doesn't require it.  That 5 meg runtime along with 6 applications takes up less space than 6 apps written in C that are 2 megs each.  This was a time when harddrives were still sub-gig and businesses took storage space as a serious issue.  Technology broke us out of this sink, but for the time, it WAS actually a good solution.  For a GUI application, P-Code could wait just as fast as anything else for a user to click a button.  Did you know Excel was once written in P-Code?  It existed as P-Code (with a runtime bootstrapper) long before VB4 (VB3 was purely interpreted).

    Now, that stated, I hate VB as a language.  I never liked it.  It WAS however, the solution to what most businesses needed.  It IS the reason so many of us actually have jobs currently.  It MADE the IT department in most corporations.  Like it or not, it opened the door for corporate acceptance of desktop applications.  C++ would have failed miserably and Delphi (the only RAD competition and actually a superior product) had Borland to mismanage and screw it up.  VB is a horrible mess as a language, but it filled a void that our industry needed.

    Learn to research, then form an opinion.  Otherwise, your opinion means nothing.  Hell, if you are going to hate something, hate it for valid reasons (like the almost but not quite OO abortion that VB was).   It was a programming language.  It was a successful programming language (as in, projects that were coded in it are still in use in a widespread manner).  It was responsible for a lot of our peers to make a paycheck every month.  How people can hate an abstract like a programming language with such furor is simply beyond me.  It's not a fucking religion.  Bad code was and is written in every language. 

    That said, I'm 39.  I wish I was still a kid. 

    GREAT post, couldn't agree more. 

  • (cs) in reply to David P. Murphy

    It is a good thing that good old Windows Update pushes that .NET framework out there.  How many floppies would that be to get 'Hello World' to display in C# or VB.NET.  I know we all hate those languages ...

    so why really is there so much hate for VB language vs. another language?

  • (cs) in reply to scheky
    scheky:
    Now, you can argue that MFC is evil..I won't fight it, but if you are using C++ and NOT using it, good luck making any kind of time to market.

    WTF.  You don't need to develop against MFC to do Windows development in a reasonable time frame.  I've done plenty of Windows development using Qt and have certainly not missed the uncomfortably evil stain on my soul that forms when using MFC.
  • (cs) in reply to scheky
    scheky:
    How people can hate an abstract like a programming language with such furor is simply beyond me.

    Uh, they can hate it pretty easily.  Duh.  Your notion of what people can hate with furor is thankfully not universal: I rather enjoy my sweet loathing of software development abstracts.
  • (cs)
    Alex Papadimoulis:

    If lblClientName.BackColor = RGB(255, 0, 0) Then 'new client
    
    <span style="color: rgb(0, 130, 0);">'Setup the client account</span>
    <span style="color: rgb(0, 0, 255);">Call</span> SaveNewClientData<br><br>    <span style="color: rgb(0, 130, 0);">'notify use of success</span>
    <span style="color: rgb(0, 0, 255);">If</span> lblClientNum.ForeColor = RGB(0, 0, 153) <span style="color: rgb(0, 0, 255);">Then</span>
        MsgBox <span style="color: rgb(132, 130, 132);">"Client was created but is pending activation."</span>
    <span style="color: rgb(0, 0, 255);">ElseIf</span> lblClientNum.ForeColor = RGB(0, 128, 0) <span style="color: rgb(0, 0, 255);">Then</span>
        MsgBox <span style="color: rgb(132, 130, 132);">"Client was created and was successfully activated."</span>
    <span style="color: rgb(0, 0, 255);">ElseIf</span> lblClientNum.ForeColor = RGB(255, 0, 0) _<br>            <span style="color: rgb(0, 0, 255);">And</span> lblClientNum.Caption = <span style="color: rgb(132, 130, 132);">"999999"</span> <span style="color: rgb(0, 0, 255);">Then</span>
        MsgBox <span style="color: rgb(132, 130, 132);">"There was an error creating the client. "</span> &amp; _<br>               <span style="color: rgb(132, 130, 132);">"Please ensure all required fields were entered."</span>
    <span style="color: rgb(0, 0, 255);">End</span> <span style="color: rgb(0, 0, 255);">If</span>
    
    <span style="color: rgb(0, 130, 0);">'ED: Snip ...</span>
    

    End If



    For those of you who have been saying that this is FoxPro code, this code could be Visual FoxPro code except:

    1. Comments in VFP do not start with "'".  They start with "*" for line comments or "&&" for rest of line comments.

    2) The line continuation character in VFP is not "_"; it is ";".

    3) VFP does not have "MsgBox".  Its equivalent is "messagebox".  VFP, like many languages, requires parens around function arguments.

    4) VFP does not have "ElseIf".  Use "else<new line>if" as many other languages require.

    5) VFP does not have "End If".  Its equivalent is "endif".

    6) VFP does have a "call" statement, but it is for calling machine language routines.  It is rather doubtful that such a routine would be for saving data.

    The above code looks like VB.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    ammoQ:
    Of course, since FoxPro databases are AFAIK dbase files. These were pre-SQL "databases" (I'm not sure if they deserve that name) where you would step through the records sequentially, each record has a given "record number" etc. Newer tools that think in terms of SQL databases have difficuties with these file-based "databases".


    FoxPro has had SQL for about fifteen years.

    Sincerely,

    Gene Wirchenko



    Doesn't/Didnt't FoxPro work on the same files like DBase, Clipper? I didn't mean to say they cannot be queried by SQL, but unlike "pure" SQL databases, the position within a file may be meaningfull in a Dbase file. For example, you can say "go to the 51st record and delete it". Of course not something you should build relations on, but sufficient for a database tool to identify exactly one row without actually knowing (or even having) a primary key. (comparable to the rowid in Oracle's database)
  • squirrel bait (unregistered) in reply to Mike R


    I could go into how DOS COM files fit into 64k, needed next to nothing and could be written to not only not rely on the OS, but also no rely on the system or video ROMs. But, that would be pointless.

    DOS COM files needed a bios, minimally, as well as the usual CPU microcode.  But you're right that arguing about how large a program is without a well-defined definition of program is pointless.



    Hell, the only reason that VB had P-Code to start with was because it was actually once considered ADVANTAGEOUS.  Moore's Law hadn't really taken off in the business world yet and p-code with a runtime takes less space than a compiled app on a harddrive.  Now that's a moot point, but then it was big.

    Can you please tell me the advantage to this? There is only ONE advantage I can think of and it surely wasn't about to pan out in VB, and that would be one of portability.


    Space.  Also reduction of compiler-development effort (any standard intermediate form allows for a separation of front-end from back-end in compiler design, reducing the effort to write compilers for new machines).


  • (cs) in reply to tSQL
    tSQL:

    It is a good thing that good old Windows Update pushes that .NET framework out there.  How many floppies would that be to get 'Hello World' to display in C# or VB.NET.


    For hello world, the .net compact framework should easily do, and it would easily fit on two floppies. Of course the full .net framework is larger, but that's not because of the requirements of hello word ;-)


      I know we all hate those languages ...


    Actually, I do have a weak spot for C#.
  • (cs) in reply to squirrel bait

    squirrel bait rocks

    -Virgil

  • bit (unregistered) in reply to scheky

    Scheky: maybe Mike R was exaggerating, but if Anonymous's statement had been serious (I don't think so), someone would point out that reusing variables in this simple way could only be a requirement in embedded or very memory-constrained systems, in which you could never load the big runtime required by these interpreters. We're talking about systems programmed in C or assembly.

  • Adam Courtney (unregistered) in reply to Gene Wirchenko

    Gene Wirchenko:

    For those of you who have been saying that this is FoxPro code, this code could be Visual FoxPro code except:

    1) Comments in VFP do not start with "'".  They start with "*" for line comments or "&&" for rest of line comments.

    2) The line continuation character in VFP is not "_"; it is ";".

    3) VFP does not have "MsgBox".  Its equivalent is "messagebox".  VFP, like many languages, requires parens around function arguments.

    4) VFP does not have "ElseIf".  Use "else<NEW line>if" as many other languages require.

    5) VFP does not have "End If".  Its equivalent is "endif".

    6) VFP does have a "call" statement, but it is for calling machine language routines.  It is rather doubtful that such a routine would be for saving data.

    The above code looks like VB.

    Sincerely,

    Gene Wirchenko

    Well,  The code I sent to Alex was in fact Fox Pro,  Alex may have edited it for readability.  the 'End If'  was an 'EndIf'  when I sent it in.

     

  • (cs) in reply to dubwai
    dubwai:

    I swear some people are writing code on acid.

    <FONT face="Courier New" size=2>that can't possibly happen because the drugs are illegal.</FONT>

    dubwai:

    [manager] We've been asked to update the color scheme to fit the corporae standard.  I've got the intern on it.

    [developer] Wait, the logic depends on the RGB values of the components.

    [manager] What?  Why?!

    <FONT face="Courier New" size=2>[developer] everybody made fun of me for working in the inverted color scheme and 24-point lucidia console, and now i have my revenge!  now, if you'll excuse me, i'm going to join the gnomes in air duct because they stole my air freshner.
    [manager] uh...
    [developer] and don't follow me down there!  it's dangerous!  you think it's easy to sit here day in and day out with the gnomes?  the gnomes are vicious!  they have the tubers!</FONT>

  • bit (unregistered) in reply to John Smallberries
    John Smallberries:
    Anonymous:

    John Smallberries:
    Anonymous:
    I get it - the WTF is that the colors don't match.  And that everything is primary colors, which would make your eyes hurt after a while...

    --Daniel T

    Green is a primary color?

    (sorry, sometimes I can't help being an asshole...)

    Well, it is in the RGB color system...


    Indeed. That still doesn't make G a primary color.

    Yes, it does. It's a primary color in the RGB system, because in that system, every other color is composed from these three. That's precisely the definition of a "primary color".

  • Arachnid (unregistered) in reply to scheky
    scheky:
    Really?  Then you really aren't all that perceptive.  Runtime files (usually known as Dynamic Link Libraries...you know dll files?) have been around for ages.  Most OS interpretations of C++ required a few core DLLs to function.  The only reason you didn't need to distribute them is that they included them with the OS usually.  Do you think Pearl runs without a runtime?  Java?  Have you TRIED to run java without the JVM?  How about Python?

    DLLs are distinct from runtimes. A runtime can be a DLL, but not all DLLs are runtimes.


    scheky:
    Hell, the only reason that VB had P-Code to start with was because it was actually once considered ADVANTAGEOUS.  Moore's Law hadn't really taken off in the business world yet and p-code with a runtime takes less space than a compiled app on a harddrive.  Now that's a moot point, but then it was big.

    Moore's law refers to transistor densities on ICs, not hard drive capacities. It is only happy coincedince that hard drive capacities have followed a similar curve. As for it 'taking off', Moore made his prediction well before VB came out, and it was holding just fine.

    If, as you say, the main reason was to reduce space, why did the requirement for the VB runtime persist right up to VB6? Why not simply compile to native code, like most languages, then have a library of standard controls etc in a DLL? The space requirements are similar, but the performance of the latter is much better.

  • David (unregistered)

    I'm not worthy! Mind-blowingly awesome.

  • (cs) in reply to dubwai
    dubwai:

    I swear some people are writing code on acid.  I'd love to be there when someone wants to change the color scheme.

    [manager] We've been asked to update the color scheme to fit the corporae standard.  I've got the intern on it.

    [developer] Wait, the logic depends on the RGB values of the components.

    [manager] What?  Why?!

    Now here's the game, kind of like madlibs:  What's the developers response?  I'd get it going but I can't even think of a reason.  I need to eat.



    [developer] Because it proactively integrates our synergy paradigm to strategically leverage solutions for an increased productivity potential!
  • (cs) in reply to brazzy
    brazzy:
    dubwai:

    I swear some people are writing code on acid.  I'd love to be there when someone wants to change the color scheme.

    [manager] We've been asked to update the color scheme to fit the corporae standard.  I've got the intern on it.

    [developer] Wait, the logic depends on the RGB values of the components.

    [manager] What?  Why?!

    Now here's the game, kind of like madlibs:  What's the developers response?  I'd get it going but I can't even think of a reason.  I need to eat.



    [developer] Because it proactively integrates our synergy paradigm to strategically leverage solutions for an increased productivity potential!


    [5 coworkers simultanously] BULLSHIT!

  • (cs) in reply to scheky
    scheky:
    Mike R:
    There's just one flaw with that: It's VB!!!! the only programming language I know of that requres four floppies of runtime for a simple measly "Hello World" app.
    Really?  Then you really aren't all that perceptive.  Runtime files (usually known as Dynamic Link Libraries...you know dll files?) have been around for ages.
    DLLs are specific to Microsoft Windows and OS/2, AFAIK.  I'm sure Mike R knows what he's talking about, and your response seems petulant and pointless.
    scheky:
    Most OS interpretations of C++ required a few core DLLs to function.  The only reason you didn't need to distribute them is that they included them with the OS usually.
    I think you'll find Windows may have shipped with earlier versions of Visual Studio runtimes, if at all, but invariably they wouldn't have the newest version that the apps had all been ported to.  Since these were required to run an app linked with them, these would very often need to be provided by the third-party software vendor.

    Many programs written in VB either had to ship the runtimes with their installer (which made it a HUGE download in the days before widespread broadband) or insist the user download it separately.  VC++ runtimes weren't as onerous, as they were somewhat modularized and quite a bit smaller than their VB counterparts.

    The fact that you don't know this illustrates that you've haven't actually deployed shrinkwrapped software to Windows.
    scheky:
    Do you think Pearl runs without a runtime?  Java?  Have you TRIED to run java without the JVM?  How about Python?
    I'll assume you meant "Perl".  Apps written in each of these will usually run on a variety of different versions of their respective interpreters.  You usually don't need to separately download and install three versions of runtimes to run your Java programs, you can usually get away with running one: the latest version.  VB was usually highly tied to the runtime of its particular major version, which meant that you indeed needed each separate runtime.
    scheky:
    Now, I'm not saying VB is a stellar language, but if you are going to make a blanket statement, please don't make one that obviously makes you look like a complete and total idiot.
    He didn't make a blanket statement.  He said VB's runtime was very large and that it was the only one he knew that behaved that way.  A well-considered response would have corrected this, not called names like a child.
  • (cs) in reply to ammoQ
    ammoQ:
    Doesn't/Didnt't FoxPro work on the same files like DBase, Clipper? I didn't mean to say they cannot be queried by SQL, but unlike "pure" SQL databases, the position within a file may be meaningfull in a Dbase file. For example, you can say "go to the 51st record and delete it". Of course not something you should build relations on, but sufficient for a database tool to identify exactly one row without actually knowing (or even having) a primary key. (comparable to the rowid in Oracle's database)


    The present tense is appropriate.  Visual FoxPro is at version 9.

    Basically, yes.  There have been minor format changes, and Clipper did go with its own changes to the format as well..

    Yes, you can go to record 51.  You can also use SQL.  Being able to mix record- and set-oriented commands can be very useful.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Adam Courtney
    Anonymous:

    Well,  The code I sent to Alex was in fact Fox Pro,  Alex may have edited it for readability.  the 'End If'  was an 'EndIf'  when I sent it in.

    I anonymzie code before posting. Since the language of the code was not at all a factor of the "WTF" (heck, it coulda been HTML/Javascript), I put it in something I was more familiar with (and could more easily hilight in HTML).

  • anon (unregistered) in reply to scheky
    scheky:

    The P-Code advantage was NOT portability.  Hell, JAVA was never supposed to actually be portable.  That's somehting marketing made up and the team had to make good on.  P-Code existed to take little harddrive space.  P-Code was a concept developed by ex-mainframe folks who thought every tiny bit of storage needed to be hoarded.  It was a natural extension of dll files.  Add a runtime (which is actually nothing more than a group of dll files) and your exe's are much smaller than an app that doesn't require it.  That 5 meg runtime along with 6 applications takes up less space than 6 apps written in C that are 2 megs each.  This was a time when harddrives were still sub-gig and businesses took storage space as a serious issue.  Technology broke us out of this sink, but for the time, it WAS actually a good solution.  For a GUI application, P-Code could wait just as fast as anything else for a user to click a button.  Did you know Excel was once written in P-Code?  It existed as P-Code (with a runtime bootstrapper) long before VB4 (VB3 was purely interpreted).

    P-Code was supposed to be portable?!! When I disassembled the VB3 platform the 'opcodes' were actually offsets within one of the interpreter's 64kb text segments! (the last couple of x86 instructions executed for each instruction were something like "lods ax" / "jmp near ax").

Leave a comment on “Colored Logic”

Log In or post as a guest

Replying to comment #:

« Return to Article