Click here to Skip to main content
15,895,011 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: Wasted space Pin
Jim (SS)9-Oct-09 5:31
Jim (SS)9-Oct-09 5:31 
GeneralRe: Wasted space Pin
PIEBALDconsult9-Oct-09 8:19
mvePIEBALDconsult9-Oct-09 8:19 
GeneralRe: Wasted space Pin
Jim (SS)9-Oct-09 8:25
Jim (SS)9-Oct-09 8:25 
GeneralRe: Wasted space Pin
Robert Surtees9-Oct-09 14:49
Robert Surtees9-Oct-09 14:49 
GeneralRe: Wasted space Pin
Jim (SS)12-Oct-09 6:09
Jim (SS)12-Oct-09 6:09 
GeneralRe: Wasted space Pin
David Skelly12-Oct-09 22:58
David Skelly12-Oct-09 22:58 
GeneralRe: Wasted space Pin
OriginalGriff9-Oct-09 22:19
mveOriginalGriff9-Oct-09 22:19 
GeneralRe: Wasted space Pin
David Skelly12-Oct-09 22:50
David Skelly12-Oct-09 22:50 
Jim (SS) wrote:
Now the question about performance hits. If performance wasn't an issue (and function calls do take extra time), why would we be on a quest for ever faster processors, and more cores. I guess I come from a era when performance was always an issue on any platform and for any processing.


I guess it depends on the kind of applications you write. I write maily web applications for financial companies these days. Most of the performance problems we hit are to do with transferring data over the internet at one end, or talking to the database at the other end. The overhead involved in a method call is pretty much negligible when compared to this. If one of my team spent time doing this sort of refactoring in our application to remove a method call, I would consider it time wasted. I wish I had a pound for every time I have seen someone fixing "performance issues" that didn't really exist.

On the other hand, if you are writing applications that are calculation intensive, or that operate in real-time or near real-time, then this could well be a useful exercise that could make a big difference.


Jim (SS) wrote:
We were also limited to 25 row by 80 column displays (green, amber, black and white). That's part of the reason that the wasted space bothers me so much. That one function (with the comments) would take up most of the screen


This is a source of friction between me and our chief technical architect. He holds on to the old idea that a line of source code must never be more than 80 characters long. Why not? On a modern display, you get code (especially with generics) scrunched up onto the left of the screen spread over several lines not to violate the 80 character rule. And over on the right hand side you have a great big empty space that you're not allowed to type in. The reason: "Some people might have a display that only shows 80 characters". Oh please, when was the last time that you saw anyone actually using a 24x80 green screen terminal, and how likely is it that they will ever look at our code? But no, this is one of those cast-in-stone rules that must not be questioned.
GeneralRe: Wasted space Pin
Jim (SS)13-Oct-09 5:34
Jim (SS)13-Oct-09 5:34 
GeneralRe: Wasted space Pin
supercat919-Oct-09 9:07
supercat919-Oct-09 9:07 
GeneralRe: Wasted space Pin
Dan Neely19-Oct-09 10:31
Dan Neely19-Oct-09 10:31 
GeneralRe: Wasted space Pin
David Skelly19-Oct-09 22:21
David Skelly19-Oct-09 22:21 
GeneralRe: Wasted space Pin
Richard MacCutchan19-Oct-09 10:50
mveRichard MacCutchan19-Oct-09 10:50 
GeneralRe: Wasted space Pin
OriginalGriff19-Oct-09 22:16
mveOriginalGriff19-Oct-09 22:16 
GeneralRe: Wasted space Pin
Richard MacCutchan19-Oct-09 23:56
mveRichard MacCutchan19-Oct-09 23:56 
GeneralRe: Wasted space Pin
David Skelly19-Oct-09 22:18
David Skelly19-Oct-09 22:18 
GeneralRe: Wasted space Pin
Machaira15-Oct-09 2:31
Machaira15-Oct-09 2:31 
GeneralRe: Wasted space Pin
dojohansen15-Oct-09 0:50
dojohansen15-Oct-09 0:50 
GeneralRe: Wasted space Pin
justastupidgurl15-Oct-09 2:54
justastupidgurl15-Oct-09 2:54 
GeneralRe: Wasted space Pin
Richard MacCutchan19-Oct-09 23:58
mveRichard MacCutchan19-Oct-09 23:58 
GeneralRe: Wasted space Pin
OriginalGriff20-Oct-09 0:26
mveOriginalGriff20-Oct-09 0:26 
GeneralRe: Wasted space Pin
emunews11-Dec-09 11:36
emunews11-Dec-09 11:36 
GeneralHow to check if one date is bigger than another... Pin
Paulo Zemek29-Sep-09 3:26
mvaPaulo Zemek29-Sep-09 3:26 
GeneralRe: How to check if one date is bigger than another... Pin
Richard MacCutchan29-Sep-09 3:41
mveRichard MacCutchan29-Sep-09 3:41 
JokeMessage Closed Pin
3-Oct-09 5:52
Bernard Laplace3-Oct-09 5:52 

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.