Click here to Skip to main content
15,893,487 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:14
mvahoney the codewitch25-Dec-19 3:14 
AnswerRe: anyone have any ideas for this problem? Pin
User 1106097925-Dec-19 3:36
User 1106097925-Dec-19 3:36 
AnswerRe: anyone have any ideas for this problem? Pin
PIEBALDconsult25-Dec-19 5:41
mvePIEBALDconsult25-Dec-19 5:41 
AnswerRe: anyone have any ideas for this problem? Pin
Jon McKee25-Dec-19 19:28
professionalJon McKee25-Dec-19 19:28 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 19:51
mvahoney the codewitch25-Dec-19 19:51 
AnswerRe: anyone have any ideas for this problem? Pin
Dan Sutton27-Dec-19 9:19
Dan Sutton27-Dec-19 9:19 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch28-Dec-19 0:02
mvahoney the codewitch28-Dec-19 0:02 
AnswerRe: anyone have any ideas for this problem? Pin
MikeCO1028-Dec-19 3:47
MikeCO1028-Dec-19 3:47 
Hi there. Take a minute, breathe and rethink.

There may be nothing at all wrong with what you are doing.

Procedural style can be the correct solution for a given situation. I once had a new programmer come to me and tell me he wanted to rewrite a program piece because it wasn't OO. Cool, go for it. While some of the resultant code was really quite good, a lot of it was un-needed and difficult to read.

Depending on the application, you sometimes start out thinking that a class is going to be the best thing on earth. Later, you find that it never gets reused, will be a lot shorter and clearer in procedural style, so why do it?

Passing 6 or more parameters may be just fine, but the question is have you overridden, expanded, extended, whatever the method beyond its scope and would multiple methods be more concise? It may be a place where the global vars are indeed correct. If properties are only there for 'set and get', you need to reconsider their existence.

In a certain sense, structures really are only a form of global. Their use is generally just clarity: tree.species, tree.color, etc. when they are not being acted upon to where a class is more appropriate. Passing it to a method(s) is probably a class function.

It boils down to architecture. What is the scope and scalability (i.e. future) of what you are writing? In a desktop business app with little or no interaction other than a database (still need all the db handlers obviously), 'down and dirty procedural code' may be just dandy in many cases. Of course, it may not work, as well. But we really can't tell that without an architect/analyst view of the project and entire codebase.

edit: Then there's waterfall vs agile vs continuous evolution. Sometimes you know everything you need up front. Small part of my world. My normal world is "the more you give them, the more they want" - a continuously evolving large codebase. Continual change means refactoring and reviewing that you are still writing effectively instead of creating a nice bowl of spaghetti. Anyone can make spaghetti but nicely layered lasagna is more work!

modified 28-Dec-19 10:05am.

GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch28-Dec-19 3:57
mvahoney the codewitch28-Dec-19 3:57 
GeneralRe: anyone have any ideas for this problem? Pin
MikeCO1028-Dec-19 7:28
MikeCO1028-Dec-19 7:28 
GeneralToday, 20 years ago Pin
Mark_Wallace24-Dec-19 21:47
Mark_Wallace24-Dec-19 21:47 
GeneralRe: Today, 20 years ago Pin
RickZeeland24-Dec-19 22:22
mveRickZeeland24-Dec-19 22:22 
GeneralRe: Today, 20 years ago Pin
Mark_Wallace26-Dec-19 1:23
Mark_Wallace26-Dec-19 1:23 
GeneralRe: Today, 20 years ago Pin
RickZeeland26-Dec-19 2:54
mveRickZeeland26-Dec-19 2:54 
GeneralOliebollen en warme chocolademelk Pin
RickZeeland24-Dec-19 20:06
mveRickZeeland24-Dec-19 20:06 
GeneralRe: Oliebollen en warme chocolademelk Pin
Kornfeld Eliyahu Peter24-Dec-19 20:38
professionalKornfeld Eliyahu Peter24-Dec-19 20:38 
GeneralRe: Oliebollen en warme chocolademelk Pin
RickZeeland24-Dec-19 20:41
mveRickZeeland24-Dec-19 20:41 
GeneralRe: Oliebollen en warme chocolademelk Pin
Kornfeld Eliyahu Peter24-Dec-19 20:49
professionalKornfeld Eliyahu Peter24-Dec-19 20:49 
GeneralRe: Oliebollen en warme chocolademelk Pin
OriginalGriff24-Dec-19 21:12
mveOriginalGriff24-Dec-19 21:12 
GeneralRe: Oliebollen en warme chocolademelk Pin
Cp-Coder25-Dec-19 2:46
Cp-Coder25-Dec-19 2:46 
GeneralRe: Oliebollen en warme chocolademelk Pin
OriginalGriff25-Dec-19 3:35
mveOriginalGriff25-Dec-19 3:35 
GeneralRe: Oliebollen en warme chocolademelk Pin
Cp-Coder25-Dec-19 3:49
Cp-Coder25-Dec-19 3:49 
GeneralRe: Oliebollen en warme chocolademelk Pin
OriginalGriff24-Dec-19 21:10
mveOriginalGriff24-Dec-19 21:10 
GeneralRe: Oliebollen en warme chocolademelk Pin
Mark_Wallace24-Dec-19 21:48
Mark_Wallace24-Dec-19 21:48 
GeneralRe: Oliebollen en warme chocolademelk Pin
RickZeeland24-Dec-19 22:06
mveRickZeeland24-Dec-19 22:06 

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.