Submission for the Guiness book of world records
-
Instrument = instrument.Accessor;
Accessor = GetAccessorForInstrument(instrument.Accessor);
Accessor.Instrument = instrument.Accessor;:thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown: Has anybody seen a more confusing piece of code???
-
Instrument = instrument.Accessor;
Accessor = GetAccessorForInstrument(instrument.Accessor);
Accessor.Instrument = instrument.Accessor;:thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown: Has anybody seen a more confusing piece of code???
Is this in a case sensitive language?
-
Is this in a case sensitive language?
Yes, it is case-sensitive C#. I forgot to mention that all "instrument" variables are of various "xxxAccessor" types, and all "accessor" variables are of "xxxInstrument" types, so the code is way way worse than it seems. I swear, the variables are declared something like this:
aaaAccessor Instrument;
bbbInstrument Accessor;
cccAccessor instrument;
dddInstrument accessor;Instrument = instrument.Accessor;
Accessor = GetAccessorForInstrument(instrument.Accessor);
Accessor.Instrument = instrument.Accessor;I won't even mention there are also InstrumentFactory class, and AccessorFactory class, and InstrumentWrapper class, and AccessorWrapper class, and IInstrument interface, and IAccessor interface, and InstrumentHelper, and AccessorHelper, and ... Do you think that deserves the Guinness book? I mean, this is probably the only program where not the values but THE MEANINGS of variables are being swapped all the time. This is not programming, this is meta-programming.
modified on Wednesday, December 29, 2010 4:31 PM
-
Yes, it is case-sensitive C#. I forgot to mention that all "instrument" variables are of various "xxxAccessor" types, and all "accessor" variables are of "xxxInstrument" types, so the code is way way worse than it seems. I swear, the variables are declared something like this:
aaaAccessor Instrument;
bbbInstrument Accessor;
cccAccessor instrument;
dddInstrument accessor;Instrument = instrument.Accessor;
Accessor = GetAccessorForInstrument(instrument.Accessor);
Accessor.Instrument = instrument.Accessor;I won't even mention there are also InstrumentFactory class, and AccessorFactory class, and InstrumentWrapper class, and AccessorWrapper class, and IInstrument interface, and IAccessor interface, and InstrumentHelper, and AccessorHelper, and ... Do you think that deserves the Guinness book? I mean, this is probably the only program where not the values but THE MEANINGS of variables are being swapped all the time. This is not programming, this is meta-programming.
modified on Wednesday, December 29, 2010 4:31 PM
-
it's kind of an obfuscation-tactic! After at least 10 lines you're totally confused and want to drain yourself in your coffee mug. regards Torsten
I never finish anyth...
Yeah, it is probably about job security. Everybody who has to work with his code will quit, and he will be forever the sole maintainer of that garbage. What about XAML like this?
<Textbox Text="{Binding xxxViewModel.xxxModel.xxxData.xxxModel.DataContext.xxxUnderlying.xxxModel.xxxViewModel.Model....}" />
Yes, Binding paths with 8 dots and more !!!
modified on Friday, January 7, 2011 1:16 PM
-
Yeah, it is probably about job security. Everybody who has to work with his code will quit, and he will be forever the sole maintainer of that garbage. What about XAML like this?
<Textbox Text="{Binding xxxViewModel.xxxModel.xxxData.xxxModel.DataContext.xxxUnderlying.xxxModel.xxxViewModel.Model....}" />
Yes, Binding paths with 8 dots and more !!!
modified on Friday, January 7, 2011 1:16 PM
I think something got lost in translation
-
I think something got lost in translation
What translation? I have to maintain and fix bugs in his code. It is all like that. Variables have wrong names, and their meaning changes al the time. Variable named "exchange" may actually mean "exchange_code", "exchange_id", "IExchange", "ExchangeConfig". "string exchange" may be used to keep "exchange_id", "exchange_code", and later on "exchange_name"... "instrument" may be of type "IInstrumentWrapper", "Ric", "Occ", "IDataAccessor", or whatever, and "accessor" means exactly the same... What about his unique approach to multi-threading? GUI thread: Click start background thread do something synchronous post to GUI Dispatcher wait until GUI is done do something synchronous post to GUI Dispatcher wait until GUI is done do something synchronous post to GUI Dispatcher wait until GUI is done do something Thread synchronization? Done using bunch of boolean flags, so it is one big race condition waiting to happen. There is no way to stop any background thread of course, so usually you have to use TaskManager to kill the application after you click "Close". Forget about memory leaks and such.