4 ms·
I mean this isn't true, formatting is the most trivial part. And so many languages have an opinionated formatter these days (e.g. Black)
by zero_shift 2mo ago
I mean this isn't true, formatting is the most trivial part. And so many languages have an opinionated formatter these days (e.g. Black)
- pmarreck 2mo agowhat is "Black"? (For hopefully obvious reasons, I couldn't find results with google, lol)
- mholm 2mo agoBlack for Python https://github.com/psf/black https://github.com/psf/black
- rsyring 2mo agoBut you're probably better off with Ruff these days: https://docs.astral.sh/ruff/ https://docs.astral.sh/ruff/ Similar to black but faster, written in Rust, by the same team who created uv.
- marcus_holmes 2mo agoSo... A: not trivial. And B: not part of the language. > mean this isn't true, formatting is the most trivial part. And so many languages have an opinionated formatter these days (e.g. Black) I don't think this is correct
- pmarreck 2mo agoB: not part of the language. 1) Some would call this a perk. 2) When your tooling around a language works better when it's not actually written in the language... That should tell you something. And yet...
- frollogaston 2mo agoThis back-and-forth is a good example of why Go benefits from having a centralized linter. And uv isn't the official Python package manager even though it should be.
- maleldil 2mo agoI don't get why this is a big issue. This isn't some recurrent decision to be made. It's something a lead decides once and the project follows. That's it. Many companies have style guides anyway (eg Google[1]); the choice of a formatter is much simpler. [1] https://google.github.io/styleguide/go/ https://google.github.io/styleguide/go/
- frollogaston 2mo agoBecause at some point you have to interact with some other team or project that made a different decision. And whatever you picked might fall out of favor and lose support. There's already a graveyard of Python type linters, including Google's pytype. Especially the uv thing. You clone some non-uv git repo that has no pyproject.toml and you don't know what to install. Maybe has requirements.txt but it's partially wrong.
- Dylan16807 2mo agoWhat did you search? If I do the simplest possible thing that isn't a single word, by highlighting "opinionated formatter these days (e.g. Black)" and clicking search, I get the right result. I also get the right result for black formatter, and I get the right result if I yolo the entire comment as my search.
- pmarreck 2mo agoAh, it's Python. Python is gross. That explains why I couldn't find it. /shrug
- overfeed 2mo ago>> ...there is no debate... > ...And so many languages have an opinionated formatter these days The crux of gp's post is for Go, there is no debate as 'go fmt' is the only one that matters. Black is great, but some people prefer Ruff, leading to ...debates about which formatter the team/org should use. Go's batteries-included philosophy makes those discussions moot on so many levels beyond formatting.
- ciupicri 2mo agoAs if projects haven't used to have a coding style. What's so hard in saying that code should be formatted with Black, yapf, ruff etc, beats me.
- badrequest 2mo agoLiterally within this thread someone has already suggested using ruff instead of Black and nobody here are colleagues.
- the_sleaze_ 2mo agoIt's a silly argument and the lowest form of bike-shedding on the level of tabs vs commas. People with no other substantive contributions use formatting as a beard. The first one to choose it (whatever it happens to be) wins and that's the end of it. If it isn't the end of it you've got a talent issue.
- overfeed 2mo ago> It's a silly argument and the lowest form of bike-shedding on the level of tabs vs commas Guess what other low-level bike-shedding argument 'go fmt' obviates? That's right - tabs vs spaces! > If it isn't the end of it you've got a talent issue. I know you meant this as a slur, but the implication is Go works better than other languages for those who have what you call "a talent issue"
- 2mo ago
- Cthulhu_ 2mo agoAnd I'm thankful that they do, but also, Go was one of the first languages that really pushed for a standard code format - I'm actually surprised this wasn't a thing before. Or I suppose there was, like Checkstyle for Java or ESLint for JS, but they were not strongly opinionated or pushed by the core team.