Post

2DArray
2DArray@2DArray·
i found a situation where a single-letter variable name actually makes the usage code more legible
2DArray tweet media
English
19
106
709
0
2DArray
2DArray@2DArray·
unfortunately if you go further down this train of thought, you end up talking like a pirate ("be" evaluates to either "is" or "are")
2DArray tweet media
English
0
0
0
0
ben
ben@bpmw_·
@2DArray That code is just begging for a ternary operator
English
0
0
0
0
Eugene Cone
Eugene Cone@EugeneCone·
@2DArray This code wouldn't work well in Russian :D 1 chicken = 1 курица 2-4 chickens = 2-4 курицы 5-20 chickens = 5-20 куриц 21 chickens = 21 курица etc.
0
0
0
0
Random832
Random832@Random832·
@2DArray chickens = pluralize("chicken", count) Debug.log($"You have {count} {chickens}.") somewhat more localization-ready, though I don't know how to actually implement the pluralize function in a locale-sensitive way
English
0
0
0
0
Plantprogrammer
Plantprogrammer@PlantProgrammer·
@2DArray That's horrible xD There is no plural "s" in chicken one chicken two chicken three chicken ...
English
0
0
0
0
Conor Giles
Conor Giles@MkGiles·
@2DArray I always struggled with what to call that variable and the answer was staring me right in the face this whole time
English
0
0
0
0
Paylaş