Yesterday, 08:57 PM
(Yesterday, 05:13 PM)bplus Wrote: "Less lines does not = more readable code"
agreed! 100% but this does not mean less readable either. Fact is readable is an opinion and that is based on ones personal experiences.
(BTW "Less lines <> readable code" less words but don't use it in an English paper )
I think there is a legitimate positive challenge to reduce the lines of code. I think of it as boiling down a code's essence. It is NOT some useless exercise even if it gets silly except silly with colons of course
In reducing lines of code here, what step had I taken that wasn't instructive to a beginner?
Never did I say well you can put it all one one line by using colons because that is not helpful in learning; thats what a bot would do, nothing to learn there. Seems the use _IIF was a popular outcome of this thread. I think _InputBox$ dialog has some great advantages over the simpler Input. How many newbies know about multiple assignments from one Input prompt?
The final one-liner here is less than appealing because it exceeds a certain tolerable line width. line extensions? eeeeh only if you must! better than having to use a horizontal scroller. Thats when I consider shortening variable names or strings.
Tell me, you look at a text book that is 1000 pages and you look at a summary statement one line long, which are you more inclined to read?
Maybe the one-liner will help motivate you to read the text book.
Hey @bplus was not knocking anything you wrote specifically.
He asked an open-ended question and shared my own tips to him. That's it
The idea of less code = better code, not always true. DEFINITELY prefer readability over less LOC IMO.
Your code is great, readable, etc. Aside from the sea of single letter variables you use (lol not a shot at you; you are a master/guru).
This advice I'm giving isn't for you master Yoda, it's for little boy Luke
You also raise a good point. I think a good lesson to experience for oneself is what they prefer and stick to it.
It usually makes very little difference to the program being compiled how we got there