Click here to Skip to main content
12,063,346 members (74,686 online)

Design and Architecture

 
GeneralRe: .NET vs WINRT on Windows 8 Pin
Pete O'Hanlon10-Dec-12 5:44
protectorPete O'Hanlon10-Dec-12 5:44 
QuestionDesign Architecture for developing a UML Class Diagram Editor Pin
Daskul9-Dec-12 15:44
memberDaskul9-Dec-12 15:44 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pin
jschell10-Dec-12 9:36
memberjschell10-Dec-12 9:36 
QuestionRe: Design Architecture for developing a UML Class Diagram Editor Pin
Daskul10-Dec-12 15:59
memberDaskul10-Dec-12 15:59 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pin
jschell11-Dec-12 10:35
memberjschell11-Dec-12 10:35 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor Pin
Daskul11-Dec-12 15:02
memberDaskul11-Dec-12 15:02 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor Pin
Pete O'Hanlon11-Dec-12 21:44
protectorPete O'Hanlon11-Dec-12 21:44 
QuestionWhat's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak8-Dec-12 14:21
memberRobb Ryniak8-Dec-12 14:21 
Ok, I've been doing a lot of reading on these forums lately. I've noticed that a lot of people are making a lot of noise over various coding practices, calling them a "code smell". For example, "never have more than 5 fields in a class, or it's a code smell and should be refactored", as if such advice were "Bible-tastic Goodness". I honestly don't understand why the whole of development has shifted into extremely compact functions/methods as a seemingly "unbreakable rule", where if a class (or God forbid a single method) does more than one thing, it's "bad".

Granted, if you're dealing with inexperienced coders on a team, it's not ideal to let them run amok with hundreds of lines of code without encouraging them to keep things manageable... so it that context, I do see some value in keeping methods and classes compact. However, if you assume a project must meet the same objectives either way, then this requires that functionality must get broken up into an extremely complex tree of various classes, etc., where methods call methods call methods, ad infinitum. My point is that engendering such practices comes at the price of performance.

I've been programming now for over 30 years, and have used a huge variety of languages - everything from GW-BASIC to Assembler to C++ to VB to C#, and everything in between. I've designed systems that run manufacturing facilities, and I've written games that have done well enough to garner millions of downloads. I've been doing this a LONG time doing a LOT of different things with it... and the singular most important lesson I've learned throughout all of this is as follows:

Never, ever, make the computer do more than is required to achieve the desired results; and accomplish this with code that is clear to someone unfamiliar with it via consistent styling, clearly thought out comments, and self-explanatory naming.

This means to never refactor functionality into a separate method just because one method is getting a bit lengthy, assuming that functionality is NEVER needed anywhere else. (And the minute it is actually needed elsewhere, then it's time to move it into a seperate procedure.) Why make the computer perform a CALL instruction (with all the associated stack management for proc address and arguments, etc.) when it doesn't need to? What for? To make it allegedly more readable?? I honestly don't understand the logic behind such refactorings or design methodologies. It seems so wasteful to design so many layers into a project just because some people have a hard time reading longer segments of code.

Maybe I'm just too "old school" for my own good, but it seems to me that good design starts with making a system perform as well as possible with code that is as readable as possible, and in that order; not by following a series of "laws" that result in code that may be more readable to the masses, but runs orders of magnitude slower.

When I was coding on XT machines with a scant couple of Mhz at my disposal, every single instruction mattered... ALOT. It just seems that so many of the current "Best Practices" don't really give much consideration, if at all, to the performance of the end product... and I honestly just don't get why. Sure, one could always just throw more hardware at a design that is more complex than it needs to be, but why should we?

I know this has turned into a bit of a rant, and for my first CodeProject post, that's probably not the most appropriate Unsure | :~ ...but I sincerely would like to know why so many "best coding practices" strike me as focusing on the wrong things... like trying to make programmer's jobs as easy as possible? After all, it will never truly be easy to be truly skilled at programming - it takes practice, no matter what policies we adopt. I guess I'd like to understand why the quest for performance seems to have been nearly completely abandonded in favor of making code as readable as possible... and I'd quite sincerely like to hear some really good reasons to accept such policies as even remotely reasonable.
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Eddy Vluggen9-Dec-12 7:36
memberEddy Vluggen9-Dec-12 7:36 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 13:15
memberRobb Ryniak9-Dec-12 13:15 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell9-Dec-12 9:47
memberjschell9-Dec-12 9:47 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 13:14
memberRobb Ryniak9-Dec-12 13:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell10-Dec-12 9:24
memberjschell10-Dec-12 9:24 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak10-Dec-12 11:14
memberRobb Ryniak10-Dec-12 11:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell11-Dec-12 10:32
memberjschell11-Dec-12 10:32 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak11-Dec-12 16:34
memberRobb Ryniak11-Dec-12 16:34 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell12-Dec-12 9:18
memberjschell12-Dec-12 9:18 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak12-Dec-12 10:07
memberRobb Ryniak12-Dec-12 10:07 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Keld Ølykke9-Dec-12 10:41
memberKeld Ølykke9-Dec-12 10:41 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 13:21
memberRobb Ryniak9-Dec-12 13:21 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Pete O'Hanlon10-Dec-12 9:49
protectorPete O'Hanlon10-Dec-12 9:49 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak10-Dec-12 11:10
memberRobb Ryniak10-Dec-12 11:10 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Pete O'Hanlon10-Dec-12 23:13
protectorPete O'Hanlon10-Dec-12 23:13 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak11-Dec-12 12:41
memberRobb Ryniak11-Dec-12 12:41 
Questionexample of well designed softwares Pin
Giuseppe Tollini6-Dec-12 3:56
memberGiuseppe Tollini6-Dec-12 3:56 

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.


Advertise | Privacy | Mobile
Web04 | 2.8.160204.4 | Last Updated 4 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid