[DiscordArchive] Did someome say sugar?
[DiscordArchive] Did someome say sugar?
Archived author: M'Dic • Posted: 2024-06-13T12:19:08.631000+00:00
Original source
Did someome say sugar?
Archived author: chipzz • Posted: 2024-06-13T12:21:19.008000+00:00
Original source
Oh and btw, C++ already supports quite a bit of syntactic sugar, for example operator overloading.
Archived author: r00ty • Posted: 2024-06-13T15:25:11.242000+00:00
Original source
I would argue that in general the reason to put them in from the start is, if you then need to process the data in any way later, you don't need to create the functions and refactor. Just add the logic. But it's one of those things that is largely subjective in nature.
Archived author: stoneharry • Posted: 2024-06-13T21:59:46.320000+00:00
Original source
Sounds like you've never worked at a large software company.
Getters and setters provide a interface to the data. This allows for easier refactability (you don't need to refactor all usages to change how it works) and it allows one to trace the call hierarchy much easier. Say you want to log out each time a value of > 100 is set, you only need to modify the one setter. Most of the time you can't add a breakpoint to production systems.
Archived author: chipzz • Posted: 2024-06-13T22:33:31.986000+00:00
Original source
ROFLMAO, actually I have
Archived author: chipzz • Posted: 2024-06-13T22:36:35.732000+00:00
Original source
Lemme make something clear, because apparently people do not get it
Archived author: chipzz • Posted: 2024-06-13T22:38:37.757000+00:00
Original source
I am not opposed to getters and setters themselves. They definitely can have their uses. But in this case, the value they add is nil.
Archived author: chipzz • Posted: 2024-06-13T22:39:04.847000+00:00
Original source
And there are several problems with the proposed design that are much bigger than this
Archived author: chipzz • Posted: 2024-06-13T22:39:57.613000+00:00
Original source
```c++
void SetInterval(uint32 interval)
{
m_interval = interval;
}
```
Archived author: chipzz • Posted: 2024-06-13T22:40:06.040000+00:00
Original source
This is problematic in multiple ways