Click here to Skip to main content
14,769,377 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: From the Museum of Ugly Code Pin
boarderstu7-Nov-18 0:30
Memberboarderstu7-Nov-18 0:30 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 2:57
mvaraddevus7-Nov-18 2:57 
GeneralRe: From the Museum of Ugly Code Pin
TheGreatAndPowerfulOz6-Nov-18 6:16
MemberTheGreatAndPowerfulOz6-Nov-18 6:16 
GeneralRe: From the Museum of Ugly Code Pin
den2k886-Nov-18 6:25
professionalden2k886-Nov-18 6:25 
GeneralRe: From the Museum of Ugly Code Pin
TheGreatAndPowerfulOz6-Nov-18 7:25
MemberTheGreatAndPowerfulOz6-Nov-18 7:25 
GeneralRe: From the Museum of Ugly Code Pin
den2k886-Nov-18 21:37
professionalden2k886-Nov-18 21:37 
GeneralRe: From the Museum of Ugly Code Pin
boarderstu6-Nov-18 23:40
Memberboarderstu6-Nov-18 23:40 
GeneralRe: From the Museum of Ugly Code Pin
den2k887-Nov-18 1:24
professionalden2k887-Nov-18 1:24 
Just how a scoped variable can be polluted by another function? I'm not talking about local variables vs global ones - that would be silly - but of variables declared in nested blocks, as
//code
if (condition){
  int xyz;
  int abc;
  // code
}
// other code


abc and xyz will exist only inside the if block and then disappear again. Is that bad? No, if the code is well written (short clear functions) and those variables are positively needed only in that condition statement.

If the code is long and complex jous just end up in a screen of code where there are two "things" named abc and xyz that weren't used anywhere else... it's confusing, to say the least.

Also there is no real benefit since all those variables are stack based so no allocation ever takes place - no need to "save those bytes on the stack" or "save the allocation time".
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X

GeneralRe: From the Museum of Ugly Code Pin
boarderstu7-Nov-18 1:24
Memberboarderstu7-Nov-18 1:24 
GeneralRe: From the Museum of Ugly Code Pin
BillW336-Nov-18 4:49
professionalBillW336-Nov-18 4:49 
GeneralRe: From the Museum of Ugly Code Pin
TheGreatAndPowerfulOz6-Nov-18 6:09
MemberTheGreatAndPowerfulOz6-Nov-18 6:09 
GeneralRe: From the Museum of Ugly Code Pin
Stryder_16-Nov-18 5:15
MemberStryder_16-Nov-18 5:15 
GeneralRe: From the Museum of Ugly Code Pin
raddevus6-Nov-18 5:22
mvaraddevus6-Nov-18 5:22 
GeneralRe: From the Museum of Ugly Code Pin
TheGreatAndPowerfulOz6-Nov-18 6:11
MemberTheGreatAndPowerfulOz6-Nov-18 6:11 
GeneralRe: From the Museum of Ugly Code Pin
Richard Deeming6-Nov-18 5:32
mveRichard Deeming6-Nov-18 5:32 
GeneralRe: From the Museum of Ugly Code Pin
TheGreatAndPowerfulOz6-Nov-18 6:06
MemberTheGreatAndPowerfulOz6-Nov-18 6:06 
GeneralRe: From the Museum of Ugly Code Pin
charlieg6-Nov-18 10:17
Membercharlieg6-Nov-18 10:17 
GeneralRe: From the Museum of Ugly Code Pin
raddevus6-Nov-18 11:47
mvaraddevus6-Nov-18 11:47 
GeneralRe: From the Museum of Ugly Code Pin
Member 91670576-Nov-18 22:09
MemberMember 91670576-Nov-18 22:09 
GeneralRe: From the Museum of Ugly Code Pin
Tomz_KV7-Nov-18 4:41
MemberTomz_KV7-Nov-18 4:41 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 4:58
mvaraddevus7-Nov-18 4:58 
JokeRe: From the Museum of Ugly Code Pin
Chris Maunder7-Nov-18 5:50
cofounderChris Maunder7-Nov-18 5:50 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 6:04
mvaraddevus7-Nov-18 6:04 
GeneralRe: From the Museum of Ugly Code Pin
Baraaaaaa7-Nov-18 6:27
MemberBaraaaaaa7-Nov-18 6:27 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 6:36
mvaraddevus7-Nov-18 6:36 

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.