Back to Basics: The Structure of a Program - Bob Steagall - CppCon 2020

  Рет қаралды 53,919

CppCon

CppCon

Күн бұрын

Пікірлер: 29
@wagsman9999
@wagsman9999 3 жыл бұрын
As a newbie to c++ I’m finding these “back to basics” lectures very informative
@CppCon
@CppCon 3 жыл бұрын
Great to hear!
@carterthaxton
@carterthaxton 4 жыл бұрын
Thanks to Bob Steagall for this. At 26:20, there's an example that shows how large the intermediate translation unit would be for separate main.cpp and hello.cpp files. The size of main.i would be considerably smaller by not #including in hello.h, and only in hello.cpp. I think it's pretty important to not include headers from other headers unless the declarations are necessary for the interface. In this case, is only needed for the implementation of hello.cpp, and not the interface exposed by hello.h. This example could have been used to clarify this important difference.
@davidfong
@davidfong 2 жыл бұрын
That's a good point. As an addition to that, if the header needs to define a function that takes a stream reference, the header can #include , which just has forward declarations of the things defined in .
@tourdesource
@tourdesource Жыл бұрын
@@davidfong Thanks for the tip!
@chadmcintire4128
@chadmcintire4128 4 жыл бұрын
Your talks are just oozing with good information. Thank you very much for your work Bob!
@mauriziocarli1973
@mauriziocarli1973 Жыл бұрын
Great talk... a lot of 'basic' topics very well explained... by the way: topics like 'declaration vs definition', 'linkage types,' 'one definition rules' and so on, could also be considered 'basic' as the same title specify, but not so easy to find on an online course or tutorial... so it's worth watching, definitely... thanks Bob
@JoeBurnett
@JoeBurnett 4 жыл бұрын
Thank you for taking the time to present this.
@sparschlumpf
@sparschlumpf 4 жыл бұрын
Around minute 39, the linkage of g is never mentioned, even though it feels important to mention that it has *external* linkage, even if there is no header for it: it is neither static nor in an anonymous namespace nor inline. Having a second compilation unit with another g like that will have multiple definitions upon linking. This is kind of implicitly explained later in ODR rules with example 2, but seeing this is a very common issue it feels important to highlight.
@TheVigi99
@TheVigi99 4 жыл бұрын
Back to basics is always my favourite!
@Dazza_Doo
@Dazza_Doo 5 ай бұрын
The Basics talks have nothing basic about it, and that's what we need. This information is needed. Well Done. I would like to see in the basics series: Zero cost abstractions for bare metal hardware. For example we don't want to use too many of any Virtuals, Dynamic Memory allocations. What can we use?
@bsuperbrain
@bsuperbrain 4 жыл бұрын
Very clear and concise talk.
@WilhelmDrake
@WilhelmDrake 2 жыл бұрын
Thank you Mr. Bob. Great talk.
@peterjohnson2752
@peterjohnson2752 4 жыл бұрын
Wonderful presentation! Thanks for your work
@АндрейБорисов-и4о
@АндрейБорисов-и4о Жыл бұрын
Thanks Bob! Very good and informative video lesson!
@kamilziemian995
@kamilziemian995 2 жыл бұрын
Great talk on very important, and very underappreciated, topic.
@CppCon
@CppCon 2 жыл бұрын
Thank you for your comment, which is much appreciated!
@kuleden_
@kuleden_ 4 жыл бұрын
Bir programın yapısının nelerden oluştuğunu, derlenen programlama dilleri (C ve C++) ile ilgili temel konuları anlatan harika bir sunum. Özellikle programlamayı ilk kez #Python dili öğrenerek başlayan ve ileride C/C++ dillerini öğrenmek isteyenler için faydalı bilgiler içeriyor
@blkbunta
@blkbunta 2 жыл бұрын
thank you very much. it was very informative 🙂
@VictorPeraltaGomez
@VictorPeraltaGomez 4 жыл бұрын
Great presentation!👏🏻
@proz0239
@proz0239 4 жыл бұрын
Great talk!
@philmsproduction
@philmsproduction 4 жыл бұрын
32:00 shouldn't we remove the extern keyword for the actual definition?
@frydac
@frydac 3 жыл бұрын
you can, but don't have to, however I would argue you never want to do this with a mutable global variable, mutable global state has many drawbacks, but if you decide to use global state anyway (there are legit usecases) then use a meyers singleton. However if you have const global state and dont want a copy in every translation unit where you want to use that state, you can (have to) define them in a .cpp file something like (or use that singleton): extern const type name{ctor args}; because const makes the object have internal linkage, and by adding extern you can override this to have external linkage anyway and you'll be able to refer to it from other translation units. And be aware that having a copy of the global state in several places can be faster than not having a copy (e.g maybe less cache misses), or not.. you'd have to measure (I think, I never have measure this usecase, it seems probable to me with my current experience/knowledge level).
@ElementaryWatson-123
@ElementaryWatson-123 3 жыл бұрын
Will we ever see the standardization of dynamic linking? The differences between .so in Linux and .dll in Windows adding a lot of headache.
@TienHuynh5312
@TienHuynh5312 4 жыл бұрын
thanks.
@ajit78910
@ajit78910 4 жыл бұрын
Thanks 💐🙏
@Moriadin
@Moriadin 3 жыл бұрын
What an abomination of a language...
@scahsaint6249
@scahsaint6249 2 жыл бұрын
What do you recommend?
@SisypheanRoller
@SisypheanRoller 2 жыл бұрын
Most of the time you're using c++, you don't even need to think about all these language lawyer ideas. All you need is your compiler, linker, and runtime (ld.so).
Back to Basics: Class Layout - Stephen Dewhurst - CppCon 2020
1:00:27
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 51 МЛН
why do header files even exist?
10:53
Low Level
Рет қаралды 439 М.
Back to Basics: Concurrency - Arthur O'Dwyer - CppCon 2020
1:04:28
Back to Basics: Classic STL - Bob Steagall - CppCon 2021
1:01:31
Why Can't We Make Simple Software? - Peter van Hardenberg
41:34
Handmade Cities
Рет қаралды 152 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 841 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 334 М.
Back to Basics: Pointers and Memory - Ben Saks - CppCon 2020
1:00:56