Liste des Groupes | Revenir à cu shell |
On 28/08/2024 19:48, David Brown wrote:If I am adding or removing blocks (such as surrounding existing code in a new conditional), then I /have/ to change the indentation - in /any/ language. (I use indents in my assembly programming too.) Call it OCD or compulsive behaviour if you like, but I cannot consider code to be finished - even to the level of a quick compile or test - if the indentation is not correct.On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:The main problem isn't in changing the indentation of a block of code; it is in HAVING to do so because of poor language design.On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)>
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:>
>(2) You want to temporarily comment out an 'if' line so that the>
following block is unconditional. You can't do that with also
unindenting the block.
In Emacs, I have commands defined to adjust the indentation of the
selected region. Surely any other decent editor would offer the same.
Writing editor editor macros in order to work around fundamentally bad
language design is not something a programmer should have to waste time on.
>
>
I don't know about Emacs, but in most editors the way you indent a block of code is to select the lines, then press "Tab". Unindenting is "shift-Tab". Changing tabs to spaces or spaces to tabs is done by selecting "Tabs to spaces" from the Edit menu, or something equally simple and obvious. Many editor can be set to convert tabs to spaces (or vice versa) when saving files, perhaps specific to the file type (so you don't muck up your makefiles).
>
It takes a special kind of genius to be able to program, and yet still have trouble with this kind of thing.
A lesser one is having to rely on whatever varied features that 100s of different editors may have to do so.I also rely on editors being able to accept keypresses, to load and save files, and to have features like "search".
And yet another, of more significance, if that after you've indented a block, it may now merge into an adjacent block that was already at that new indent. If you later need to revert that first block back to it's original position, you'd better make sure you mark that boundary.So mark the boundary. Add a blank line. Put a comment line describing the steps of the function. You are making up problems for which you already have good solutions that you would be using in any programming language.
It is a language design issue pure and simple. Don't try and pin it on the users and make out it's due to lack of expertise with their editors. Of course we can all indent blocks; it's just an unnecessary palaver.Having made your own language(s) gives you no more and no less right to comment about features of other languages that you like or dislike.
Clearly your point of view is as a language /user/ where languages and their characteristics are an invariant that you can't do anything about, can't change, and need to work around.
But some of us devise (and, importanly, implement) languages of our own and can be more vocal about misfeatures in others.
Les messages affichés proviennent d'usenet.