Skip to main content
11 events
when toggle format what by license comment
S Mar 27, 2020 at 19:40 history suggested user98809 CC BY-SA 4.0
Make link more easy treada a read to read
Mar 27, 2020 at 19:13 comment added user98809 @Rajdeep_Sindhu I prefer len(alphabets) instead of hardcoded 26 because it's more readable. You know where the value is coming from, what its purpose is, what's going through the programmer's head. The reader doesn't have to work out themselves how 26 was generated. Even if you KNOW that you will never upgrade the program, avoid hardcoding magic numbers.
Mar 27, 2020 at 19:12 review Suggested edits
S Mar 27, 2020 at 19:40
Mar 27, 2020 at 15:07 comment added Reinderien It's shorter and simpler.
Mar 27, 2020 at 15:01 comment added Schmuddi Why do you recommend in-place operators?
Mar 26, 2020 at 18:08 comment added Reinderien That's right. Generally, avoiding magic number is more maintainable.
Mar 26, 2020 at 17:59 vote accept Rajdeep Sindhu
Mar 26, 2020 at 17:59
Mar 26, 2020 at 17:55 comment added Rajdeep Sindhu Thanks a lot, a query though, the point that you made 'don't hard-code 26' was for flexibility, right? Because if I upgrade the program someday to include more characters such as periods or commas, then I won't have to change the number 26 every time. Got it, thanks again
Mar 26, 2020 at 17:54 comment added Reinderien Thank you for the accept, but it might be a little hasty! I suggest that you wait for a day or so to see what other advice you get.
Mar 26, 2020 at 17:53 vote accept Rajdeep Sindhu
Mar 26, 2020 at 17:59
Mar 26, 2020 at 17:49 history answered Reinderien CC BY-SA 4.0