Timeline for Is readability a valid reason to not use const in (reference) parameters?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 22, 2016 at 21:37 | comment | added | blackpen | Yes, when I saw the question, "const unsigned long long int" came to my mind, but, it is not a good candidate to derive benefit from being either "const" or "reference". The typedef solves the general problem of shortening names; but it doesn't feel like good design to hide the very purpose of language constructs (like "const") behind it. | |
| Sep 22, 2016 at 21:25 | comment | added | Jason C | @cmaster That said, sometimes in certain contexts, with certain programmers, it could stay readable. For example, in the very specific case of a program waist-deep in Windows API calls, with a reader who is used to that environment, stuff like e.g. typedef Point * LPPOINT and typedef const Point * LPCPOINT, while super obnoxious, still carries an implicit meaning, because it's consistent with immediate expectations in context. But never in the general case; it's just a weird exception I can think of. | |
| Sep 22, 2016 at 21:08 | history | edited | blackpen | CC BY-SA 3.0 | added 19 characters in body |
| Sep 22, 2016 at 21:04 | comment | added | blackpen | Agreed. I was hesitant to point it out. Thus, "extreme case". | |
| Sep 22, 2016 at 20:38 | history | answered | blackpen | CC BY-SA 3.0 |