- 646
- 1 847 293
Mike Shah
United States
Registrace 6. 11. 2016
Teaching computer Science, primarily Modern C++, C, DLang, games, and computer graphics programming
I'm a teaching professor and Senior 3D Graphics Engineer who has worked in industry at various games and graphics companies.
Access Full Courses: courses.mshah.io
Free Community Forum: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz
I'm a teaching professor and Senior 3D Graphics Engineer who has worked in industry at various games and graphics companies.
Access Full Courses: courses.mshah.io
Free Community Forum: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz
[Dlang Episode 98] D Language - static assert - catch errors at compile-time
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html
►Find full courses on: courses.mshah.io/
►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin
►Lesson Description: In this lesson I show you how to use asserts, but this time at compile time with 'static assert'. 'static asserts' are yet another key tool for enforcing a 'contract' of how our program executes, but this time at compile-time. These are again tools for the developers who are compiling software to try to catch pesky bugs or situations for any computation at compile-time -- the best time to catch a bug! As always, share your interesting use cases with the community in the discussion below!
►Please like and subscribe to help the channel!
►CZcams Channel: czcams.com/users/MikeShah
►Join our free community: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz
►Find full courses on: courses.mshah.io/
►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin
►Lesson Description: In this lesson I show you how to use asserts, but this time at compile time with 'static assert'. 'static asserts' are yet another key tool for enforcing a 'contract' of how our program executes, but this time at compile-time. These are again tools for the developers who are compiling software to try to catch pesky bugs or situations for any computation at compile-time -- the best time to catch a bug! As always, share your interesting use cases with the community in the discussion below!
►Please like and subscribe to help the channel!
►CZcams Channel: czcams.com/users/MikeShah
►Join our free community: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz
zhlédnutí: 151
Video
[Dlang Episode 97] D Language - assert
zhlédnutí 187Před 17 hodinami
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show you how to use assert expressions. 'asserts' are a key tool for testing the correctness of your program. However, asserts are really tools for dev...
[Dlang Episode 96] D Language - Typedef and TypedefType - Type Constructors
zhlédnutí 133Před dnem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show how to use the 'TypeDef' type constructor from the std.typecons library. This can be a more secure way to work with types that have the same under...
[Dlang Episode 95] D Language - ‘is’ expression (is keyword)
zhlédnutí 152Před dnem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show a new keyword that we have not yet highlighted 'is'. IsExpressions can be very useful for checking if two of the underlying types are equivalent, ...
OpenGL [Episode 34] GL_FLOAT enum vs GLfloat type bug fix
zhlédnutí 361Před 14 dny
►Full OpenGL Series Playlist: czcams.com/play/PLvv0ScY6vfd9zlZkIIqGDeG5TUWswkMox.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show go back and do a few bug fixes on our original code, as I had made a mistake with the GLenum versus the OpenGL type. We tend to use the OpenGL ty...
[Dlang Episode 94] D Language - Templates - Part 7 of n - Template Constraints
zhlédnutí 152Před 14 dny
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show you the idea of a template constraint (known as a concept in C ) that allows you to constrain what functions, structs, classes (or anything in a t...
[Programming Languages] Episode 23 - First Impression - Erlang
zhlédnutí 681Před 21 dnem
►Full First Look Series Playlist: czcams.com/play/PLvv0ScY6vfd-5hJ47DNAOKKLLIHjz1Tzq.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at a language known for creating highly concurrent systems Erlang! Erlang is a language co-created by the late Joe Armstron...
[Dlang Episode 93] D Language - Compile-Time Programming - Part 4 of n - AliasSeq and aliasSeqOf
zhlédnutí 219Před 28 dny
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I introduce the idea of a compile-time sequence often known as a compile-time tuple or otherwise named as an AliasSeq in the language (among many other n...
[Dlang Episode 92] D Language - Compile-Time Programming - Part 3 of n - Variadic Template structs
zhlédnutí 220Před měsícem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show you how to make use of several of the topics that we have been discussing in regards to compile-time programming. We'll take the idea of a variadi...
[Dlang Episode 91] D Language - Templates - Part 6 of n - Template Mixins
zhlédnutí 181Před měsícem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I introduce the idea of a 'template mixin' a powerful feature that combines what we have learned about in regards to both templates and mixins. Templates...
[Dlang Episode 90] D Language - Compile-Time Programming - Part 2 of n - String Mixins
zhlédnutí 171Před měsícem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I introduce the idea of a mixin specifically a 'string mixin'. This is a simple but powerful feature of the D programming language, which can be used wit...
[Dlang Episode 89] D Language - Compile-Time Programming - Part 1 of n
zhlédnutí 265Před měsícem
►Full DLang Series Playlist: czcams.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I introduce an awesome capability of the D programming language, which is compile-time programming or otherwise the ability to evaluate code at compile-t...
[Programming Languages] Episode 22 - First Impression - lua
zhlédnutí 1,3KPřed měsícem
►Full First Look Series Playlist: czcams.com/play/PLvv0ScY6vfd-5hJ47DNAOKKLLIHjz1Tzq.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at an extremely popular scripting language Lua! Lua is a dynamically typed language that is meant typically for embedding i...
C++ STL numeric - exclusive_scan, inclusive_scan | Modern Cpp Series Ep. 186
zhlédnutí 530Před měsícem
►Full C Series Playlist: czcams.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at std::inclusive_scan and std::exclusive_scan which are similar to the previous std::partial_sum variations that we have seen. The ...
How to Improve your Github Readme [Mike's Advice]
zhlédnutí 570Před měsícem
►Full Series Playlist: czcams.com/play/PLvv0ScY6vfd-kxPfRttOVYkyM2xal-x0U.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: czcams.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this video I provide a few thoughts on how to improve your github readme page. Now I fully understand not all projects are meant for consumption, but in the inst...
[Dlang Episode 88] D Language - Templates - Part 5 of n - Variadic Templates (i.e. Seq Parameters)
zhlédnutí 205Před měsícem
[Dlang Episode 88] D Language - Templates - Part 5 of n - Variadic Templates (i.e. Seq Parameters)
[Dlang Episode 87] D Language - Templates - Part 4 of n - Struct Templates
zhlédnutí 167Před měsícem
[Dlang Episode 87] D Language - Templates - Part 4 of n - Struct Templates
[Dlang Episode 86] D Language - Templates - Part 3 of n - value parameters, and alias and typeof
zhlédnutí 151Před měsícem
[Dlang Episode 86] D Language - Templates - Part 3 of n - value parameters, and alias and typeof
C++ STL numeric - transform_reduce | Modern Cpp Series Ep. 185
zhlédnutí 457Před měsícem
C STL numeric - transform_reduce | Modern Cpp Series Ep. 185
[Dlang Episode 85] D Language - Function Templates - Part 2 of n - Generic Programming
zhlédnutí 198Před měsícem
[Dlang Episode 85] D Language - Function Templates - Part 2 of n - Generic Programming
C++ STL numeric - reduce (parallel fold) | Modern Cpp Series Ep. 184
zhlédnutí 456Před měsícem
C STL numeric - reduce (parallel fold) | Modern Cpp Series Ep. 184
C++ STL numeric - std::accumulate (fold) | Modern Cpp Series Ep. 183
zhlédnutí 540Před 2 měsíci
C STL numeric - std::accumulate (fold) | Modern Cpp Series Ep. 183
Component Pattern in C++ - Part 4 of n - Component Pattern, Data Oriented Design Discussion
zhlédnutí 497Před 2 měsíci
Component Pattern in C - Part 4 of n - Component Pattern, Data Oriented Design Discussion
Component Pattern in C++ - Part 3 of n - Component Pattern Implementation
zhlédnutí 536Před 2 měsíci
Component Pattern in C - Part 3 of n - Component Pattern Implementation
Component Pattern in C++ - Part 2 of n - Component Pattern Basics
zhlédnutí 618Před 2 měsíci
Component Pattern in C - Part 2 of n - Component Pattern Basics
Component Pattern in C++ - Part 1 of n - Identifying Components
zhlédnutí 1,4KPřed 2 měsíci
Component Pattern in C - Part 1 of n - Identifying Components
Flyweight Structural Design Pattern in C++ - Part 2 of 2 - Implementation (with factory)
zhlédnutí 591Před 2 měsíci
Flyweight Structural Design Pattern in C - Part 2 of 2 - Implementation (with factory)
Flyweight Structural Design Pattern in C++ - Part 1 of 2 - Understanding the Pattern
zhlédnutí 1KPřed 2 měsíci
Flyweight Structural Design Pattern in C - Part 1 of 2 - Understanding the Pattern
[Programming Languages] Episode 21 - First Impression - Elm
zhlédnutí 653Před 2 měsíci
[Programming Languages] Episode 21 - First Impression - Elm
[Dlang Episode 84] D Language - Template Code Blocks - Part 1 of n - Generic Programming Basics
zhlédnutí 354Před 2 měsíci
[Dlang Episode 84] D Language - Template Code Blocks - Part 1 of n - Generic Programming Basics
What are you doing? Show us an entire hour how to use the Google Search Machine to learn more about Odin's programming player! The only one who has to learn something here are you ;-) !! You are a fake
hello mike great video i have a simple question if we put the countdown and the while loop in brackets it would be better?
一看就会,一做就废。 ez to watch how Mike does it, hard to do it by yourself
Thanks for the explanation!
Cheers, you are most welcome!
Ok, the function being const even though it was modifying private data members kinda blew my mind. I thought const was stronger than that , disallowing any changes to incoming data, forcing literally any change of any kind to be made to variables/data declared within the function. Very nice! I also had no idea that declaring a lambda was implicitly just creating an entire freaking class within the scope it's declared. That's way less optimized than I imagined, though they're still cool. I just thought they were some more special object than that.
Need to capture state somehow I suppose in the functor :) Maybe the compiler is doing something smarter however (i.e. maybe just creating a simple function) where it can -- but I'd have to look at assembly to prove that.
Is being a YT channel member a good way to support you, @MikeShah? Or is Patreon or a one-time contribution better suited?
That's very kind! Folks are welcome to become members at any level or do super thanks (one-time). I understand folks financial situations are all different, so comments, likes, and engaging in the community are also perfectly fine. I don't have patreon, as I figured folks might want to just keep everything on CZcams.
After notify_one, the reporter thread tries to re-aquire the lock, but it is already locked by the worker thread (until the lock goes out of scope). If the lock would not go out of scope in the worker thread, a lock.unlock() would be needed before (or after) notify_one(), in order to allow the reporter thread to re-aquire the lock after wait, otherwise the reporter thread would remain blocked.
Thanks to you, iterators are my new best friend…loving the combined power of using the .find and .end methods in conditional statements.
Cheers!
Great video Mike
Cheers! You are most welcome!
6:15 I might have missed this from other courses, but can struct be anycase. Are these valid? structure, struct_ure, strucTure? Yes, I admit, I am not creative. It is six in the morning and I have no coffee. I am aware D has a mechanism like Nim for creating an escape with keywords, I believe it uses ``` But this I did not know. I always assume PascalCase for udts. That is good to know, but I could be wrong. Anyway, to the actual lesson at hand. Say I wanted to model a character sheet, I assume I can use static asserts for the struct field. Like for example how in DND, you cannot have a certain number of skills and you have a hard max at level 20.
Yup, can use static asserts for that. There's also contracts for structs as well (in and out) to enforce these guarantees when testing for instance.
very good. thanks
Cheers!
woagh this is a huge stepup in complexity relative to the previous videos, i'm not complaining just surprised
Jumped into talking about memory a bit, but hopefully the code isn't too difficult -- try to play around with it a bit :)
I picked up Rust in 2015 because I was fed up with C and C++. I tried out D and Go too, but they both have a GC so didn't quite cut it. Go was nice and simple compared to the others, and I liked that, but the perf cost of a GC just kept me away. I built a toy game engine in each language as a comparison. Rust was the hardest but, as Bill said in the video, it was the only real alternative. Over the years I've kept my eye out for a better solution. I saw some of Jon Blow's videos on Jai and was quite interested, but at the time it was fully private and even now it's in private beta. I also tried out Zig, but the syntax just felt wrong to me. Not sure exactly what it is about it. More recently I saw Carbon, and C++2, but again, they're either too new or the syntax is too weird. I'm now using Odin as my main side project language. I'm the head of R&D at my company, so maybe I can sneak it in somewhere haha
Mike I love you
great video sir . one request of starting DSA series pls
Cheers! And noted :)
So is a static pointer stored in the program, but the memory it's pointing to would be on the heap? (if allocated with new)
Correct! -- 8 bytes stored for the pointer in static memory is what you get when you load your program (then that will eventually point to a 'heap' of memory elsewhere for that executing process by the operating system).
OMG SO COLL!!
Enjoy!
D'asserts?! .. yum yum!!!!
🍰
Assertions are null operations in non-debug builds. Instead, enforce from std exception can be used.
Yes, we're going to talk about enforce soon :)
can i use glad instead?
We use glad in this video
Hi sir, at 25:14, how do we say that myArray2 specifically called the copy constructor ?
myArray is being 'created by copy' -- thus the copy constructor is invoked as the new object 'myArray2' is being created for the first time. This is not to be confused with the 'assignment operator (i.e. operator=)' -- we are infact invoking the copy constructor at line 41 at 25:14
Happy episode 100! Time to 'assert' this is the best episode ever, until episode 101 comes out. Then, we can do 'D a Day 101 Days' and we can all sing!
Indeed! With Ali's lecture, and the two teasers this would be the 100th episode! Perhaps for lesson 100, we'll have to do something special :)
@@MikeShah That is a surprise for longevity since that means you basically been doing this for just about/over two years, huh? I think I propose something fun for a special. I actually used the c import once and I forgot lol. It was the printf function, I thought D was more 'c like'. Maybe you can do an episode on the standard C libs wrapped? Especially since I am also trying to get Raylib to work for a GUI app.
Do you or other D devs use the language in some CI/CD environment, for testing, profiling, etc.?
As the sole purpose of the language? D has testing built-in which can be triggered in a CI/CD environment. There are third-party testing libraries too for other styles of writing tests
@@aberba say you have a project, written in D (for a Jenkins or SonarQube env.) …
@@bsdooby sure, I don't think it should be an issue in any other language.
@@bsdooby I've used things like Github Actions with D no problem (github recognizes D as well). Tools like dscanner can be integrated into the pipeline as well. Soon I'll talk about some more of the features in dlang like 'unittest' 'coverage' 'profiler' etc. that you can use with tools like Jenkins
@@MikeShah COOL 😎 As always: looking forward for these clips!
asserts are run-time based; but they are used during the development phase. Thus, there is static assert for compile-time based checks; isn't it?
Correct!
Plz do `dart` language too😅, I really enjoy this stuff
Cheers! Dart would be a nice one to look at!
thankyou very much for making this video! It helped me a lot!!!!!!
Cheers!
thank you sir..Helps a lot..
Cheers!
Damn so informative!
Cheers, happy to hear that!
so this is also a way to add tuples w/o using special constructor functions? (apart from Typedef, ofc)
Hmm, not sure I understand the question -- you're suggesting using std.tuple to create a new type versus Typedef?
@@MikeShah I might rewatch your clip, and study the documentation. Maybe I did not quite understand the usage of `Typedef`.
@@bsdooby No worries, feel free to ask again anytime!
Thanks 🙏🙏
Cheers!
great video!!
Cheers!
Nintendo ❤
Looking at std range, there's no definition of an input range, for example; it's just a set of is expressions that checks if the parameter confirms with the definition.
Interesting, I suppose that makes sense and otherwise defines that something is iterable (i.e. is a range). I'll have to dig into that a bit more too
@@MikeShah instead of a type it's a Boolean test, very similar to traits. This is interesting to me because I'm looking at ways of using functional algorithms during parsing. Often we need to know if two types have weak congruence under certain conditions because this allows them to be duplicated over computational boundaries such as over a network.
@@disdroid Sounds like the tool you need then :) Sounds like a neat project!
@@MikeShah one barrier is that a lot of the functional algebraic styles do actually incorporate some idea of state, although they are still considered pure because of the strictness of the definitions. A compiler can't know about this even when it's proven, unless it forms part of the language, so at some point I'm going to have to write custom tools.
The test for input range illustrates "barbed congruence". A process is compared for conformity against a list of "barbs" (comprised by the is expressions in std range library souce). The barbs are output events, with the messages being the features that are required to conform to the definition, in this case as an input range. Once conformity is established, we can safely perform algebra on the process.
one question do you run your linux natively or in a vm
Mine is native
Had a data loss event today, but I went to another linux distro as a fresh start. I still am amazed at how D works...everywhere. I expect to develop on Windows while I sync backups to my main partition for the first time, but currently, I got this working on Arch as well and with helix. I am not saying that meme by the way.
Very cool -- I haven't tried D on Arch or Helix, but glad it works!
First!
does the 'SDL.h' file not found error remain in the vscode editor even after creating an executable?
If your code is compiling, but VSCode is indicating SDL.h does not exist, then that's an issue with the configuration of VSCode just not knowing where the include path is I believe.
Sorry - but your video is quite incorrect. C styre cast will never do the equivalent of dynamic_cast. C doesn't have RTTI Most of your uses of reinterpret_cast is undefined behavior. So this video is very poor advice for people learning C++.
Many people believe the computer only listens to Ada, recognizing her as a pioneering figure in programming and the first computer programmer
Ahead of her time, should be a household name
The computer "listened" to Ada because she wrote the first algorithm intended for a machine, effectively making her the first computer programmer.
Thanks so much. It really helped a lot!
Cheers, happy to hear that!