Active Entries
- 1: Advent, day 5
- 2: Today's programming silliness
- 3: The highly inaccurate guide to the Eurovision Song Contest 2022 results!
- 4: Bang!
- 5: How not to get people to use a new feature
- 6: Misty creek and eerie fog
- 7: Remember...
- 8: Brexit means arrows?
- 9: boggyb's highly inaccurate guide to Eurovision: Shine a Light 2
- 10: Brighton again
Style Credit
- Style: Neutral Good for Practicality by
Expand Cut Tags
No cut tags
no subject
Date: 2005-02-26 11:36 pm (UTC)I prefer switching on strings instead of if..else as I find it cleaner and easier to read. When you get down to it, most stuff like switch is just there to be nice to the programmer. Plus I come from a VB background, and VB has this nice trick of making String a native data type (as opposed to a class in Java, or some glorified byte array in C), and so means you can use Strings just about anywhere you can use numbers. There's also a dedicated concatenation operator, which is nice (and really confused me first time I tried C with MFC's CString - '&' is concatenation in VB and address-of in C) and needed as you can do some funky stuff if you use '+' instead. Basically, "3" + "4" is not the same as "3" & "4", as VB does on-the-fly type conversion too well at times.