Timeline for String Encoder with lower-case output
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 17, 2018 at 7:12 | comment | added | user73941 | @whiteshooz: I do not disagree with you. But on the other hand, never hesitate to use a consistent, easy maintainable and intuitive solution. An interview question is also about creativity and productivity as well as "real" coding skills. | |
Nov 16, 2018 at 22:00 | comment | added | whiteshooz |
I am not sold on the idea of the two const string keys & values. In an interviewing exercise, I do not want to send a signal to my reviewer that I can meticulously enter string values. Instead, I want to show them I can programmaticly populate the cache. But I do like seeing the same objective being accomplished using an unique approach. Cheers!
|
|
Nov 16, 2018 at 21:53 | comment | added | whiteshooz |
Thank you for the feedback! I like many of your suggestions and your usage of LINQ zip is sexy! To explain my choice of using continue . I have a profound dislike for nested if statements. I've found that if there is no reason to stay in the if block, I'd rather skip to the next for loop iteration. At the end of the day it's more of a preference like you stated and other people have echoed.
|
|
Nov 16, 2018 at 21:30 | history | edited | user73941 | CC BY-SA 4.0 |
deleted 1 character in body
|
Nov 16, 2018 at 21:10 | comment | added | t3chb0t |
nah, if s only have a nice and pretty alignment and are easier to read, you can better use helper variables for their conditions and even better comment them if necessary. This is not possible with else if because they are glued to the previous block. This is my theory behind it ;-)
|
|
Nov 16, 2018 at 21:04 | comment | added | user73941 |
@t3chb0t: I've never heard that comparison before - but it's your world, I'm only living in it :-). As long as the chain isn't too long (as in the above) I think it's OK. On the other hand: what about five or even ten if-else statements vs the same number of continue s? I would prefer the first.
|
|
Nov 16, 2018 at 20:48 | comment | added | t3chb0t |
Personally, I can't stand the else if - I treat it like goto ;-P
|
|
Nov 16, 2018 at 20:44 | history | answered | user73941 | CC BY-SA 4.0 |