Hacker News new | past | comments | ask | show | jobs | submit login

I definitely agree that Black (which I love) is pretty overrated in the number of problems people think it will solve for them. But I just don't get this view

> removes any kind of personality from the code

What kind of personality comes from things like pefering " over '; having tabs over spaces; having n spaces between class methods?

For me, those things are essentially meaningless but nice to have consistency on. Code personality, and a large part of readability comes from things like: - variable / class names - functional vs oop problem solving - type use - custom data structures or not etc

None of those have are locked down or touched by a lint tool like Black. Use it or don't, but you'll have plenty of personality in your code either way.




That's not the interesting "personality". I think the formatting tools bring in something completely different: code layouts that you would never write by hand.

I don't like that. Code should be a transparent interface, you write something and it becomes part of the program. With code formatting it becomes, you input something into the source code, you transform it with the tool, and then it's done. We sort of lose the brain-hand-program connection.

As an example I randomly found this code snippet of rust imports. To reproduce this by hand would be like writing JSON by hand - I'm referring to the nesting, bracketing and sorting. This is the lack of personality: no longer writing code by hand, but with tools.

    use core::fmt;
    use std::{
        alloc::{GlobalAlloc, System},
        cell::UnsafeCell,
        cmp,
        fmt::Write,
        marker::PhantomData,
        sync::{
            atomic::{AtomicBool, Ordering},
            Mutex,
        },
        time::Duration,
    };

    use serde::{
        de::{self, SeqAccess, Visitor},
        Deserialize, Deserializer, Serialize,
    };


"Consistency is the most important" seems to be an axiom...

"having n spaces between class methods" is definitely *not* meaningless. It affects code readability and black has very opionated (and often inappropriate) ideas about what counts as "readable" whitespace. When you raise that problem with people, they always say "well too bad, you should write shorter functions instead", which just introduces another layer of opinionatedness.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: