« first day (668 days earlier)      last day (2185 days later) » 
00:00 - 23:0023:00 - 00:00

11:27 PM
When should you use auto, and when should you use actual types?
Cause in the video you linked earlier: @Mgetz he seems to use auto almost everywhere.
 
You use auto when you want to deduce the type from the initializer. Nothing more, nothing less
In particular, i = a.whatever() + g.something_else(); is refactorable to auto l = a.whatever(); auto r = g.something_else(); i = l + r; because the original code didn't have the types specified either (assuming that these member functions return values, not references)
 
Huh. That's cool.
Okay. Thanks.
So if I know it before hand for 100% I can just say the type.
 
It's all about the intent
 
Okay
 
@Annabelle Herb Sutter is one of the Almost Always Auto proponents, with the claim that you should always use auto, but if you know the type, you'd write auto i = Type{expr};
Many people don't quite agree with it
 
11:33 PM
That seems a bit excessive/confusing.
 
I don't, for example
 
There are valid reasons for it, but I don't agree with it either.
 
It uses braces, so you can't apply it universally
 
@milleniumbug Not relevant to AAA argument, though, as you can use auto i = Type(expr);
 
The original post doesn't bother to mention that though
it's all about braces
 
11:37 PM
I used to be all about "uniform" initialization. No longer. std::initializer_list had to ruin the fun :(
 
So! Design question. I have my game (a dungeon crawler if that matters) and it will have multiple levels/maps. Since the levels are randomly generated, and you should be able to go through/up/down levels. What is the best way to keep track, so I can both add a new level as needed, and go through old ones?

I had two thoughts:

1. Use a linked list. This one seems excessive, full of possible pointer problems etc.
2. Use 2 stacks, where the top of one is current level, and if you pop it off, it's pushed onto another stack. This seems a bit... stupid/naive? I'm not exactly sure.
 
You could always use a vector and an index into the vector for the current level
 
....
Right.
No idea why I didn't think of that.
Thanks!
 
No problem ;)
 
By the way, do you code professionally?
 
11:50 PM
yes? I'm technically an intern, although idk if the work I do is really intern-level
 
Ah I see. Okay. Just curious.
 
So I guess if by "professionally" you mean, "do I get paid to code?" then yes, I code professionally. But if you mean, "do I have a lot of experience in industry?" then no.
 
00:00 - 23:0023:00 - 00:00

« first day (668 days earlier)      last day (2185 days later) »