Are flag variables an absolute evil?

Posted by dukeofgaming on Programmers See other posts from Programmers or by dukeofgaming
Published on 2012-10-31T18:29:50Z Indexed on 2012/10/31 23:16 UTC
Read the original article Hit count: 298

I remember doing a couple of projects where I totally neglected using flags and ended up with better architecture/code; however, it is a common practice in other projects I work at, and when code grows and flags are added, IMHO code-spaghetti also grows.

Would you say there are any cases where using flags is a good practice or even necessary?, or would you agree that using flags in code are... red flags and should be avoided/refactored; me, I just get by with doing functions/methods that check for states in real time instead.

Edit: Not talking about compiler flags

© Programmers or respective owner

Related posts about code-quality

Related posts about code-smell