Комментарии:
wtf is this You Tube..I had to click the You Tube icon again and again to get this one vid and an add and Ive already Dont Recommened this video before that I dont want to watch...I dont want to watch it...its boring...why repeat it so many times?..its the only video on the screen for me to watch...you have reduced the amount of vids I see down to 0-4 vids and most are boring or not in English or have repeated and repeated and repeated or its evil sick content..when can I watch you tube with a full screen of videos...and its not my fault you have boring or evil content..
ОтветитьIn the earliest c++ you could write to the this ptr when you wanted to do in place new….
ОтветитьGreat
ОтветитьNo.
ОтветитьF@ck you, JAVA and JAVASCRIPT are the same ... F@CK YOU ... :)
ОтветитьWow. Your title is always legit 😮
ОтветитьMaybe you like to make this session with D? Or Objektive -C?
ОтветитьAs long as I can avoid C++ I will. And I can't see a change to needing it in my forseeable future.
Ответитьno
Ответитьone of the big issues you gonna have with C++ variadic templates is the error messages lol, that's why i think instead you can have parameter pack of Task*... args
ОтветитьI personally code c++, more or less in a C like way, using C++ ism's where they make sense and my life easy or where C ism's aren't supported, not cout/cin or streams either, printf all the way. I follow what is called unorthodox c++.
I'm not saying is the absolute best way to code c++, is the way I like to code and the way that makes me happy and more productive and that is it.
haha not a fan of python myself but you joke ranting about mentioning "a toy language like python when discussing system languages" just remined me of John Carmack who was asked what programming language he currently loves the most and he responded with python lol :D
ОтветитьTo be fair to Bjarne, early C++ was crosscompiled to c so it would literally be a superset and full interop and then it stuck haha
ОтветитьScript tcl Bebe has got your back.
ОтветитьI guess the next logical step is to define a pointer to another class that is kept in the application state that contains those function pointers instead of the built-in vtable, and then leverage C++ shenanigans to make that easier?
ОтветитьA lot of these academic types like Bjarne simply rub elbows with the right people and network to get speaking gigs for huge payouts like politicians do. I guarantee he makes at least tens of thousands a year, probably thousands minimum, just to show up and speak at places and do conferences and whatnot.
ОтветитьOne thing why people talk about C as "old" and "hard" just because libc is very old, full of bugs and most of the times inconvinient. I personally reference to it as "undefined code with global states library". Thankfully POSIX does include functions where you can provide a pointer to an instance of the state, thus having ability to do several things at the same time, but it is not everything at it honestly should be the default.
If Python would not had a lot of predefined classes for strings and stuff it would be very annoying language to write in. Standart library of the language is the language these days.
Oh no. Does he find out that vtables aren't FFI safe in this video?
ОтветитьWhats this Question? A good language has a string class. Case closed.
Ответитьi started C++(11) not too log ago, i already knew some ansi C and dabbled in arduino C
i think half of my c++ shit is just old C library shit at this point lol
i do use strings here and there, but there's plenty of c_str() and char* still going on :D
i don't use classes either, i'm just using good old structs and pointers, wrapped in namespaces
i do like the namespaces paradigm a lot for organizing my codebase, so the namespaces kind of act as (strictly public) " classes".
right now i'm working on a 2d (cpu only) engine with SDL2, i guess i'm a bit of an odd one out still using mingw32-64 at this point
i just started diving into pthreads yesterday and i'm making gigantic strides in performance now i can tap into my entire cpu :D
i'm really having a blast so far, i do have my C background so everything comes pretty easy to me and most has been a breeze and i'm pretty fucking chuffed with myself lol
Yes.
ОтветитьYou missed out linking the source in the description today, i dont know if that was intentional or not. I personally find it extremely valuable, i have learnt so much from being able to follow along with your process by video and consulting your source when I mess up any details or want a rough idea of conventions to follow. Obviously, I don't expect this of you but if this was a slip-up, here's your opportunity to fix it.
Anyway, love your content. Thanks again
My rule is simple.
Write C in C++ and if things needs to be bananas, use C++ features. I still don't write classes unless I HAVE to. I don't use the new C++ std library functions unless I HAVE to.
C++ can do C but C can't do C++
ОтветитьI'm a C enthusiast and the only thing I miss is a standard implementation of the elementary data structures like lists (stack, queue, deque, list), priority queues, sets and symbol tables (red-black trees and hashtables).
ОтветитьNot sure if you'll read, but to use `std::vector<std::unique_ptr<Task>>`, your plug_update function should call `std::make_unique<Task>(Move_Vec2(...))` for every new task, instead of `new Move_Vec2(...)`. The cleanest way is to then use fold expressions and `push_back` or `emplace_back`
ОтветитьI think the proper solution for the state preservation would be a custom allocator that keeps tracks of allocations like React hooks work: when reloading, the allocator just hands back out the same allocations in the same order so your state is preserved. Then you also get to detect when the data layout changes and force a full reload if the number of allocations change or the requested size changes. It still would break the objects though, so you'd also need to only do that for the state and have a separate struct just for state so you don't overwrite the vtable pointer.
Fundamentally hot reloading native code without breaking pointers is hard.
im not 100% sure i assume it crashes because you unload the dynamic library and thus the pointer to the vtable is invalidated (sorry i didn't fully watch the previous episodes) to update to it i think the simplest way would be to create a copy of each element but there are 2 problems
1 there are no virtual copy constructors
2 you cannot use polymorphism because the vtable is outdated at minimum
now the best way i can think of solving this is creating a copy factory function that auto registers new classes using CRTP and identifies types using typeid but im not sure if it would work i will try to implement it by the next vod and report about it
Am learning cpp hope it helps😅
ОтветитьShort answer is yes
ОтветитьI just like writing code in C. That is all. I make no claims about superiority. I'm a guy who programs for pleasure. 😏
Ответитьyeah yeah, Java is just a subset of JavaScript
ОтветитьOh god not Qt, anything but that, we have a legacy app at work on Qt, I have no fucking clue what it does or how it does it and touching it terrifies me everytime
ОтветитьI recently had to model C++ "inheritance" into Rust, so that I could "make" C++ structures in Rust for patching Elden Ring.
It was pretty cool! There's some pain points in Rust. Mostly just stuff that has to be done manually. I could imagine C is even more painful in that regard.
Me watching this as a python script kiddie 👁️👄👁️🍼
ОтветитьIt's amazing how much effort you can exert if you don't want to write a few lines of CSS to achieve the same goal.
Great video!
The reason behind inability to compile program with std::vector<std::unique_ptr<Task>> is an extremely messy design of initializer_list in C++ which poorly supports move-only types. And as far as I know C++ standardisation commitee explicitly refused to fix it.
ОтветитьI work on a project with a C engine and C++ plugins. If you don't care about what happens with exceptions/signals it's fine but shit gets messy when it has to cross from one runtime to the other and back.
ОтветитьThere is an useful technique called CRTP - static polymorphism. It allows you to write compact OOP code and doesn't raise problem with func pointers invalidation.
Ответить