Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Lines of Code
#1
"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 paperBig Grin )

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 Smile

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.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
[split] Lines of Code - by bplus - 01-20-2025, 05:13 PM
RE: [split] Lines of Code - by bplus - 01-20-2025, 11:05 PM
RE: [split] Lines of Code - by SpriggsySpriggs - 01-21-2025, 03:02 AM
RE: [split] Lines of Code - by Pete - 01-21-2025, 07:34 AM
RE: [split] Lines of Code - by mdijkens - 01-21-2025, 10:07 AM
RE: [split] Lines of Code - by SMcNeill - 01-21-2025, 02:37 PM
RE: [split] Lines of Code - by mdijkens - 01-21-2025, 03:04 PM
RE: [split] Lines of Code - by SpriggsySpriggs - 01-21-2025, 03:17 PM
RE: [split] Lines of Code - by dano - 01-25-2025, 04:08 PM
RE: [split] Lines of Code - by Pete - 01-21-2025, 04:26 PM
RE: [split] Lines of Code - by Jack002 - 01-22-2025, 03:19 AM
RE: [split] Lines of Code - by bplus - 01-22-2025, 12:10 PM
RE: [split] Lines of Code - by Pete - 01-25-2025, 05:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VS Code and Qb64 pe Unseen Machine 6 733 09-03-2025, 09:42 PM
Last Post: grymmjack
  has anyone had ChatGPT write QB64 code yet? madscijr 13 2,964 08-23-2025, 09:15 AM
Last Post: doppler
  liquid code experiment madscijr 3 493 06-20-2025, 07:26 PM
Last Post: madscijr
  Update Info (split) doppler 2 432 06-17-2025, 12:17 PM
Last Post: doppler
  Splitting REALLY *REALLY* long lines into single character + CR + LF Circlotron 10 1,541 04-22-2025, 11:30 AM
Last Post: Circlotron

Forum Jump:


Users browsing this thread: 1 Guest(s)