Results 1 to 9 of 9

Thread: Legacy Conversion Fun

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,755

    Legacy Conversion Fun

    I am currently in the process of converting a legacy application from VB6 (originally written in VB3 and updated until VB6) and just for the record... I hate spaghetti code.

    Right now I am going through 7 files in 9 methods, across 3 projects, all to insert 2 entities and update 1.

    This is not the only feature like this either.

    I never realized how spread out stuff like this can get!

    Edit - I forgot to mention that none of the variables are passed as arguments to the function. They are scoped at the form level.
    Last edited by dday9; Dec 22nd, 2020 at 05:09 PM.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,902

    Re: Legacy Conversion Fun

    I feel your pain. I'm quite lucky that the original developer for the product I'm currently working on was rabid about code separation so everything's nicely abstracted behind interfaces, which makes dropping changes in a breeze. On the other hand, he uses in/out variables all over the place so working out how a particular value got set is a frickin' nightmare.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,755

    Re: Legacy Conversion Fun

    I'm trying to figure out right now why a variable is changing. It is stored at the form level, but (as per a watch) never changes when I click on the "process" button which means its getting set somewhere/sometime before that.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Legacy Conversion Fun

    The good news is that for VB6 you can edit the watch so that you automatically break when the value changes, it makes the hunting much easier.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,041

    Re: Legacy Conversion Fun

    The bad news is that the debugger in VB6 isn't necessarily running the same code that you are otherwise running. The very fact of setting a breakpoint can change what code gets executed. Still, that's a rare situation to stumble over, as they almost always got it right.
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,755

    Re: Legacy Conversion Fun

    What I ultimately wound up doing is running a SQL Server Profiler, noticed when the Id was being retrieved, did a code search for that SQL command, and found that it was being set WAY before.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  7. #7
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,600

    Re: Legacy Conversion Fun

    Quote Originally Posted by dday9 View Post
    Edit - I forgot to mention that none of the variables are passed as arguments to the function. They are scoped at the form level.
    I wrote an entire game and engine as child in QuickBasic. It utilized text mode for it's "graphics". It was pretty large and the entire thing was written with all variables scoped globally. My little child's mind didn't how to use functions properly. Entire thing was just subs using global variables to get things done. If I have 1 regret in life, is not having to source code for that game. I'd love to go through it as an adult and cringe at how badly it was written, though it did work perfectly. It had a level editor and the ability to record games and play them back.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  8. #8
    Junior Member wossy's Avatar
    Join Date
    Aug 2020
    Posts
    26

    Re: Legacy Conversion Fun

    Quote Originally Posted by Niya View Post
    If I have 1 regret in life, is not having to source code for that game.
    I hurt someone's feelings once. Still feel bad about it, many many years later. I hate myself daily. But at least I have the source code
    Last edited by wossy; Dec 26th, 2020 at 03:41 PM.
    On the bright side, I've still got pessimism and despair to fall back on.

  9. #9
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,600

    Re: Legacy Conversion Fun

    Quote Originally Posted by wossy View Post
    i hurt someone's feelings once. Still feel bad about it, many many years later. I hate myself daily. But at least i have the source code
    lmao
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width