Lightning Talk: Whitespace: A Humorous Short Talk - Dan Curran - CppCon 2023
ฝัง
- เผยแพร่เมื่อ 23 เม.ย. 2024
- cppcon.org/
---
Lightning Talk: Whitespace: A Humorous Short Talk - Dan Curran - CppCon 2023
github.com/CppCon/CppCon2023
i want a holy war over whitespace. the most productive discussion.
---
Dan Curran
working in finance. i like to experiment in language design, and implement proposals for c++ in clang. sometimes.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
TH-cam Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp
This is my preferred style as well
Voice of reason.
I hate that clang-format default to push everything on the right. There are few options to push things back to the left, but it's several options, and they do not cover every cases. There should be a single option for this preference.
Between tabs and spaces, one is obviously superior. So obviously superior that I won’t say which one 😁
Nice talk :) I do agree with most, except the return type, that is where you pivoted from super hero to villian ;)
5:26
.clang-format where?
I agree.
Okay, after a few years of working as a (clean-code-loving) C++ developer, watching all of these crazy formatting standards in various code bases (because it's standard LLVM/Google/... style, dude) and suffering from not being able to even configure clang-format to obtain such a nice, clean, intuitive formatting I've started to think that something is seriously wrong with my code esthetics. Thanks for telling me that I'm not the only one 😆
Putting the toilet roll open edge to the back is a perverse as sitting on the toilet while facing the tank/cistern. I mean, why would you do it??
If we're following the patent specification for toilet roll use, surely we should use K&R + C++ standards' formatting? ;)
Kevlin Henney has an excellent talk from 2016 on this with some discussion empirically determining what's more readable:
There are only two hard problems in CS:
I do make sure things end on the same indent as the start, it just makes sense, the return type on its own line was a bit much but I would accept it, however the toilet roll in my house will always be at the back :P
120 characters per line and I'll agree. All on one line is better then what clang does but if EVERYTHING is all on one line bwcause you only have 80 characters per line then it gets cumbersome to scroll.
Not sure if I agree that it’s more readable.
Mate, you bit off more than you could chew, but I like the idea. For anyone who wants to learn more about this subject: Kevlin Henney has done a few great talks about this where he discusses "lines of attention", visual blocking, and so on; focusing on the experience of the reader and educating the audience about common elements of design. Explaining not only what matters, but how and why. Whitespace and style matter more than people think.