News for hackers. Stuff that matters.
Re:Python with Braces by lionkor on Sunday July 07, 2024 @05:52PM (#40900741)
All significant characters should be non-empty/visible, I think that sums up why I prefer braces.
Re:Python with Braces by cardanome on Sunday July 07, 2024 @07:56PM (#40901489)
Nearly every editor has a "show whitespace" option.[0]

I still don't understand why some people don't use it. Even in non-whitespace sensitive languages, I need to see the whitespace so that I can tell if the formatting is off or not. Also make the code easier to read as I can literally see how far the code is intended instead of having to guess by amount of space.

Sure, automatic code formatting solves most of the issues but it is still good to have actual control over your whitespace.

[0] Except VIM which vexes me greatly. Might be one of the reasons whitespace sensitive languages are disliked by certain programmers?

Re:Python with Braces by chrismorgan on Monday July 08, 2024 @12:01AM (#40902508)
> Nearly every editor has a "show whitespace" option. Except VIM

Sure it does. See 'list' and 'listchars'.

Re:Python with Braces by cardanome on Monday July 08, 2024 @04:57AM (#40903766)
Which looks ugly as hell per default and I have never gotten to work quite right for me
Re:Python with Braces by PhilipRoman on Monday July 08, 2024 @05:49AM (#40904020)
I use something like this for my daily work vimrc:

    set list listchars=tab:›\ ,multispace:·
The only thing I hate about vim's treatment of indents is having separate settings for shiftwidth and tabsize.
Re:Python with Braces by makeitdouble on Sunday July 07, 2024 @06:52PM (#40901156)
It's weird to me to as a programmer to categorize space/tabs and new lines as empty or invisible.

It only makes sense if you're writing by hand on paper or designing a page, sure wherever you don't write is empty. But even then that's still visible space.

Then most language we currently use still rely on spaces in critical ways. `public function a()` and `publicfunctiona()`are not equivalent and there's no replacement character for the spaces.

Now, more power to you to like braces, same way some languages like dollar signs.

Re:Python with Braces by Culonavirus on Sunday July 07, 2024 @06:04PM (#40900831)
Only monsters prefer invisible characters having syntactic meaning, and most of them probably also like pineapple on pizza. Shameful. (j/k)
Re:Python with Braces by dajtxx on Sunday July 07, 2024 @09:15PM (#40901853)
I agree entirely with the above, not kidding.
Re:Python with Braces by TheOtherHobbes on Monday July 08, 2024 @04:41AM (#40903688)
<- Whitespace isn't invisible.
Re:Python with Braces by xigoi on Monday July 08, 2024 @05:27PM (#40909906)
If you can’t see whether a line is indented, you need to visit an eye doctor urgently.