Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "vb3"
-
So I once had a job as a C# developer at a company that rewrote its legacy software in .Net after years of running VB3 code - the project had originally started in 1994 and ran on Windows 3.11.
As one of the only two guys in the team that actually knew VB I was eventually put in charge of bug for bug compatibility. Since our software did some financial estimations that were impossible to do without it (because they were not well defined), our clients didn't much care if the results were slightly wrong, as long as they were exactly compatible with the previous version - compatibility proved the results were correct.
This job mostly consisted of finding rounding errors caused by the old VB3 code, but that's not what I'm here to talk about today.
One day, after dealing with many smaller functions, I felt I was ready to finally tackle the most complicated function in our code. This was a beast of a function, called Calc, which was called from everywhere in the code, did a whole bunch of calculations, and returned a single number. It consisted of 500 or so lines of spaghetti.
This function had a very peculiar structure:
Function Calc(...)
...
If SomeVariable Then
...
If Not SomeVariable Then
...
(the most important bit of calculation happened here)
...
End If
...
End If
...
End Function
But for some reason it actually worked. For days I tried to find out what's going on, where the SomeVariable was being changed or how the nesting indentation was actually wrong and didn't match the source, but to no avail. Eventually, though, after many days, I did find the answer.
SomeVariable = 1
Somehow, the makers of VB3 though it would be a good idea for Not X to be calculated as (-1 - X). So if a variable was not a boolean (-1 for True, 0 for False), both X and Not X could be truthy, non-zero values.
And kids these days complain about JavaScript's handling of ==...7 -
VB3.
In my last rant I mentioned I used to convert VB3 code to .Net. Before that, I used to work on the VB3 product itself. This software emulated something from the real world, and as such complied with a bunch of regulations that changed on a regular basis, and always had additions and removals that were to be done on a strict schedule (e.g. "we're adding a new product next month, so we have to be able to sell it by the first of the month"). As such, it was a huge sprawling mess.
One day, I was given a task to change some feature slightly. The task was simple enough and really only required adding one line of code. I added that line and clicked "Run".
Error: Too Much Code
What? What do you mean too much code? I asked a colleague for help. "Oh, don't worry, it happens when a function is too long. Just remove one or two of the comments and try again." The comments were, naturally, old deleted code that was quite meaningless so I had no qualms about removing some. It worked, and I went on with my life.
This started happening on a regular basis on our larger functions. But there were always comments to remove so it wasn't a big issue.
One day, though, it happened on a five-line function. This was puzzling - the error had always happened when a function was too big but this one clearly wasn't. What could the error mean? I went to the same colleague.
Apparently, there's also a limit to how big the entire code base can be. "Just find a function that isn't used any more and delete it." And so I did. There were many such functions, responsible for calculating things which no longer existed so they were never called. For months, I'd find functions and remove them. Until there weren't any more. I checked every function and subroutine in our codebase, and they were all used; I checked every possible code path and they were all needed.
What do I do now, I asked? The colleague, who was an expert on VB3 but worked on another project, came and take a look.
"Look at all these small functions you made! No wonder you're running out of space!" Apparently each function created a lot of overhead in the compiled executable. The solution was clear. Combine small functions into large monolithic ones, possibly passing flags in them to do completely unrelated things. Oh, and don't comment on the different parts because we have no room for comments in our code base.
Ah, the good old days.5 -
I'm a backend developer and one day my team lead asked me to make a architecture diagram of our system, which he had to put in a PPT and demo it to a client. I did it for 15-20 minutes. And I completely hated doing it. I went and said "I will not do it". He then just took it from me and did it.. which he is supposed to. Felt very Very good doing that!!1
-
@Gilles had a similar rant and reminded me of a story...
As a kid I learned QBasic. Moved to VB5 and later VB6. Because of this 'knowledge', I was the one who had to maintain legacy applications at my previous job. All of those applications were in use at various banks. On first work day in 2011 all hell broke loose - no date input control would accept the date anymore. I quickly discovered that the max year on date inputs was set to 2010. Later, I was told that nobody expected these applications would still be used in 2010 so they entered it as a distant future number. The funny part was that one bank was still running apps written in VB3 and I had to go back to basics. Didn't even know how to edit basic controls in that interface :D
Good times :)1 -
Sometimes i feel pity for the people who had to work without git. Then I realize that the same people are my boss now.
Screw them! I'm happy they had to go through that!! 😂😂 -
I work everyday with a x16 app that is written in vb3 for Windows 3.1 that runs "natively" on Windows 95, adapted to work in Windows XP, somehow the app works on Windows 7 and in this moment some people is working to make the app works on Windows 10...
You should imagine how good the app behavior is...1 -
i was around 8, i saw my dad coding with VB3, I was fascinated. He taught a bit and showed me his project : A complete and very feature-heavy radar simulator, with lots of graphical elements and planez flying by. I was dumb struck. he even gave me a little project to do : A calculator. Thank you dad
-
Worst part of having a stupid team lead is that you first have to explain the work twice and then start the implementation.. which makes the 15 minutes work as 40 minutes.2
-
Why does our boss think that there is "fix it" button for every bug.. which will magically solve the bug in 1 minute.1
-
A person calling himself a technical lead should have some knowledge about what his subordinates are doing!! It's really a mess for me when my TL says I don't know how to do it, for a problem that I have been trying for almost 4 hours, but you'll have to do it somehow!!1
-
I really hope that Google maps puts his optimization aside and just take me home on a good road.. and not from somewhere Goofy!!