C++ Mythbusting with Victor and Jason

preview_player
Показать описание
☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟

Victor And Jason Bust Some C++ Myths Live!

T-SHIRTS AVAILABLE!

WANT MORE JASON?

SUPPORT THE CHANNEL

GET INVOLVED

JASON'S BOOKS

► C++23 Best Practices

► C++ Best Practices

JASON'S PUZZLE BOOKS

► Object Lifetime Puzzlers Book 1

► Object Lifetime Puzzlers Book 2

► Object Lifetime Puzzlers Book 3

► Copy and Reference Puzzlers Book 1

► Copy and Reference Puzzlers Book 2

► Copy and Reference Puzzlers Book 3

► OpCode Puzzlers Book 1


RECOMMENDED BOOKS

AWESOME PROJECTS

O'Reilly VIDEOS

Рекомендации по теме
Комментарии
Автор

Be sure to follow Victor on Twitter @ciura_victor

cppweekly
Автор

I love seeing people with 10/20+ years experience still messing around and... messing up. It gives me hope that maybe some day, I too will mess up with such grace and so much knowledge in the back of my head :D I'm on much lower level and more in C, rather than C++ but I'll get there, with your help maybe sooner! :) Thanks for this videos, great guest, great topic, awesome channel :)

paryzfilip
Автор

So glad Jason got back into streaming. I am glad to see Victor guesting!

Sebanisu
Автор

Jason, your book is awesome. I got an opportunity to work on a C++ project (I am(was :P)) primarily a python dev. I had studied C++ in high school and had a couple of classes in college that had C++, but I'm basically restarting from scratch. However I am loving the language now, although I am a noob. It's so much more fun and powerful than python

blazkowicz
Автор

After listing to the little spiel on "turn on all kinds of dumb warnings!" around 51:00, hearing "If you're really pedantic, maybe add -Wshadow" seems incongruous. I don't see -Wshadow as an especially pedantic warning. Sometimes when writing new code you end up with lots of nested loops, many of which are either factored out or extracted into functions later. -Wshadow helps prevent the initial mess from having unintended behavior and makes it easier to clean up later since you know which variables go to which loops.

joeedh
Автор

What a format! Thanks for the superb content!

Terudon
Автор

This was amazing, I hope you get to making more like these!

kagonkhan
Автор

Standard library <regex> is actually not that bad if you take the time to learn how to use it, but I think many people simply do not bother. For example, it is important to always make your unchanging regexes static const, as this avoids repeated costly construction at runtime. Making them static const in the global scope of the *.cpp file can also relocate the regex construction to program initialization, avoiding thread guards around first-use construction, though I understand if you might be against global variables. Furthermore, take the time to learn the match_flag_type regex_constants, as the default behavior of a regex_match or regex_search might be doing more than you need it to, slowing down performance. I really wish the std::string_view proposal from 2019 would get approved already, but in the meantime, it is not at all hard to write a simple helper function to transform the std::pair of iterators which a std::sub_match derives from into a std::string_view, or use std::from_chars to convert a std::sub_match to an integer in the same way. Finally, in my experience, libc++'s std::regex implementation is considerably faster than libstdc++'s.

Minty_Meeo
Автор

setters allow you to add invariants in the future without changing the API surface.

Spongman
Автор

"The thing is std::move is not an actual move; it's just a cast to an rvalue reference."

I wonder if std::rvalue() would have been a more precise naming choice...

andrez
Автор

This video explains part of reason after I tried C#, there is no going back. I am not saying I am no longer using C++, I am still using it. But it's the different level of comfortable.

notyetdecided
Автор

CTRE is the way to go for doing with beforehand patterns. Instead of standard regex, what one should do when dealing with runtime patterns?

JohnWilliams-gyyc
Автор

*C++ Regex Tutorial: Regular Expressions In C++ With Examples*

*Regex tutorial — A quick cheatsheet by examples*

from above video:

#include <iostream>
#include <regex>

int main(){
std::string str("x = 5");

// RegExp can be:
// (\S+)\s*=\s*(\S+)
// i prefer
// ^(\S+?)\s*?=\s*?(\S+?)$
const std::regex
std::smatch smatch;

if (std::regex_match(str, smatch, r)) {
std::cout
<< "The first sub_match is the whole string; the next \n"
<< "sub_match is the first parenthesized expression.\n\n";
// The first sub_match is the whole string; the next
// sub_match is the first parenthesized expression.

std::cout << smatch[0].str() << "\n\n";
std::cout << smatch[1].str() << "\n";
std::cout << smatch[2].str() << "\n";
}

std::cout << "\nEND" << std::endl;
return 0;
}

zegarek
Автор

I had a problem, I used a regex. Now I have 2 problems

kwkfortythree
Автор

The vector at the end should need to use double bracers to be initializer_list...

verylongtrain
Автор

chaining for optional like that seems weird and totally unnecessary.

SlentStrm
Автор

I recently discovered that there is way to have moveable initialization list:
```

template<typename T, int I>
struct S {
T table [I];
S(T (&&r)[I])
{
auto f = table;
for (auto&& i : r)
{
*(f++) = std::move(i);
}
}
};
S a = {{1, 2, 3, 5}};
S b = {{std::make_unique<int>(), std::make_unique<int>()}};
```

von_nobody
Автор

I love regex, no matter the programming language

Mutombo
Автор

Great discussion I really like the content but the amount of ads (every 3-4 minutes) makes this really hard to watch

haraldscheirich
Автор

Mythbusting - people from Eastern Europe are often good at math and programming.
Hmm.... well, looks like they *are* 🤣😂🤣

jaybee