#feedback on my first game in c++ (cli)

21 messages · Page 1 of 1 (latest)

lean tide
wanton elk
#

code looks really clean

#

you could use fallthrough to your advantage here ```cpp
int to_int(const Card &card) {
switch (card.rank) {
case Rank::jack:
case Rank::queen:
case Rank::king:
return 10;
default: return static_cast<int>(card.rank) + 1;
}
}

#

one minor formatting inconsistency, you write const Hand &hand but const Hand* winner

wanton elk
lean tide
#

ok thanks

wanton elk
#

in the definition of Deck::Deck(), why do you write i != 4 rather than i < 4? imo, the latter is clearer in intention

lean tide
#

whats the difference between & and *, also, shoudl class/struct/enum names be PascalCase? also, should functions be snake_case or camelCase?

wanton elk
lean tide
#

i.e in the case of const Hand &hand and const Hand *winner

wanton elk
#

like, one major difference is that pointers are reassignable and nullable

#

while references aren't

lean tide
#

i see

wanton elk
#

oh, SuitSymbols and RankSymbols aren't one of those but are PascalCase anyway

lean tide
#

what should it be?

#

also, should enum variants also be PascalCase?

wanton elk