The Worst Best Practices - Jason Turner - [CppNow 2021]

  Рет қаралды 10,159

CppNow

CppNow

2 жыл бұрын

#Boost #Cpp #CppNow
Slides: cppnow.org/history/2021/talks/
CppNow Website: cppnow.org
CppNow Twitter: @CppNow
Streamed & Edited By Digital Medium Ltd: events.digital-medium.co.uk
------
Whatever you've heard about writing a book, things have changed a lot in recent years. Self publishing is easier than ever, and that brings both good and bad things. We will take look at writing and self publishing a C++ book on best practices in the 2020's; inviting and handling criticism; and the most controversial topics covered in the book, C++ Best Practices.
------
Jason Turner
Host of C++Weekly / jasonturner-lefticus , Co-host of CppCast cppcast.com, Co-creator and maintainer of the embedded scripting language for C++, ChaiScript chaiscript.com, and author and curator of the forkable coding standards document cppbestpractices.com.
------
May 1, 2022 - May 6, 2022 - Aspen, Colorado
-------------------------
---
*--*
---

Пікірлер: 21
@gtdcoder
@gtdcoder 2 жыл бұрын
The best lesson you can take from Jason Turner is the best way to learn c++ is through experimentation. Just reading books and memorizing rules will not be effective. You need to write some code, analyze it, find better/different ways to implement it.
@bonafontciel
@bonafontciel 2 жыл бұрын
My goto is 80% hands on/20% reading books
@yash1152
@yash1152 Жыл бұрын
just a clear-er: yeah, just doing either wont help, u gotta do both
@etherstrip
@etherstrip 2 жыл бұрын
Don't know if you will be reading comments, but people less likely to criticize what they bought (or generally chose to spend resources on) is a well-known example of confirmation bias. Acknowledging negative opinion would create cognitive dissonance with the spending decision. That is something the brain actively avoids.
@yash1152
@yash1152 Жыл бұрын
awesome
@AG-ld6rv
@AG-ld6rv Жыл бұрын
Respect is definitely earned. You have to figure out what someone is capable of moving forward by what they've done in the past (e.g. you know, a resume). There is a baseline of treating someone like a human, but by no means is it normal to respect every single person you meet. How would that be possible when you know nothing about them? Actively respecting someone is also different than not actively disrespecting someone. The baseline is more an active lack of disrespect than active respect. People also have to use authority in a world of specialization, because no one has the time to become an expert in everything. No one has time to read every theory by every programmer everywhere. Going back to the hiring process, you may not even get an interview for a position if you don't have enough status in the field. This is just how life has to work. People's time is limited, and they have to use basic heuristics to wade through billions of people. I'd need to see the context between that guy talking about respect and that woman, but the slides and dialogue didn't provide enough details. It's just different if a Ph.D. in physics who won the Noble Prize discusses an equation rather than some random person. It might be a fallacy to appeal to authority, but unfortunately, it's the only way to maximize the amount of time you spend not consuming falsehoods and instead learning effectively. E.g. I'd rather buy Scott Meyer's book to read instead of a brand new book with 1 review. That's life, respect is earned. Energy is directed toward those who have a high status in their field. As for the comments on your first blog post, people apply another heuristic (not authority this time) that is also a fallacy: Confusing the parts with the whole. When somebody sees one grave error, the heuristic will fire, and they're going to commit no more time to the article. It is mean, but the general idea of comments like theirs is to synchronize somebody's confidence with how much they actually know. Confidence is a good thing, but it's delusion if the things you're confident about aren't true. Perhaps, a person with 1 year of C++ experience shouldn't try to teach C++. I don't think that's such an unrealistic thing. In life, we can only have so many leaders before there are too many cooks in the kitchen, and sorry to say, everyone else will be something below "totally famous [to this group]". The instinct to act in outrage and insult there didn't come from nowhere. It's about conveying a rejection of your attempt to lead others, perhaps to better learn the entire picture of C++ before writing on it. I do think it would be better if they had directly stated, "Look, you mixed this up. Perhaps, delay trying to lead others until you have worked up more expertise", because that's more or less what those types of comments are signaling. I also think compliments on looks are all right. It takes effort to present yourself, and there is no problem is acknowledging somebody worked out and spent time/money on fashion. It's just like acknowledging somebody spent effort into any endeavor (e.g. "Nice code"). There is a certain component to looks that a person cannot change, and that might make you more unwilling to admit compliments are all right, but consider watching an NBA team play basketball, praising them for their play. There's a genetic component to that too (like height, natural levels of testosterone for more muscle building, etc.). It's the same thing with looks - there's a genetic component and a component you can work on much like pretty much everything. If you start thinking you cannot compliment someone for something partially related to how they were born, you filter out all compliments. Anything based on the mind or body, which is everything, because a person's brain and body are determined by genetics. Needless to say, things get kind of ugly when you start thinking about competition, success, failure, popularity, culture, effort, leadership, trust, authority, power structure, criticisms, ego, etc. We can all say "treat everybody exactly the same", but then we turn around and spend more time with people we know instead of complete strangers. We do favors for friends. We trust people different amounts. There are winners and losers in competition. Positivity is nice, but life can get ugly. There's no reason to dwell on it, but I wouldn't recommend turning the blinders on about it either.
@DS127
@DS127 Жыл бұрын
Respect can just refer to the default courtesy to others that most people show. It doesn't have to mean holding others in high esteem.
@yash1152
@yash1152 Жыл бұрын
1:10:26 glad to have my original conclusion confirmed about functional programming : "everything's recursion (in it)"
@yash1152
@yash1152 Жыл бұрын
49:07 > _"buyers can return for a full refund" ; _*_"and this actually becomes an important note in a moment"_* wow, didnt think it would be important
@paulfloyd9258
@paulfloyd9258 6 ай бұрын
What do you recommend people do with books if not read them through? Put them under the legs of wonky tables?
@Ryan-xq3kl
@Ryan-xq3kl 2 жыл бұрын
c++ can be hard, but I suspect when that happens it means that you are about to learn something valuable.
@JohnDlugosz
@JohnDlugosz 2 жыл бұрын
8:20 What I see in common is that a lack of proper or sufficiently rigorous nomenclature can be perceived as lack of understanding. If you can't clearly communicate, readers will think you mean something different or perceive that as a lack of precision in your understanding. I was not watching live, but my _immediate_ reaction was your use of "types of inheritance". Second, "virtual" is not a modifier to the access level. You might go on to correctly describe the resulting meaning of using these keywords in this manner, but the damage has already been done. People think you don't know what you're talking about because you did not correctly state what you know. The standards document and other technical articles would serve as a basis for the proper nomenclature (access specifiers) and words that are overly broad in common language _and_ used for specific meanings in programming languages (e.g. "types") should be avoided. I'll have to look up my own page on the same subject, which I wrote much earlier, like 1992.
@yash1152
@yash1152 Жыл бұрын
1:08:21 LAL part (learn another language) 1:08:59 never heard of Forth before - will look into it
@FalcoGer
@FalcoGer 10 ай бұрын
I think respect is earned. I don't respect random people I see on the street. Why would I? I don't care about them. I use common courtesy, don't stand in their way or annoy them and I greet them. They may be respectable, but they never did anything for me, nor will they likely ever do that. Take you for example, you are giving a talk on c++. I can respect that, because clearly you know your stuff, because otherwise you wouldn't be giving this talk. You help lots of people out with your talk. Great! If you are in a professional environment respect is implicitly earned just because you're a professional. But respect isn't inherently implicit. When I go on the street however, people tend to be unfriendly. There is a 50% chance that I get ignored or told rude things when I ask someone for the time or ask for the way to some place. And yes, I'm one of those weirdos who doesn't take their phone everywhere they go. When they do come through for me and actually look at their watch or phone to tell me the time, they earn a little respect. But what's the point, they're gone from my life 30 seconds later and I will never see them again. Maybe I got a different definition of respect from you. And respect isn't a boolean thing either. Respect is something you have for something else that you aspire to be like, something that you take seriously, something that matters for your life at large or in the moment. If you put any random person in front of me, I have no respect, they don't matter to me, they're not important. And neither am I to them. If they want something simple from me, like the time, I will provide it if I can because it doesn't involve a lot of work and because I'm polite. But I don't think that as anything to do with respect.
@JohnDlugosz
@JohnDlugosz 2 жыл бұрын
40:00 I think that beard style (chin and sides, nothing above the upper lip) is iconic for the Amash, not the Jews. The iconic Jewish hair is explained at the beginning of _Fiddler on the Roof_ as he shows the long curly tassels over the ears.
@NessieStudio
@NessieStudio 2 жыл бұрын
20:18 yet another person confusing Dutch for Danish. :sob:
@FalcoGer
@FalcoGer 10 ай бұрын
I don't see how learning haskell helps me be a better programmer in c++ or c# or python, where doing the same paradigm is not only brain melting to write and read, hard to debug, extremely slow and causes the stack to blow out and the operating system kills my executable. Recursion should be avoided when possible, unless there is a really simple and elegant solution and you know that you will not blow out the stack. I can appreciate lambdas, I can not appreciate code that my brain can't compile and limiting myself to this ridiculous concept. The processor executes instructions. I tell it what to do and in what order. Languages like haskell turn that completely on it's head. Stack based programming languages are interesting, but I also don't see the point in punishing myself to the point where even the simplest thing becomes a chore. Variable names allow accessing memory arbitrarily at any point where their name is in scope. Stack based languages just take that away. It's still possible, it just is a chore. Why would I choose less power to express myself if I can avoid it? I'm having a hard enough time wrapping my head around variadic templates, concepts and knowing what feature of the standard library exist, let alone when to use them. Like this whole type traits thing is new to me and I'm still figuring out what I can do with it. Imagine trying to print the elements of an array and you think this is the best answer: void printElements(const int* const array, const size_t size, const int index = 0) { if (index >= size) { return; } printf("%d", array[index]); printElements(array, size, index + 1); } That is ludicrous, but that's what you learn from haskell because they have no for loops. Also yes, that's c-style code, but you get the idea. And now you tell me I should learn some ludicrous language that isn't used for any practical application because it's just too hard to wrap your head around? What do I get out of that? I learn how to work with limited language features. I learn a new syntax that doesn't apply for what I really want to do. I learn paradigms that would either not work or would be stupid to do that way in the language that I'm actually trying to learn. When was the last time you have executed a binary that was written in haskell or forth? I have executed code that was written in c, c++, python, java, even javascript (for some reason people use that for client side applications now. I guess they're masochists), go, rust, perl, ruby, php, lua and even pascal and delphi and yes, even x86/amd64 ASM. Heck I even written a few 65C02 assembly programs myself. Also verilog, although that really is something special. There is some haskell code that runs in very specialized circumstances, industrial applications and webserver backends, but those examples are rare and users don't get to experience them, and most developers are probably not working on those systems. And those that do work on those systems probably don't work in haskell. To be fair, I don't care what language is used as long as the program runs. You tell the computer what you want and in what order, they all have control flow statements and instructions. I can wrap my head around them because I know how a CPU works, at least in principle, and that principle didn't change since the first CPUs were built. Never in my life have I used a piece of software that actually did something useful that was written in one of those academic languages. No word processor, no IDE, no calculator, no games, no office suite, no operating system, no drivers, no chat program, no nothing. And the reason for that? It's just not practical or it's needlessly hard to do. Clearly the language has failed to be anything but a study example. Why should I care about languages that have no real world use because they're complicated, clunky, hard to use, hard to read, hard to learn and limited in power? And by power I don't mean computability, but ways to do common tasks with as few as possible, meaningful tokens. Here is the equation, what's the solution. That part is easy in c++. Here is the solution, what are the inputs that produce it. That's a math problem. But there are state solvers like Z3 that will give you the answer, even in c++ or python. Here is a solution and here is the algorithm that produced it, what are the inputs. Can prolog do that? I don't know. Here is an algorithm and I don't know the solution for the inputs. But I know a valid output solution has these constraints. Go ahead and produce a valid inputs for me. Can prolog do that? I mean state solvers are magic to me. It's just nuts that you can shove an algorithm into the thing and it solves it without brute force but by execution path traversal and you just tell it, if you land here, you are wrong.
@shoreshism
@shoreshism 2 жыл бұрын
waste of time... pub talk while drinking beer
@not_ever
@not_ever 2 жыл бұрын
Just a heads up, that the link in the description to the cppnow website is being flagged as a potential attack site because of the www. by Firefox: Web sites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for www.cppnow.org. The certificate is only valid for cppnow.org. Error code: SSL_ERROR_BAD_CERT_DOMAIN You may wish to update it drop the www.
@BoostCon
@BoostCon 2 жыл бұрын
Thank you very much for bringing this to our attention! We are pleased to say that the problem has now been fixed.
Don't constexpr All the Things - David Sankel [CppNow 2021]
1:00:47
C++ Weekly - Ep 268 - Top 10 C++ Resources You MUST Know About!
27:45
C++ Weekly With Jason Turner
Рет қаралды 36 М.
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,1 МЛН
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 26 МЛН
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 57 МЛН
CppCon 2019: Jason Turner “The Best Parts of C++"
58:36
CppCon
Рет қаралды 89 М.
CMake + Conan: 3 Years Later - Mateusz Pusz - [CppNow 2021]
1:33:52
Can Light be Black? Mind-Blowing Dark Light Experiments!
7:08
The Action Lab
Рет қаралды 12 МЛН
CppCon 2018: Jason Turner “Applied Best Practices”
1:03:19
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 2,8 МЛН
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,6 МЛН