3 ms·
I'll give an example here just for you : boolean a = true; boolean b = true; And every where through the code : if(a == false){ b = true } if(b == true){
by jlengrand 13y ago
I'll give an example here just for you :
boolean a = true;
boolean b = true;
And every where through the code :
if(a == false){
b = true
}
if(b == true){
a = false
}
Then you use either b or a in the code, depending on your feeling of the day.
ANother great example, is inter thread communication, being performed using a boolean in database.
The boolean is checked using a while true loop, in each process.
The database was hit several thousand times a second, by each thread.
In the end, it appears that the variable is just a shared value.
- WoodenChair 13y agoBased on the boolean example, I'm curious whether he was purposely writing bad code, just to mess with you. He may have really not cared for his job or been out to be purposely malicious for some other reason.
- midas007 13y agoMakes me wonder. Has this ever person built anything themselves that scaled? Because at this rate, the database is going to be an even bigger bottleneck that it usually is. There are plenty of people with decades of bad habits because there wasn't code review, peer coaching or treating coding as a "magical" [0] artisan profession. Something to be constantly refined but never completely mastered. [0] SICP, of course.