Click here to Skip to main content
15,914,416 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: The Horror... Pin
Megidolaon16-Mar-09 0:52
Megidolaon16-Mar-09 0:52 
GeneralRe: The Horror... Pin
Lutosław13-Mar-09 11:23
Lutosław13-Mar-09 11:23 
GeneralRe: The Horror... Pin
Megidolaon16-Mar-09 0:54
Megidolaon16-Mar-09 0:54 
GeneralRe: The Horror... Pin
Robert Surtees14-Mar-09 10:54
Robert Surtees14-Mar-09 10:54 
GeneralRe: The Horror... Pin
Megidolaon16-Mar-09 0:55
Megidolaon16-Mar-09 0:55 
GeneralRe: The Horror... Pin
killabyte14-Mar-09 21:53
killabyte14-Mar-09 21:53 
GeneralRe: The Horror... Pin
PIEBALDconsult20-Mar-09 18:27
mvePIEBALDconsult20-Mar-09 18:27 
GeneralRe: The Horror... Pin
Member 368078519-Mar-09 6:44
Member 368078519-Mar-09 6:44 
I disagree with your attitude about the class.

There are situations where it's appropriate to use a 3-tier architecture, or to wrap public members into accessor methods. But you need to know how to do things the simple way before you can start thinking about these things.

And there are plenty of situations outside class where the "right" way is actually wrong. There are still many environments targetted by various C / C++ compilers where space is still quite limited, and in those cases we must not introduce architectural features that don't add new functionality.

As for the 3-tier architecture, this has no place whatsoever in a class assignment or in any other small program. If you're designing a system which is reasonably complex, and promises to have a long lifetime, and has idenitifiable layers, then there may be economic benefit to thinking in terms of intechangeable tiers. But for a class assignment, it's pure overkill... do you really plan on going back to your old homework code and, say, rewriting the GUI using a different architecture? If not, what possible rationale could you have for using a three-tier approach?

I run into this kind of thinking a lot professionally. Generally, I can sort through the quasi-architectural clutter that results, but this three-tier stuff really mucks things up in my experience.

I'm not saying that it's a bad pattern, simply that it's overapplied. For example, if you ask one novice programmer to write a client module and another to write a server module you're quite likely to get some sort of three-tier client running against a three-tier server. Now the nature of the assignment ("write a client" or "write a server") seems to dictate a client / server architecture; but these meticulous fresh graduates simply cannot live with themselves if they don't "do things right" and use three tiers. As as result, the vast majority of the three-tier implementations out there are pure rubbish.

My general advice is to remember that code is just a means to an end. Beautiful code does nothing in and of itself. By overdoing one particular assignment you're only distracting yourself from the other assignments and challenges you're bound to face down the road.

This is the sort of thing that is taught in Economics class, which is a great thing for a programmer to take in my opinion.
GeneralRe: The Horror... Pin
johnsyd8-Apr-09 21:16
johnsyd8-Apr-09 21:16 
GeneralWTF Name Field [modified*2] Pin
Brady Kelly7-Mar-09 2:47
Brady Kelly7-Mar-09 2:47 
GeneralRe: WTF Name Field [modified*2] Pin
ZaoWuYa9-Mar-09 20:44
ZaoWuYa9-Mar-09 20:44 
GeneralRe: WTF Name Field Pin
Brady Kelly9-Mar-09 23:08
Brady Kelly9-Mar-09 23:08 
GeneralRe: WTF Name Field Pin
ZaoWuYa10-Mar-09 0:10
ZaoWuYa10-Mar-09 0:10 
GeneralRe: WTF Name Field [modified*2] Pin
Nagy Vilmos9-Mar-09 23:26
professionalNagy Vilmos9-Mar-09 23:26 
GeneralRe: WTF Name Field Pin
Brady Kelly10-Mar-09 0:00
Brady Kelly10-Mar-09 0:00 
GeneralJust amusing... Pin
dybs6-Mar-09 17:46
dybs6-Mar-09 17:46 
GeneralRe: Just amusing... Pin
puromtec19-Mar-09 3:41
puromtec19-Mar-09 3:41 
GeneralRe: Just amusing... Pin
dojohansen10-Mar-09 22:14
dojohansen10-Mar-09 22:14 
GeneralRe: Just amusing... Pin
BadKarma10-Mar-09 23:32
BadKarma10-Mar-09 23:32 
GeneralRe: Just amusing... Pin
supercat911-Mar-09 8:58
supercat911-Mar-09 8:58 
GeneralRe: Just amusing... Pin
dybs11-Mar-09 17:56
dybs11-Mar-09 17:56 
GeneralRe: Just amusing... Pin
Jeremy Tierman10-Mar-09 5:55
Jeremy Tierman10-Mar-09 5:55 
GeneralQuotes of the day: Pin
Brady Kelly26-Feb-09 5:40
Brady Kelly26-Feb-09 5:40 
GeneralRe: Quotes of the day: Pin
Tony Pottier27-Feb-09 5:11
Tony Pottier27-Feb-09 5:11 
GeneralRe: Quotes of the day: Pin
Brady Kelly27-Feb-09 5:33
Brady Kelly27-Feb-09 5:33 

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.