[Gambas-user] Reply to personal rant...
d4t4full at gmail.com
d4t4full at gmail.com
Sat Apr 27 21:17:05 CEST 2019
I see we agree on most things, I also like the Python (or even C) way to see strings as character arrays.
I also agree that source size is not a good way to measure code efectivity or efficiency; at the same time, I like code readability.
On Apr 27, 2019, 12:32, at 12:32, Cedron Dawg <cedron at exede.net> wrote:
>Separate email because I don't want to hijack the originating thread.
>I just added a PrintAt(R,C,String) method to my NiceTerm class. I was
>going to do it originally, but I don't really have a problem with using
>Lines of code is not a good metric for either code complexity or code
>I've seen programmers reduce "lines of code" by calling external
>routines, which in turn, load tons of baggage code, actually take
>longer to execute, and add an external dependency just to avoid writing
>a few lines of code that would do the same task.
>I've also seen programmers who overload statements with incredibly
>complex calculations which would be much more clear if they introduced
>a few temporary variables and broke the calculation into a few lines.
>Coding for clarity and coding for fewest number of lines are often
>conflicting goals. I strongly favor the former.
>I happen to like Left, Right, and Mid as they are, but I also like
>Python's approach of treating strings as character arrays and having
>range specification capability in subscripting. That is very similar
>to the Sinclairean syntax you noted.
>In fact, I would really like to see Gambas adopt the Python range
>specification convention for all arrays. This includes negative values
>for wraparound specifications.
>I wrote NiceTerm because I want to develop a bunch of console apps and
>I really don't like ncurses. So this isn't merely nostalgic, these are
>issues for consideration today.
>Personally, I always hated the awkward Microsoftean way to LOCATE
>things to PRINT. Two statements? Why?
>Instead, always loved the british Sinclairean way, which uses:
>PRINT AT <line>, <column>
>Simple, elegant, shorter, it has it all... and even looks more VT100
>oriented, where you put coordinate/color/etc. codes right before the
>payload. Same way to handle attributes (color, etc):
>PRINT AT 3, 10; INK 7; PAPER 0; FLASH 1; INVERSE 0; BRIGHT 1; OVER
>Could go on with replacing the also Microsoftean LEFT$, RIGHT$ and MID$
>abominations with the simpler and more readable Sinclairean syntax
>VAR$(<startIndex> TO <endIndex>)
>but enough nostalgia trip...
>----[ Gambas mailing-list is hosted by https://www.hostsharing.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User