"Breathtaking" code

Oct 13, 2009 19:20

Words like "breathtaking", "stunning", "astounding", "amazing", and "incredible" are not positive words. Oh, they're often used in a positive context, but in reality, they only convey a sense of wonder and disbelief. They can be applied to something horrifying just as easily as something delightful ( Read more... )

programming, work, idiots, vb.net, breathtaking

Leave a comment

lordindra October 14 2009, 01:37:12 UTC
The class was seriously called utility?

I could maybe see a system where a superclass called that gets created. Then various classes offering specific types of utility functions and data inherit off that.

I'm having a hard time coming up with a situation where you would set up a utility class that you use in itself. It's only slightly better than calling a class "things".

The column add bit is funny. I might do something like that if it's a quick and dirty app that I use for myself, but in code I actually expect people to pay for? Assuming the database server, whose code I have no control over, will not malfunction and write my empty columns over full columns? This would hopefully never happen, but the one time it does the client is screwed. Or if the columns can't be created on first run, it throws an error, which I then ignore. Some world class dumb here. Way too strong an assumption that other software in the system will always function correctly.

Reply

t3knomanser October 14 2009, 01:43:36 UTC
There is a class called Utility, which does logging, encryption, and data type conversions (because they couldn't use the native functionality for this for some reason). And yes, it does encryption, not one but TWO ways (ROT13 and AES- I think only the AES is actually used), but it doesn't encrypt passwords.

The other class with a kitchen-sink set of functionality is actually the parent form. The app is an MDI application, and the main form contains all the data access and business logic. All of the other forms have to constantly call out to that form to actually get stuff done.

And yes- on first run, if it fails to create the columns, in just keeps trucking along merrily. The real irony is that this guy also wrote a DB converter to uplift the Access DB into SqlServer, but apparently didn't have IT create the columns.

Oh, also, the way he attempted to implement transactions was by sending "BEGIN TRANSACTION" to the database, instead of using the actual transaction functionality. Needless to say, it didn't work, so he actually had a ( ... )

Reply

lordindra October 14 2009, 02:01:48 UTC
This sounds like he might have run the project update wizard on the original VB6 code and made the bare minimum of manual changes to make it work under .NET.

Reply

t3knomanser October 14 2009, 02:04:03 UTC
The update wizard was probably involved, but there's a lot of obviously new code. I think that might have been his plan, and then he discovered that the upgrade wizard sucks, and that he had to do a lot more work.

Reply

lordindra October 14 2009, 02:26:59 UTC
Probably more work than if he had done a clean rewrite, using the original as a functionality reference only.

I've used it a few times on code I understood, and been baffled at what it spit out at me. I suppose if the original code is extremely well written(not me- I can avoid the brain dead stupidities but I'm sure a pro could find some horrors in what I've written) it might produce useful results sometimes. For the most part though, all it does is make your Visual Studio program directory fill more disk space.

Reply

t3knomanser October 14 2009, 02:39:01 UTC
There's not a lot of well written VB6 code. One of the main complaints people generally have about VB is that, before .NET, it made it easy to write bad code and hard to write good code. It helped for RAD, but made it suck for maintenance.

I've run the conversion tool on some simple projects, and unless the project is utterly trivial, it just doesn't give you good results. And you get none of the benefits of migrating to .NET, in terms of OOP and reusable code.

Awhile back, my organization was asking me what role the converter could play in upgrades, and my response (which they didn't like), was that it should only be used for applications we wanted to kill, or at least, didn't expect to be doing much maintenance on in the future.

Reply

lordindra October 14 2009, 02:52:26 UTC
I found QBasic easier to write somewhat OK code in than VB. Sure, it was all in one source file for the most part, but you weren't encouraged to so directly mix user interface and functionality.

Interesting side note, for my computer logic course, we used QBasic. Mainly so the professor didn't have to actually teach a language, he could focus on the logic. I was the only one to actually use subroutines in the final project.

On the other hand, I was also the only one to use GOTO. I did have some sanity, only jumped forward, and the label was "ENDLOOP" to clearly indicate what the goto was for. I wasn't exactly happy to use a GOTO, but I had no time left to finish and I wanted the extra credit for including file I/O.

Reply

lordindra October 14 2009, 02:52:54 UTC
"VB" in the first paragraph should say "VB6"

Reply


Leave a comment

Up