Some publishing software/font combinations automatically render double quotes as open-close style even though the underlying char typed in was 0x42, I don't know if it is only at the format/rendering layer or if it converts the ascii quotes into corresponding unicode open-close code points in the saved file text.
Well, at least they made the reader investigate the comma operator. I guess it will become useful later in their life when they will need to fold a variadic parameter pack in order to call multiple lambda expressions.
I had to test it myself with the cout statement using an online compiler, because I wasn't sure what it would do. Every compiler I tested it on, on godbolt seems to let you do it, but only clang produces a warning (so far, by default)... The output is just whatever the first number is, because `std::cout
I can't remember the last time I bought a magazine. These day's I would expect a scam indeed as I would expect it is impossible to publish quality content like that and make any money. I would consider these the last convulsions of an already dead industry. The rise of digital media and the shift to online platforms have made it nearly impossible for traditional print magazines to survive, especially without resorting to gimmicks or aggressive monetization tactics. It's a shame because some of them used to offer genuinely insightful and well-curated content.
I've been bitten once by using ` ` instead of `endl` in my job. Our cloud app running in kubernetes was not printing the logs as they were happening. Because events were scarse, we spent days looking why our backend was not handling txns, when finally.. we replaced with endl and it all started logging OK What could I have done differently? Thanks 😊
well .. the issue there was that doesn't flush the output and writes it while std::endl does .. but when logging stuff you would prefer cause you don't want to force-flush the output everytime you add some output .. for performance reasons
2:49 you didn't even notice the "void main()" which actually should be "int main()" :D 7:48 wouldn't it be better to do ' ' instead of " " when putting a single char?
@@literallynull The C runtime may be (if that's the CRT you are referring to) but this is from the C++ standard: An implementation shall not predefine the main function. Its type shall have C++ language linkage and it shall have a declared return type of type int, but otherwise its type is implementation-defined. An implementation shall allow both - a function of () returning int and - a function of (int, pointer to pointer to char) returning int In practice, some compilers may allow void main() but it probably just ignores the void and carries on as normal. From a quick check on godbolt MSVC will ignore your void and return 0 (if I'm reading the assembly correctly) but clang and gcc do not compile and tell you error: 'main' must return 'int'.
I also love all the different versions of PI. first is auto, next is double, after that it's M_PI and at the end it's #define. You have to love the consistency and the order.
@@literallynull AFAIK the "main" function should return an int (the error code) .. for a magazine showing people how to write c++ code it is weird that in their first example it returns "void" but in all other examples they do "int main()" :D
Thinking back, I'm very grateful that compilers are mostly free nowadays, I think they were mostly payware and maybe even only accessible to enterprises back then.
Back in the 90's the best compilers were paid enterprise software, but you could still get compilers for literally every programming language for free. I used LCC-Win32 back then as it was the best free C compiler for Windows, and since I moved to Linux exclusively I've only used gcc for C and g++ for C++ as GNU's compilers are IMO the best, even above the paid enterprise compilers.
Wondering what your opinion is on the recent expulsion of a c++ standards committee member for using the wrong title in paper submitted to the standards committee?
This was ridiculous! The guy was kicked out because he used the word "question"! The word police have gotten out of control. They are doing serious harm to and jeopardizing the future of C++. I'm getting sick of these people (ie: the word police).
I think that the real problem is, how can a newcommer know which information and sources to trust - regardless of whether it is a magazine, a book or a RUclips channel ? As an expert it is fairly easy to know this channel has a very high degree of credibility and quality. There are however many RUclips channel, that teaches C++, whuch seem credible but are actually often wrong or at last suboptimal. I have a book from a very well know author (in some parts of the world), that are used in universities and sold in large numbers. There is not at single correct example in the book (main returns void). Ignoring that, the subjects and order are just bad. But how can the students know, when that is the book that the university classes are using ?
Personally, I completely agree with `using namespace std;` and would instead suggest that you just stop naming things the same as the standard library things and/or put your own same name stuff into your own namespace. I also applaud their telling people about Dev-C++ as it's a vastly under-recommended IDE choice. And I would even go so far as to suggest that languages should strive for more Unicode compatibility. I love the idea of having proper open and close quote characters which would allow for perfect nesting without escaping quotes. All the rest, totally agreed, garbage examples.
Anywhere I accidentally say 2014 in reference to the newer magazine, I meant 2024
Some publishing software/font combinations automatically render double quotes as open-close style even though the underlying char typed in was 0x42,
I don't know if it is only at the format/rendering layer or if it converts the ascii quotes into corresponding unicode open-close code points in the saved file text.
@10:10 Using endl in a loop is surely the absolute best place to use endl. Who doesn't love repeatedly calling flush?
sometimes you need to flush multiple times
Well, at least they made the reader investigate the comma operator. I guess it will become useful later in their life when they will need to fold a variadic parameter pack in order to call multiple lambda expressions.
I had to test it myself with the cout statement using an online compiler, because I wasn't sure what it would do.
Every compiler I tested it on, on godbolt seems to let you do it, but only clang produces a warning (so far, by default)...
The output is just whatever the first number is, because `std::cout
I can't remember the last time I bought a magazine.
These day's I would expect a scam indeed as I would expect it is impossible to publish quality content like that and make any money.
I would consider these the last convulsions of an already dead industry. The rise of digital media and the shift to online platforms have made it nearly impossible for traditional print magazines to survive, especially without resorting to gimmicks or aggressive monetization tactics. It's a shame because some of them used to offer genuinely insightful and well-curated content.
It's a shame indeed. I'd love descent published hardcopy to bind and store.
11:32 The comma operator goes into action, so the program outputs 10 only. I have seen one python programmer making the same mistake.
"Extra semicolons" probably refers to accidentally turning control blocks into unconditional blocks
I've been bitten once by using `
` instead of `endl` in my job. Our cloud app running in kubernetes was not printing the logs as they were happening. Because events were scarse, we spent days looking why our backend was not handling txns, when finally.. we replaced
with endl and it all started logging OK
What could I have done differently? Thanks 😊
My preference is to add a flush explicitly if that's what is needed. It makes the intent clearer.
well .. the issue there was that
doesn't flush the output and writes it while std::endl does .. but when logging stuff you would prefer
cause you don't want to force-flush the output everytime you add some output .. for performance reasons
Depending on your situation: Detect if you're running in a non-interactive shell/terminal/session and set stdout to be unbuffered.
@@sledgex9 so basically write your own logger, or use proper libs like spdlog etc.
…`
2:49 you didn't even notice the "void main()" which actually should be "int main()" :D
7:48 wouldn't it be better to do '
' instead of "
" when putting a single char?
Isn't modern CRT ok with void main?
@@literallynull
The C runtime may be (if that's the CRT you are referring to) but this is from the C++ standard:
An implementation shall not predefine the main function. Its type shall have C++ language linkage and
it shall have a declared return type of type int, but otherwise its type is implementation-defined. An
implementation shall allow both
- a function of () returning int and
- a function of (int, pointer to pointer to char) returning int
In practice, some compilers may allow void main() but it probably just ignores the void and carries on as normal. From a quick check on godbolt MSVC will ignore your void and return 0 (if I'm reading the assembly correctly) but clang and gcc do not compile and tell you error: 'main' must return 'int'.
I also love all the different versions of PI. first is auto, next is double, after that it's M_PI and at the end it's #define.
You have to love the consistency and the order.
@@literallynull AFAIK the "main" function should return an int (the error code) .. for a magazine showing people how to write c++ code it is weird that in their first example it returns "void" but in all other examples they do "int main()" :D
@@minirop i bet many different people wrote those examples, or they used some stupid AI :D
Maybe those magazines should hire less graphic designers and more programmers.
or use less AI^^
@@herrdingenz6295 In 2019? You seem to pay attention less than the graphics designers that made those screenshots too small to read.
@@mytech6779 ouch that hurt 🤒may your compiler be with you!!!
@@herrdingenz6295 🤔→↑↑←🤨
They need both and more.
@6:05 there is an auto pi = 3.14 in step 9 you say they introduce it later.
Bring back Dr. Dobbs Journal of Computer Calisthenics & Orthodontia ..... Running Light Without Overbyte!
I still have copies of C Users Journal.
Having `const` ints and `#define`d doubles smells like trying to ensure constant expressions in a C++98 program.
Thinking back, I'm very grateful that compilers are mostly free nowadays, I think they were mostly payware and maybe even only accessible to enterprises back then.
compilers have always been free
@@herrdingenz6295no they haven't. There were plenty of paid for. Some were free.
Back in the 90's the best compilers were paid enterprise software, but you could still get compilers for literally every programming language for free. I used LCC-Win32 back then as it was the best free C compiler for Windows, and since I moved to Linux exclusively I've only used gcc for C and g++ for C++ as GNU's compilers are IMO the best, even above the paid enterprise compilers.
Wondering what your opinion is on the recent expulsion of a c++ standards committee member for using the wrong title in paper submitted to the standards committee?
Is this the one who submitted an AI generated "paper" and tried to pass it off as a serious paper?
@@sledgex9 No, this did not involve AI generated papers.
This was ridiculous! The guy was kicked out because he used the word "question"! The word police have gotten out of control. They are doing serious harm to and jeopardizing the future of C++. I'm getting sick of these people (ie: the word police).
@@sledgex9If you think that AI can produce what he has, it shows why you are siding with delusional people.
That first mag feels like it was AI generated.
so was the 2nd one^^
@@herrdingenz6295 Yeah the second one looked like a reprint of the first one for a different market as they were internally identical.
@@steevf AI writing beginners guides .. lol
@@herrdingenz6295 and doing it very poorly to boot. go AI! HAHAHA! I hate AI crap.😒
Interesting
I wonder how would an IT PlayBoy look like
I think that the real problem is, how can a newcommer know which information and sources to trust - regardless of whether it is a magazine, a book or a RUclips channel ?
As an expert it is fairly easy to know this channel has a very high degree of credibility and quality.
There are however many RUclips channel, that teaches C++, whuch seem credible but are actually often wrong or at last suboptimal.
I have a book from a very well know author (in some parts of the world), that are used in universities and sold in large numbers. There is not at single correct example in the book (main returns void). Ignoring that, the subjects and order are just bad.
But how can the students know, when that is the book that the university classes are using ?
Waste of money, thanks for showing it.
forgot to mention, it is also waste of paper
SAAAR!
int i;
i = 5;
Bro💀
A
lol
Personally, I completely agree with `using namespace std;` and would instead suggest that you just stop naming things the same as the standard library things and/or put your own same name stuff into your own namespace. I also applaud their telling people about Dev-C++ as it's a vastly under-recommended IDE choice. And I would even go so far as to suggest that languages should strive for more Unicode compatibility. I love the idea of having proper open and close quote characters which would allow for perfect nesting without escaping quotes.
All the rest, totally agreed, garbage examples.
well those mags are for beginners not for big boys like you.
Beginners deserve to read good quality material, not that crap
Beginners can get confused with this shite.
@@matgat Well then explain this to them.
well .. beginners should get good learning material, right?^^
@@ohwow2074 confused on what ?