Click here to Skip to main content

Design and Architecture

 
AnswerRe: .NET vs WINRT on Windows 8 PinprotectorPete O'Hanlon10-Dec-12 2:41 
GeneralRe: .NET vs WINRT on Windows 8 Pinmemberdevvvy10-Dec-12 2:51 
GeneralRe: .NET vs WINRT on Windows 8 PinprotectorPete O'Hanlon10-Dec-12 2:59 
GeneralRe: .NET vs WINRT on Windows 8 Pinmemberdevvvy10-Dec-12 3:07 
GeneralRe: .NET vs WINRT on Windows 8 PinprotectorPete O'Hanlon10-Dec-12 3:31 
GeneralRe: .NET vs WINRT on Windows 8 Pinmemberdevvvy10-Dec-12 4:22 
GeneralRe: .NET vs WINRT on Windows 8 PinprotectorPete O'Hanlon10-Dec-12 4:44 
QuestionDesign Architecture for developing a UML Class Diagram Editor PinmemberDaskul9-Dec-12 14:44 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pinmemberjschell10-Dec-12 8:36 
QuestionRe: Design Architecture for developing a UML Class Diagram Editor PinmemberDaskul10-Dec-12 14:59 
AnswerRe: Design Architecture for developing a UML Class Diagram Editor Pinmemberjschell11-Dec-12 9:35 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor PinmemberDaskul11-Dec-12 14:02 
GeneralRe: Design Architecture for developing a UML Class Diagram Editor PinprotectorPete O'Hanlon11-Dec-12 20:44 
QuestionWhat's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb 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?? PinmemberEddy Vluggen9-Dec-12 6:36 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak9-Dec-12 12:15 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? Pinmemberjschell9-Dec-12 8:47 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? [modified] PinmemberRobb Ryniak9-Dec-12 12:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pinmemberjschell10-Dec-12 8:24 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak10-Dec-12 10:14 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pinmemberjschell11-Dec-12 9:32 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak11-Dec-12 15:34 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? Pinmemberjschell12-Dec-12 8:18 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak12-Dec-12 9:07 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberKeld Ølykke9-Dec-12 9:41 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak9-Dec-12 12:21 
AnswerRe: What's the deal with various coding practices and "Code Smell" these days?? PinprotectorPete O'Hanlon10-Dec-12 8:49 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak10-Dec-12 10:10 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinprotectorPete O'Hanlon10-Dec-12 22:13 
GeneralRe: What's the deal with various coding practices and "Code Smell" these days?? PinmemberRobb Ryniak11-Dec-12 11:41 
Questionexample of well designed softwares PinmemberGiuseppe Tollini6-Dec-12 2:56 
AnswerRe: example of well designed softwares Pinmemberjschell6-Dec-12 9:17 
AnswerRe: example of well designed softwares PinmemberEddy Vluggen7-Dec-12 2:07 
AnswerRe: example of well designed softwares PinmemberKeld Ølykke9-Dec-12 9:45 
QuestionWeb services theory PinmemberBytescream3-Dec-12 10:24 
AnswerRe: Web services theory PinmemberRaj Champaneriya3-Dec-12 18:41 
AnswerRe: Web services theory Pinmemberjschell4-Dec-12 8:17 
QuestionConsuming perl webservice in .Net Pinmemberernestohari1-Dec-12 22:38 
AnswerRe: Consuming perl webservice in .Net PinmemberEddy Vluggen2-Dec-12 2:57 
QuestionThoughts on Authorization in a Hierarchical User Structure. PinmemberBrady Kelly1-Dec-12 1:56 
AnswerRe: Thoughts on Authorization in a Hierarchical User Structure. PinmemberEddy Vluggen2-Dec-12 2:56 
GeneralRe: Thoughts on Authorization in a Hierarchical User Structure. PinmemberBrady Kelly2-Dec-12 3:06 
GeneralRe: Thoughts on Authorization in a Hierarchical User Structure. PinmemberEddy Vluggen2-Dec-12 3:34 
QuestionA MEF Question - Refering base classes without adding reference to a dll. PinmemberJohn T.Emmatty29-Nov-12 22:25 
AnswerRe: A MEF Question - Refering base classes without adding reference to a dll. PinmemberEddy Vluggen1-Dec-12 5:30 
QuestionHand Gesture Recognition System PinmemberMember 916988728-Nov-12 3:00 
AnswerRe: Hand Gesture Recognition System PinmemberEddy Vluggen1-Dec-12 5:27 
QuestionMoving code from a Window/UserControl to outside in order to make it reusable! PinmemberRags151227-Nov-12 6:48 
AnswerRe: Moving code from a Window/UserControl to outside in order to make it reusable! PinmemberEddy Vluggen1-Dec-12 5:25 
GeneralRe: Moving code from a Window/UserControl to outside in order to make it reusable! PinmemberRags15129-Dec-12 4:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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.140709.1 | Last Updated 2 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid