DEV Community

Discussion on: I Am Not A Real Programmer

 
itr13 profile image
Mikael Klages

Another note on the static variable, the name "is(..)Robot" implies it's meant to describe the state of a single instance of a class, while in most languages static would make it the same for all instances.

IE in c# you may have

public static bool IsKillerRobot { get; private set; }

Which would be as safe as any other property, but when a single robot is meant to turn killer, all of them would

Thread Thread
 
qm3ster profile image
Mihail Malo

Presumably we are in the runtime of a single robot, not a manager handling an arbitrary number of them, but I see what you mean.

Thread Thread
 
itr13 profile image
Mikael Klages

Fair point, seems I forgot programming is still limited by physical boundaries :-P

Thread Thread
 
qm3ster profile image
Mihail Malo

Yup, this is how you get hacks like this:
rust-embedded.github.io/book/perip...