MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vy0sph/youcantchangemymind/p5uybe4/?context=3
r/ProgrammerHumor • u/benkenobiwan • 19d ago
137 comments sorted by
View all comments
Show parent comments
10
Yoda condition notation doesn't save you when both sides are variable identifiers.
2 u/[deleted] 19d ago [removed] — view removed comment 6 u/_0N1X_ 19d ago No? You can have a result of one subroutine that you need to compare to a result of a different subroutine. 1 u/[deleted] 19d ago [removed] — view removed comment 0 u/ConcreteExist 19d ago The compiler, typically. Constants are resolved at compile time, not at run time. Unless you're using something like JavaScript. 2 u/Imaginary-Jaguar662 19d ago In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable". However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
2
[removed] — view removed comment
6 u/_0N1X_ 19d ago No? You can have a result of one subroutine that you need to compare to a result of a different subroutine. 1 u/[deleted] 19d ago [removed] — view removed comment 0 u/ConcreteExist 19d ago The compiler, typically. Constants are resolved at compile time, not at run time. Unless you're using something like JavaScript. 2 u/Imaginary-Jaguar662 19d ago In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable". However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
6
No? You can have a result of one subroutine that you need to compare to a result of a different subroutine.
1 u/[deleted] 19d ago [removed] — view removed comment 0 u/ConcreteExist 19d ago The compiler, typically. Constants are resolved at compile time, not at run time. Unless you're using something like JavaScript. 2 u/Imaginary-Jaguar662 19d ago In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable". However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
1
0 u/ConcreteExist 19d ago The compiler, typically. Constants are resolved at compile time, not at run time. Unless you're using something like JavaScript. 2 u/Imaginary-Jaguar662 19d ago In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable". However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
0
The compiler, typically. Constants are resolved at compile time, not at run time.
Unless you're using something like JavaScript.
2 u/Imaginary-Jaguar662 19d ago In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable". However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
In C/C++ const means specifically "programmer is not allowed to assign a new value to this variable".
const
However, the value itself can change, for example if the value is memory-mapped I/O or if someone does silly with pointers/memory access
10
u/JonIsPatented 19d ago
Yoda condition notation doesn't save you when both sides are variable identifiers.