Click here to Skip to main content
15,895,746 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: VB 6 Pin
Lutosław30-Aug-10 23:03
Lutosław30-Aug-10 23:03 
GeneralRe: VB 6 Pin
Chris Trelawny-Ross31-Aug-10 4:05
Chris Trelawny-Ross31-Aug-10 4:05 
GeneralRe: VB 6 PinPopular
Richard A. Dalton31-Aug-10 0:15
Richard A. Dalton31-Aug-10 0:15 
JokeRe: VB 6 Pin
Chris Meech31-Aug-10 8:37
Chris Meech31-Aug-10 8:37 
GeneralRe: VB 6 Pin
Rob Grainger31-Aug-10 22:37
Rob Grainger31-Aug-10 22:37 
GeneralRe: VB 6 Pin
jmoralesv1-Sep-10 17:14
professionaljmoralesv1-Sep-10 17:14 
GeneralRe: VB 6 Pin
Lutosław31-Aug-10 22:28
Lutosław31-Aug-10 22:28 
GeneralRe: VB 6 Pin
Rob Grainger31-Aug-10 22:59
Rob Grainger31-Aug-10 22:59 
Jacek Gajek wrote:
1. Option Explicit Off

Yes this is horrible, almost as bad as JavaScript doing exactly the same, but with (until ECMAScript5) no equivalent of Option Explicit On.


Jacek Gajek wrote:
2. On Error Goto Label37

Quite horrible, but to blame VB for a fault in BASIC since the year dot is a bit unfair.

3. With/End With - OK, this is truly a mistake.
4. I don't like globals either, but most languages, particularly of that era, support them.
5. someInteger = CInt(int1/int2) (divide operator on two ints gives... a double).
Actually - thats pretty correct. Last time I checked 1/2 in mathematics was 0.5, not 0 or 1.
Ideally, a language can distinguish integer division and floating-point division, maybe with different operators, but this doesn't seem too horrible to me.
6. Yes, a terrible decision, and Option Base 0 just made things worse, as code in different modules can have different bases. I don't mind base 0 or 1, consistency is really important.
7. Not sure what you're referring to here, but if you mean null-propagation where nulls occur in boolean expressions (where null is an allowable result), that's the only option. Check the literature on Relational DB's (Codd et al.) for the justification.
Actually, Codd proposes 4-state logic (Yes,No,Maybe and Inapplicable, Maybe and Applicable).
These are not really boolean logic though, but VB, with typed variables (As Boolean) behaves correctly AFAIK.

It's not a great language, but most languages have points that are plain bad (JavaScript springs to mind heavily). Programmer's should be able to avoid features that cause problems - that's what they're paid for.

I've seen plenty of bad Javascript too - for basically the same reasons as VB.
Maybe we should just ban high-level languages Wink | ;-)
GeneralRe: VB 6 Pin
sergiogarcianinja1-Sep-10 7:00
sergiogarcianinja1-Sep-10 7:00 
GeneralRe: VB 6 Pin
Rob Grainger1-Sep-10 22:11
Rob Grainger1-Sep-10 22:11 
GeneralRe: VB 6 Pin
edmurphy991-Sep-10 7:29
edmurphy991-Sep-10 7:29 
GeneralRe: VB 6 Pin
OriginalGriff1-Sep-10 8:13
mveOriginalGriff1-Sep-10 8:13 
RantRe: VB 6 Pin
Thomas Eyde4-Sep-10 10:38
Thomas Eyde4-Sep-10 10:38 
GeneralRe: VB 6 Pin
OriginalGriff4-Sep-10 10:43
mveOriginalGriff4-Sep-10 10:43 
GeneralRe: VB 6 Pin
Thomas Eyde4-Sep-10 13:49
Thomas Eyde4-Sep-10 13:49 
GeneralRe: VB 6 Pin
OriginalGriff4-Sep-10 21:25
mveOriginalGriff4-Sep-10 21:25 
GeneralRe: VB 6 Pin
Richard A. Dalton6-Sep-10 1:43
Richard A. Dalton6-Sep-10 1:43 
GeneralRe: VB 6 Pin
OriginalGriff6-Sep-10 1:58
mveOriginalGriff6-Sep-10 1:58 
GeneralRe: VB 6 Pin
Richard A. Dalton6-Sep-10 2:17
Richard A. Dalton6-Sep-10 2:17 
GeneralRe: VB 6 Pin
leonej_dt1-Sep-10 12:49
leonej_dt1-Sep-10 12:49 
GeneralRe: VB 6 Pin
Kirk21129-Sep-10 8:41
Kirk21129-Sep-10 8:41 
GeneralRe: VB 6 PinPopular
xperroni1-Sep-10 4:24
xperroni1-Sep-10 4:24 
GeneralRe: VB 6 Pin
Fabio Franco1-Sep-10 5:05
professionalFabio Franco1-Sep-10 5:05 
GeneralRe: VB 6 Pin
Bigdeak10-Sep-10 1:56
Bigdeak10-Sep-10 1:56 
GeneralRe: VB 6 Pin
Fabio Franco10-Sep-10 2:03
professionalFabio Franco10-Sep-10 2:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.