Click here to Skip to main content
15,885,365 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: .NET vs WINRT on Windows 8 Pin
Pete O'Hanlon10-Dec-12 4:44
mvePete O'Hanlon10-Dec-12 4:44 
QuestionDesign Architecture for developing a UML Class Diagram Editor Pin
Daskul9-Dec-12 14:44
Daskul9-Dec-12 14:44 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pin
jschell10-Dec-12 8:36
jschell10-Dec-12 8:36 
QuestionRe: Design Architecture for developing a UML Class Diagram Editor Pin
Daskul10-Dec-12 14:59
Daskul10-Dec-12 14:59 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pin
jschell11-Dec-12 9:35
jschell11-Dec-12 9:35 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor Pin
Daskul11-Dec-12 14:02
Daskul11-Dec-12 14:02 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor Pin
Pete O'Hanlon11-Dec-12 20:44
mvePete O'Hanlon11-Dec-12 20:44 
QuestionWhat's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak8-Dec-12 13:21
Robb Ryniak8-Dec-12 13: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 6:36
professionalEddy Vluggen9-Dec-12 6:36 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 12:15
Robb Ryniak9-Dec-12 12:15 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell9-Dec-12 8:47
jschell9-Dec-12 8:47 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 12:14
Robb Ryniak9-Dec-12 12:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell10-Dec-12 8:24
jschell10-Dec-12 8:24 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak10-Dec-12 10:14
Robb Ryniak10-Dec-12 10:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell11-Dec-12 9:32
jschell11-Dec-12 9:32 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak11-Dec-12 15:34
Robb Ryniak11-Dec-12 15:34 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
jschell12-Dec-12 8:18
jschell12-Dec-12 8:18 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak12-Dec-12 9:07
Robb Ryniak12-Dec-12 9:07 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Keld Ølykke9-Dec-12 9:41
Keld Ølykke9-Dec-12 9:41 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak9-Dec-12 12:21
Robb Ryniak9-Dec-12 12:21 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Pete O'Hanlon10-Dec-12 8:49
mvePete O'Hanlon10-Dec-12 8:49 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak10-Dec-12 10:10
Robb Ryniak10-Dec-12 10:10 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Pete O'Hanlon10-Dec-12 22:13
mvePete O'Hanlon10-Dec-12 22:13 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pin
Robb Ryniak11-Dec-12 11:41
Robb Ryniak11-Dec-12 11:41 
Questionexample of well designed softwares Pin
Giuseppe Tollini6-Dec-12 2:56
Giuseppe Tollini6-Dec-12 2: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.