General > Off Topic

Personal news

<< < (5/7) > >>

Botsareus:
[Bump]

Peter:

--- Quote from: Botsareus on March 30, 2016, 04:45:19 PM ---Numsgil:


--- Quote ---But again, my complete and absolute hatred of the current DB2 codebase makes this sort of moot anyway.
--- End quote ---

Why do you hate the current code so much? I hope it is not all my fault.
Although I can see why you might think my attempt at a port will fail because you hate the current code anyway.
Still, I would like to get some pointers from you on this when you have a chance.
--- End quote ---
I suspect it has to do with VB6 and the capabilities of it. It's not as flexible and powerful as modern languages. Sadly it isn't easy to recreate everything in a new language, a lot has already been build in DB2.

Botsareus:
Oh ok, now I know the meaning of the word code base. I thought he meant the actual code. I guess my programming is better than I thought. :P

Numsgil:
It's a combination of the language and the code base itself.  Basically, error handling in VB6 is terrible, and there's all sorts of weird performance overhead on things.  It's also impossible to merge changes to forms created by the form creator, which is an important thing for a collaborative open source project.  Everything it was meant to be, VB.NET does better.

The code base itself is sloppy spaghetti tied together with duct tape and hope.  None of it is tested, so if you make one change, even seemingly innocuous, it might (and probably will) break everything.  We could fix that by adding tests, but there's no good testing framework for VB6, and even if there were, just changing the code enough to make it testable would probably break things.  There are global variables all over the place that manage the simulation state, and of course all sorts of random things will poke and prod at this state from everywhere and anywhere in the code.

The few times I've tried to do anything in the codebase have always been 10000% harder than they should be.  It's a classic example of a codebase that grew larger than it was architected to grow.

That's why I hate it.

Botsareus:
Agree about the spaghetti. It got reasonably bad in a couple of places. Getting rid of the goto will help. Some though I looked at but did not really figure out. One particular that drives me crazy is how the flow command logic is executed. It is a mess and it does not even let you do a start and an else block in one gene. I will have to revisit this at some point when I actually figure out how to fix it.

One other thing that people complain about alot that I need professional opinion on is the global variables. I admit I am guilty of using them often. But my question is in ideal conditions what do I replace them with? I made them public so they save state outside the scope of a subroutine. I could have gone with static but than I would not be able to capture there state for the save simulation code.

Edit: A little follow up question: I think the code (although messy in a few places) is tied together reasonably well. I assume you mean there are better ways to tie code together in a more object driven language. Still more detail on this will be good. Edit: Actually answered this question myself by looking on the DB3 Core module that was just released. However, DB2 was never built object oriented, and refactoring it in a major way like this will probably break most of it. :/

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version