Click here to Skip to main content
14,767,352 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.
 
GeneralTo all those who may be lonely on this day Pin
Cp-Coder25-Dec-19 4:27
MemberCp-Coder25-Dec-19 4:27 
GeneralRe: To all those who may be lonely on this day Pin
MadMyche25-Dec-19 5:25
mveMadMyche25-Dec-19 5:25 
GeneralRe: To all those who may be lonely on this day Pin
pkfox25-Dec-19 5:36
professionalpkfox25-Dec-19 5:36 
GeneralRe: To all those who may be lonely on this day Pin
Cp-Coder25-Dec-19 5:40
MemberCp-Coder25-Dec-19 5:40 
GeneralRe: To all those who may be lonely on this day Pin
Eddy Vluggen27-Dec-19 10:44
professionalEddy Vluggen27-Dec-19 10:44 
GeneralRe: To all those who may be lonely on this day Pin
Cp-Coder27-Dec-19 16:25
MemberCp-Coder27-Dec-19 16:25 
GeneralThis Christmas I give you... Pin
Super Lloyd25-Dec-19 4:03
MemberSuper Lloyd25-Dec-19 4:03 
Questionanyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 2:35
mvahoney the codewitch25-Dec-19 2:35 
Frequently when I generate code, I require a LOT of state. This, I've found, is the nature of code generation. You just have to keep track of sometimes over a dozen things at once.

I also tend to find that it lends itself to procedural style coding, rather than OO coding - not the generated code mind you, but the process of generating it.

The problem is, this results in an anti-pattern wherein I'm constantly passing at least 6 parameters per method.

Now, I could keep state in a struct and pass that around but the trouble is, those 6 (or more) different parameters - what they are - varies wildly depending on what I'm calling.

Again, the problem is the amount and variation of state I must work with at any given time.

Creating a bunch of types (classes or structs) just to hold it increases maintenance.

I don't have much of a problem reading the code. It's just the pattern crops up and I don't like it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

AnswerRe: anyone have any ideas for this problem? Pin
Daniel Pfeffer25-Dec-19 2:51
professionalDaniel Pfeffer25-Dec-19 2:51 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 2:53
mvahoney the codewitch25-Dec-19 2:53 
AnswerRe: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 3:18
mvaGreg Utas25-Dec-19 3:18 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:25
mvahoney the codewitch25-Dec-19 3:25 
GeneralRe: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 3:45
mvaGreg Utas25-Dec-19 3:45 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:46
mvahoney the codewitch25-Dec-19 3:46 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:51
mvahoney the codewitch25-Dec-19 3:51 
GeneralRe: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 4:09
mvaGreg Utas25-Dec-19 4:09 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:12
mvahoney the codewitch25-Dec-19 4:12 
AnswerRe: anyone have any ideas for this problem? Pin
Super Lloyd25-Dec-19 4:00
MemberSuper Lloyd25-Dec-19 4:00 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:03
mvahoney the codewitch25-Dec-19 4:03 
GeneralRe: anyone have any ideas for this problem? Pin
Super Lloyd25-Dec-19 4:12
MemberSuper Lloyd25-Dec-19 4:12 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:14
mvahoney the codewitch25-Dec-19 4:14 
AnswerRe: anyone have any ideas for this problem? Pin
User 1106097925-Dec-19 4:36
MemberUser 1106097925-Dec-19 4:36 
AnswerRe: anyone have any ideas for this problem? Pin
PIEBALDconsult25-Dec-19 6:41
professionalPIEBALDconsult25-Dec-19 6:41 
AnswerRe: anyone have any ideas for this problem? Pin
Jon McKee25-Dec-19 20:28
professionalJon McKee25-Dec-19 20:28 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 20:51
mvahoney the codewitch25-Dec-19 20:51 

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.