Timeline for May a value of a constant be changed over time?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 9, 2018 at 14:31 | comment | added | einpoklum | An optimizing compiler may theoretically do away with your constants (although perhaps not in Java, I wouldn't know). | |
| Jan 9, 2018 at 7:07 | comment | added | vsz | "Constants take up application space" - unless you are developing an embedded application for a microcontroller with only a kilobyte or two of memory, you shouldn't even be thinking about such things. | |
| Jan 8, 2018 at 18:42 | comment | added | Berin Loritsch | @Alexander, I agree. It is something to be aware of though. | |
| Jan 8, 2018 at 18:27 | comment | added | Alexander | I think the "memory waste" argument is moot. In-lining and tree shaking is a pretty much universal step in any release-mode optimizer. | |
| Jan 8, 2018 at 14:32 | comment | added | Berin Loritsch | @amon, Java might not, but several languages do. I do mean #ifdef flags. While they are not part of C's semantics, they are part of C#. I was writing for the larger context of language agnosticism. | |
| Jan 8, 2018 at 14:30 | comment | added | amon | What do you mean by “compiler flags”? Perhaps the C preprocessor and similar compiler features that support macros/defines and #ifdefs? Since these are based on textual substitution of the source code, they are not part of the programming language semantics. Note that Java does not have a preprocessor. | |
| Jan 8, 2018 at 14:28 | history | edited | Berin Loritsch | CC BY-SA 3.0 | add justification for senior colleague's comments. |
| Jan 8, 2018 at 14:18 | history | answered | Berin Loritsch | CC BY-SA 3.0 |