in reply to Re^4: How would you indent this?
in thread How would you indent this?
Problem in this thread is that the OP is effectively asking multiple questions:
- how should this be best written
- how should my editor do it
- what's the bug in my editor
The are many very bad indentation and white space usage styles in use. Aside from a desire for consistency and style informed by "that is the way we always do it", I don't think many people think very much about their code writing style. My own style decisions, which I have thought about, are driven by laziness. I use white space, to the extent reasonably possible, consistently with the conventional usage in (English) written prose. That way I already have a parsing tool (my brain) that knows how to break stuff up without needing different settings packages for prose and code.
Other style decisions are made based on intelligibility, such as keeping lines short with the important stuff toward the front, minimizing nesting, keeping functions reasonably short, and so on. Look at pretty much any of my code on PerlMonks to see how that looks. Note though that my block delimiting brace usage for Perl is K&R which I avoid in other languages (I prefer Whitesmiths).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How would you indent this?
by LanX (Saint) on Mar 18, 2021 at 20:48 UTC | |
by haj (Vicar) on Mar 19, 2021 at 00:02 UTC | |
by LanX (Saint) on Mar 19, 2021 at 14:20 UTC | |
by haj (Vicar) on Mar 19, 2021 at 16:07 UTC | |
by GrandFather (Saint) on Mar 18, 2021 at 21:13 UTC | |
by LanX (Saint) on Mar 18, 2021 at 21:22 UTC | |
by GrandFather (Saint) on Mar 18, 2021 at 21:45 UTC | |
by LanX (Saint) on Mar 18, 2021 at 21:55 UTC | |
| |
by no longer just digit (Beadle) on Mar 18, 2021 at 23:04 UTC | |
by LanX (Saint) on Mar 19, 2021 at 12:48 UTC | |
by choroba (Cardinal) on Mar 19, 2021 at 12:53 UTC | |
by LanX (Saint) on Mar 19, 2021 at 12:55 UTC | |
| |
by haj (Vicar) on Mar 19, 2021 at 14:16 UTC | |
by LanX (Saint) on Mar 19, 2021 at 14:23 UTC |