3 ms·
As DaFranker points out, it's just easier to type than ('Hearts', 'Diamonds', 'Spades', 'Clubs') and has less opportunity for typos and syntax errors. If
by RyanMcGreal 12y ago
As DaFranker points out, it's just easier to type than
('Hearts', 'Diamonds', 'Spades', 'Clubs')
and has less opportunity for typos and syntax errors. If I was concerned about performance I would replace it with a tuple, but it was Good Enough for a quick example.
- ajuc 12y agoSorry, I realised I sounded negative. Nothing against you, it's just my private opinion. It's not about performance, but about one more incidental step when reading the code. Small cost, but it's there.
- emmelaich 12y agoOne reason I like it is that you're probably going to be reading in the possible values from a stream or arg or config file anyway. But you have a good point. YAGNI is YAGNI.