Mike Shah
Mike Shah
  • 639
  • 1 777 632
[Dlang Episode 93] D Language - Compile-Time Programming - Part 4 of n - AliasSeq and aliasSeqOf
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html
►Find full courses on: courses.mshah.io/
►Join as member to get perks: ua-cam.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 names). The AliasSeq is a fundamental building block for working with data that is generated or otherwise will be iterated through at compile-time. It can also be very useful to use with the std.traits library for introspection of types. We'll also see another building block 'aliasSeqOf' which returns an AliasSeq from iterable types (i.e. something that you can usually put in a 'foreach' loop). As always, share your interesting use cases with the community in the discussion below!
►Please like and subscribe to help the channel!
►UA-cam Channel: ua-cam.com/users/MikeShah
►Join our free community: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz
Переглядів: 193

Відео

[Dlang Episode 92] D Language - Compile-Time Programming - Part 3 of n - Variadic Template structs
Переглядів 20321 годину тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.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
Переглядів 167День тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.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
Переглядів 15714 днів тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.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
Переглядів 24314 днів тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.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
Переглядів 1,2 тис.14 днів тому
►Full First Look Series Playlist: ua-cam.com/play/PLvv0ScY6vfd-5hJ47DNAOKKLLIHjz1Tzq.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.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
Переглядів 46421 день тому
►Full C Series Playlist: ua-cam.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.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]
Переглядів 54321 день тому
►Full Series Playlist: ua-cam.com/play/PLvv0ScY6vfd-kxPfRttOVYkyM2xal-x0U.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.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)
Переглядів 19421 день тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I show you how to use variadic templates. Variadic templates are a powerful tool for doing computation at compile-time. Variadic templates pragmatically ...
[Dlang Episode 87] D Language - Templates - Part 4 of n - Struct Templates
Переглядів 16028 днів тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I we will continue discussing templates, this time showing you how to work with 'structs'. Templates really shine when creating data structures or record...
[Dlang Episode 86] D Language - Templates - Part 3 of n - value parameters, and alias and typeof
Переглядів 142Місяць тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I we will continue discussing templates, but revisiting some previous concepts. I will introduce the idea of a 'value parameter' (i.e. a 'string') that c...
C++ STL numeric - transform_reduce | Modern Cpp Series
Переглядів 426Місяць тому
►Full C Series Playlist: ua-cam.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at std::transform_reduce which combines what we have learned in transform and reduce operations. Again the advantage of this algorit...
[Dlang Episode 85] D Language - Function Templates - Part 2 of n - Generic Programming
Переглядів 192Місяць тому
►Full DLang Series Playlist: ua-cam.com/play/PLvv0ScY6vfd9Fso-3cB4CGnSlW0E4btJV.html ►Find full courses on: courses.mshah.io/ ►Join as member to get perks: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson I will introduce function templates. Function templates allow us to reuse functions with different types. The D language uses ()'s before our paramter li...
C++ STL numeric - reduce (parallel fold) | Modern Cpp Series
Переглядів 423Місяць тому
►Full C Series Playlist: ua-cam.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at std::reduce which has been around since C 17 and improves upon std::accumulate. This is a powerful algorithm that allows us to ge...
C++ STL numeric - std::accumulate (fold) | Modern Cpp Series
Переглядів 504Місяць тому
►Full C Series Playlist: ua-cam.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: ua-cam.com/channels/A64pZbN5Mz5NxC3SO4qpDg.htmljoin ►Lesson Description: In this lesson we take a look at std::accumulate which has been around since C 98. This is a powerful algorithm also known as 'fold' for summing up, or otherwise ...
Component Pattern in C++ - Part 4 of n - Component Pattern, Data Oriented Design Discussion
Переглядів 471Місяць тому
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
Переглядів 502Місяць тому
Component Pattern in C - Part 3 of n - Component Pattern Implementation
Component Pattern in C++ - Part 2 of n - Component Pattern Basics
Переглядів 581Місяць тому
Component Pattern in C - Part 2 of n - Component Pattern Basics
Component Pattern in C++ - Part 1 of n - Identifying Components
Переглядів 1,3 тис.Місяць тому
Component Pattern in C - Part 1 of n - Identifying Components
Flyweight Structural Design Pattern in C++ - Part 2 of 2 - Implementation (with factory)
Переглядів 561Місяць тому
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
Переглядів 984Місяць тому
Flyweight Structural Design Pattern in C - Part 1 of 2 - Understanding the Pattern
[Programming Languages] Episode 21 - First Impression - Elm
Переглядів 599Місяць тому
[Programming Languages] Episode 21 - First Impression - Elm
[Dlang Episode 84] D Language - Template Code Blocks - Part 1 of n - Generic Programming Basics
Переглядів 3462 місяці тому
[Dlang Episode 84] D Language - Template Code Blocks - Part 1 of n - Generic Programming Basics
[Dlang Episode 83] D Language - Generic Programming
Переглядів 3542 місяці тому
[Dlang Episode 83] D Language - Generic Programming
Why I'm Still using Vim in 2024 - A Brief Introduction and Demo
Переглядів 2,4 тис.2 місяці тому
Why I'm Still using Vim in 2024 - A Brief Introduction and Demo
C++ Strategy Design Pattern - Part 2 of 2 - C++ Implementation
Переглядів 6932 місяці тому
C Strategy Design Pattern - Part 2 of 2 - C Implementation
C++ Strategy Design Pattern - Part 1 of 2 - Changing Algorithmic Behavior
Переглядів 1,3 тис.2 місяці тому
C Strategy Design Pattern - Part 1 of 2 - Changing Algorithmic Behavior
Conversation #3 - Ginger Bill- Programming Proverbs and the Odin Programming Language
Переглядів 3,5 тис.2 місяці тому
Conversation #3 - Ginger Bill- Programming Proverbs and the Odin Programming Language
C++ Visitor Design Pattern - Part 4 of 4 - std::visit and std::variant version
Переглядів 6732 місяці тому
C Visitor Design Pattern - Part 4 of 4 - std::visit and std::variant version
C++ Visitor Design Pattern - Part 3 of 4- Coding the Visitor
Переглядів 9412 місяці тому
C Visitor Design Pattern - Part 3 of 4- Coding the Visitor

КОМЕНТАРІ

  • @PuffyNutty
    @PuffyNutty 16 годин тому

    At 4:54, your error message shows "'main.cpp:10:10: fatal error: 'glad/glad.h' file not found". Instead, my error message goes "'/Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found". I believe it is reading the SDL.h file in the Headers folder. This file tries to include other files in the Headers folder (e.g. #include <SDL2/SDL_main.h>), which it does not recognise. How do I resolve this? Edit: Upon further inspection, I can resolve this by replacing each "#include" line with the requested file's full path (e.g. "#include /Library/Frameworks/SDL2.framework/Headers/SDL_main.h"). But I'm certain there is an easier, less-redundant method.

  • @williamivey5296
    @williamivey5296 17 годин тому

    Coming in late, but I have to point out that you didn't type in the correct operator in the if around 40:57. Instead of the regular expression operator "=~" you typed "==", that's why you got the error. (Because == created a numeric context and interpreted the string in $_ as the wrong kind of value.) When you removed "$_ ==" it was still not quite right, but worked because now Perl thought you meant interpret the RE /Hello/ against $_ in list context which returns the number of matches and the if triggered when that was non-zero. It works, but it's kinda obscure. The correct form is $_ =~ /Hello/ which returns a boolean value. That was one of a couple of times you didn't read the full error message. (Granted, a couple of times it was informative, but without some Perl experience, not as clear.) The error messages try to help you learn Perl, and are better than a lot of languages have. (Raku's are even better - it tries really hard to figure out what to suggest.) Other than that, great video and I did enjoy the blast from the past (first learned Perl in the late 1990s, used it quite a bit for over 15 years until retiring). PS: One of Perl's mottos is "Do what I mean" which is why, given (/Hello/), Perl got the results right even if the syntax was short a few things.

  • @skittles6949
    @skittles6949 22 години тому

    Thank you!

  • @kento282
    @kento282 День тому

    Thanks so much for this video! You have no idea how much it helped me in my programming assignment. It was very well explained and easy to follow

    • @MikeShah
      @MikeShah 22 години тому

      Cheers, I'm very happy to hear that!

  • @user-ft6zh8ny9i
    @user-ft6zh8ny9i День тому

    the worst example I've ever seen in my life. you didn't even show why you can't add two objects without operator overloading

    • @MikeShah
      @MikeShah 21 годину тому

      'operator+' can be thought of as a function, so if you don't specify how to handle that, then the types do not know how to handle add. You can try otherwise and see the compiler errors guide you.

  • @twenty-fifth420
    @twenty-fifth420 День тому

    Amazing, my favorite part. 💜💙🤍

  • @twenty-fifth420
    @twenty-fifth420 День тому

    As I build a fun CLI utility app for my sci-fi and fantasy writing for a writing sprint, some general thoughts because I apparently need to rewatch this since I spent 15 minutes stumbling over this. > If you use a struct over a class with a run function and call an instance of it in main, it works and compiles fine. But if you do a class, and say you write a line before the class init, you will get it to compile, but a seg-fault at runtime. (Probably because implicitly classes have constructors.) > But nothing wrong with just a main function, really. I think it is best to minimize data types. I already like to minimize state where I can, so I do not think just a running main loop is is a bad thing. > Yeah, it is a powerful feature apparently if you define a file in a folder, D will explicitly convert into a module. I haven't found out yet how I can use this with linking/building yet, but I will soon. > While there is arrays (?), I cannot find a hash/table/map/dictionary data type, so I have to ask about that, but I want to assume you can always iterate over two arrays like a key-value associated pair like some sort of caveman. >Finally, since I expect to be trying to use some of the standard library. >On VS Codium, if you have problems related to your output when 'running', just compile it with the dmd command in the terminal. It might just work. I think it is an issue with how temp directories are used in the program. I want to assume since my dmd also produces an .io shared file on linux that I can just link to another d file later on and daisy chain a complex cli game. After all, I expect there to be alot of gun and ship warfare in space.... EDIT: Ah yes, auto (name) = new (class instance). Quite simple really lol.

  • @RamesXXX
    @RamesXXX День тому

    By far the best video I ever watched about low level programming

  • @moatasemelsayed6226
    @moatasemelsayed6226 2 дні тому

    I have a suggestion for new playlist to go deeply in standard libraries and read the code itself for example like std::array, std::vector and explain the way of implementation and rules that complain with Standard library in gcc that will help us to explore more on the language and know more about template programming and allocation ,etc

    • @MikeShah
      @MikeShah День тому

      Good suggestion -- some videos I dive in a bit more or show the possible implementation on cppreference. I'll continue to do that more where applicable.

  • @twenty-fifth420
    @twenty-fifth420 2 дні тому

    4:30 You know if you get kind of inebrieted enough and tilt your head, you see the shadow of a 'state machine' in these easy to whip up 'counter app loops'. Really powerful, although it should be advised to never create infinite loops in a program. to never create infinite loops in a program. to never create infinite loops in a program.

  • @Crygd-utre1
    @Crygd-utre1 2 дні тому

    my beloved ruby, but i prefer crystal on top of it, it's quite similar but different.

    • @MikeShah
      @MikeShah 2 дні тому

      I did not know of Crystal until this series, very nice language

  • @twenty-fifth420
    @twenty-fifth420 2 дні тому

    7:20 Yeah, I remember the first time I flagged the compiler for options lol. I guess if I had to sum up 3 years of programming so far for casual, it would be; Using swift, I see a few core, necessary options. Just the necesities. I like it. Using nim, around the same complexity, although the different backends still trip me up. And then using D, I see returned the rosetta stone of command line options! Like, **yikes**. Basically, I am convinced D can be used to create an entire self hosted operating system and debug it light years away from earth! 🤣

    • @MikeShah
      @MikeShah 2 дні тому

      D is powerful 😁 What I really like though is the tools incorporated like: profiler, documentation, unit tests, code coverage, syntax tree, etc. It's a lot to see with all the options, but much better than having lots of external tools/dependencies. It's all there for free to learn over time 😁

  • @user-ft6zh8ny9i
    @user-ft6zh8ny9i 2 дні тому

    C++23 was created to use it, not just to mention it. forget about C++17, it's old. you should teach the newest C++

    • @MikeShah
      @MikeShah 2 дні тому

      C++23 will start appearing later on in the series. Keep in mind this video was posted 2 years ago -- most compilers are most compliant as of this writing with C++ 20 features (though support for modules may be missing other than on MSVC as of this writing). Generally speaking, many of the features I show are fine to use with C++11, and I explicitly set a higher version if needed to show something else -- keep in mind many folks in embedded world do not have available even C++14, as compilers have to be verified.

  • @user-ft6zh8ny9i
    @user-ft6zh8ny9i 2 дні тому

    bad style of coding. classes are private by default just for class fields, not just for fun, Mr PhD teacher.

    • @MikeShah
      @MikeShah 2 дні тому

      Are you referring to around 5:29? What is bad style of coding exactly? Classes indeed are private by default for all data members nad member functions.

  • @MatheusCatarino
    @MatheusCatarino 2 дні тому

    Awesome playlist contents. I confess that I am waiting for the explanation about RefCounted and SafeRefCounted because in the dlang community there is still a difference of opinion about these features not being safe without dip1000. However, for beginners, the real use still needs to be clarified (need example). Although cpp should think `std::shared_ptr`. Is it really comparable?

    • @MikeShah
      @MikeShah 2 дні тому

      Based on the documentation (dlang.org/library/std/typecons/safe_ref_counted.html) as you have mentioned I think this is indeed suppose to be similar to make_shared or otherwise a shared_ptr in C++. I need dto dig in a bit further myself before I make a video. I've always otherwise thought of it as a 'smart pointer' that uses reference counting and manages its own heap -- i.e. does not do garbage collection, but perhaps allocates some control structure that is managed automatically for keeping the reference counts. Use cases again are to have another memory allocation style that does not necessarily need garbage collection, but provides memory safety (and I think with dip1000 enabled, should work fine, and *perhaps* even work in @safe code -- at least that may have been the goal)

  • @vkatasonov
    @vkatasonov 2 дні тому

    Hello, Mike. I wanted to ask if you having some problems using leaks on Mac 💻 with M chip? I was trying to use memory leaks monitoring using methods you were speaking about in other videos, but it seems with Sonoma I don’t have access to usr/bin 🤷‍♂️

    • @MikeShah
      @MikeShah 2 дні тому

      I can't remember if in that video I elevated my privileges to super user (sudo or su). That may have been necessary, or otherwise is one thing you can try. There's probably a better fix though than to have to get elevated priveleges -- though that is something I'll have to test when I upgrade my Mac.

    • @vkatasonov
      @vkatasonov 2 дні тому

      @@MikeShah Thx a lot, if you will have answer to this issue I would be very appreciate. I'm trying to solve this problem as soon as I'm passing a huge course of C programming and that tool was absolutely magic for me. Everytime I run leaks --atExit-- <progname>, I have that crazy 2185 segmentation fault sudo leaks --atExit-- <Progname>. I was trying to switch off SIP, but it still doesn't work. And it seems that $PATH I have introduce correctly because there is leaks tool in the system which leaks /usr/bin/leaks

    • @MikeShah
      @MikeShah 2 дні тому

      @@vkatasonov Worse case if you can use a VM on valgrind that should immediately reveal answers. Otherwise, this may be a helpful post in regards to Mac and Sonoma: forums.developer.apple.com/forums/thread/738804

    • @vkatasonov
      @vkatasonov 2 дні тому

      @@MikeShah I was trying to use VM on UTM but valgrind there doesn’t work. The only solution I see is Docker with Linux or idx from google

  • @harishrawat1205
    @harishrawat1205 3 дні тому

    Clear explanation! Really appreciate your efforts ✌️

  • @iaconst4.0
    @iaconst4.0 3 дні тому

    goog video, how about the Zig's speed , Does zig is the fastest language program?? that is true??

    • @MikeShah
      @MikeShah 3 дні тому

      I suspect Zig, like many compiled langauges have excellent speed. Fastest often depends on cleverness of algorithm and programmer, so I don't see why Zig would perform any differently than other langauges.. Languages like C, C++, D, Zig, etc. all have compiler options on LLVM based compilers, and can take advantage of many of the same optimizations.

  • @Crygd-utre1
    @Crygd-utre1 3 дні тому

    the verbosity is too much, idk why needed?

    • @MikeShah
      @MikeShah 3 дні тому

      My understanding is Ada projects tend to be long lived. The verbosity is because for long lived projects, you end up reading the code more than writing it, so explicit meanings can be very useful. Ada also wants to provide gaureentees and 'contracts' for code for safety critical applications. Like all langauges, it just takes getting use to and buying into the main principles :)

  • @bradenmitchell3265
    @bradenmitchell3265 4 дні тому

    Hey Mike. Awesome series! Would love to see some videos on stringstreams and file io.

    • @MikeShah
      @MikeShah 4 дні тому

      Cheers! Good idea, I have some examples in my C++ quick start series until then!

  • @SoutParl
    @SoutParl 4 дні тому

    So are GLuints some kind of pointers pointing to the objects allocated in the GPU memory?

    • @MikeShah
      @MikeShah 3 дні тому

      Corrext, they're just 'handles' to data allocated elsewhere. All OpenGL really does is validate a bundle of data (by setting various handles) and ships that 'packet of information' to a driver to do the graphics work :)

  • @SufianDira
    @SufianDira 4 дні тому

    I found this to be the best beginner Vim tutorial on UA-cam

    • @MikeShah
      @MikeShah 4 дні тому

      Cheers! I have another free one here: ua-cam.com/video/e4E6nQpd7Xs/v-deo.html and here's the sales pitch if you want more! ua-cam.com/video/UVb95-ornjs/v-deo.html

  • @SoutParl
    @SoutParl 5 днів тому

    When I try to compile I get c:/.programy/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status

  • @quantisticnumbers2633
    @quantisticnumbers2633 5 днів тому

    I think this is the best OpenGl tutorial on youtube (i checked many tutorials made by some other popular youtubers but they still don't reach this level) 😁

  • @generaldragon9050
    @generaldragon9050 6 днів тому

    The best !!

  • @edoardostefaninmustacchi2232
    @edoardostefaninmustacchi2232 6 днів тому

    Im watching some C++ material from your channel. University level teaching for free at your fingertips. Really doing the world a solid doc

    • @MikeShah
      @MikeShah 6 днів тому

      Cheers, thank you for your kind words 🙂

  • @ShaunStruwig
    @ShaunStruwig 6 днів тому

    To add to the RGBA example - bitwise operations are also very widely used in an embedded programming context such as on a microcontroller. Quite often these operations are used to toggle bits in some specific register which is controlling a peripheral of the microcontroller.

    • @MikeShah
      @MikeShah 6 днів тому

      Cheers, a great example!

  • @blacksheep5132
    @blacksheep5132 6 днів тому

    bro got skills.... he taught me what I couldnt learn for 2 years in all these videos thankssss

  • @krupaljsbhat8569
    @krupaljsbhat8569 7 днів тому

    In GCC 13 int i = add(7, 16); compiles. How is this working?

    • @MikeShah
      @MikeShah 6 днів тому

      Compiles and reduces i to 23? This could be a result of the compiler running an 'inline' optimization followed by constant expression folding -- i.e. compilers are smart enough to see values 7 and 16 (e.g. return 7 + 16) and just evaluate it. 'constexpr' gives us a tool to try to force the compiler to execute on snippets of code and not rely on optimizer.

  • @thegameoflife9179
    @thegameoflife9179 8 днів тому

    can D call a function a certain number of times in one line?

    • @MikeShah
      @MikeShah 7 днів тому

      What did you have in mind? Could use 'repeat' from std.range 1 import std.range; 2 import std.stdio; 3 4 void main(){ 5 6 auto foo(int x) => x*x; 7 writeln(foo(7).repeat(4)); 8 9 }

    • @thegameoflife9179
      @thegameoflife9179 7 днів тому

      @@MikeShah thanks, yes, basically i didnt explain why i had asked... i was recently reading the book 'Starting Forth' by Leo Brodie and from page 11 he creates a couple of words (same as functions basically) in which the 1st function (called star) outputs 1 character (a *) and the 2nd function (called stars) calls that 1st function as many times as the number given on the stack, so if we enter: 35 stars It would output 35 of them, etc etc

    • @MikeShah
      @MikeShah 7 днів тому

      Ah got it ​@@thegameoflife9179. This could also be solved recursively if you're printing stars with some input.

    • @thegameoflife9179
      @thegameoflife9179 7 днів тому

      @@MikeShah yep, ive no doubt it can be done recursively but i prefer to split into seperate parts like he's done in forth so that they can be reused in other parts of the program... in Common Lisp you could do this... (defun star () (princ '*)) (defun stars (no-of-stars) (loop repeat no-of-stars collect (star))) (stars 35)

  • @QWin-ir6yq
    @QWin-ir6yq 8 днів тому

    Which of the smart pointers best resemble a raw pointer?

    • @MikeShah
      @MikeShah 8 днів тому

      None of them really -- each smart pointer is putting some restriction to help you write safer code. A quick summary: shared_ptr is the most flexible, and still saves you from double-frees -- so perhaps this is the closest in some sense. weak_ptr may or may not be valid memory (but you can check, and still allows you to share memory), and unique_ptr is exactly a pointer, except you can only have ownership of one piece of memory (limiting sharing).

  • @twenty-fifth420
    @twenty-fifth420 8 днів тому

    I love variadic templates. I might be a little out of depth here since generics/templates still kick me sometimes. but I am ready!

    • @MikeShah
      @MikeShah 7 днів тому

      Awesome! D really makes them much cleaner to work with :)

  • @lajtaib0801
    @lajtaib0801 8 днів тому

    Have you tried Erlang before? This autumn I'll start my firt semester in uni and I'll have the oppurtunity to take Erlang, and I'm kinda interested in it.

    • @MikeShah
      @MikeShah 7 днів тому

      I have plans to cover either Erlang or Elixer before I end the series :)

  • @bsdooby
    @bsdooby 8 днів тому

    An idea: build some kind of ORM...

    • @MikeShah
      @MikeShah 8 днів тому

      Building an object relational mapping (ORM) sounds like something that you could indeed use this tool for.

    • @disdroid
      @disdroid 8 днів тому

      I would use the user-defined-attributes for this to make something like spring or EJB in java. on top of that I would use dependency injection and a declarative style to customise the stack at runtime. then you can build the webapp as well as the business code from just a few source files. making use of CTFE removes the requirement for a generational stage during the build.

    • @bsdooby
      @bsdooby 8 днів тому

      @@disdroid (User-defined) attributes are another options, yes (however: attributes in D are kind of overused [once w/ @, once w/o @] and not well-defined, IMHO).

    • @disdroid
      @disdroid 8 днів тому

      @@bsdooby they are extremely versatile - I haven't got round to using them as much as I should. the technique is similar to the variadic struct templates - the client attaches meta-data to their type and it gets parsed by CTFE code that can generate some code inside your type. so you would use the attributes and a mixin instantiation inside your class or struct etc. and this would add your object to the ORM. I can use these attributes to specify the database parameters, as well as things like display style for web pages, in the same file as the object defintion. We wouldn't be forced to use these, they'd be the last part of the library to create. we start out using separate configuration files which we parse at compile time, and when the system is operational we create an API so that users can quickly create a runtime in one file and run it using rdmd. so simple!

    • @disdroid
      @disdroid 8 днів тому

      here's another idea - the library can generate a tuple from a given declaration set so we just grab that and use "alias this" in our application. we might not need the mixin in this case.

  • @Sherlock-xv8mh
    @Sherlock-xv8mh 8 днів тому

    Hello sir, I want to learn only the OOP part for now for my interviews. Can you please provide me the video numbers/titles as to where I should start and end for OOP specifically?

    • @MikeShah
      @MikeShah 8 днів тому

      Welcome! Pretty much any video starting with 'C++ Classes' or 'struct' in the title are what you are looking for. Check out the playlist here: ua-cam.com/play/PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L.html

  • @beebstergames7348
    @beebstergames7348 9 днів тому

    Just so I am clear, the layout in the VertexShader is tied to the glVertexAttribPointer index which is the first parameter of the function call. Also, any 'out' call in the VertexShader is automatically passed to the 'FragmentShader'. Finally you disable the vertex attributes and do not enable them again in the render but it still works. Why is that? Are these assumptions correct?

    • @MikeShah
      @MikeShah 9 днів тому

      All correct! Don't really need to disable them, as once I've unbinded from the VAO there is no need to disable anything.

    • @beebstergames7348
      @beebstergames7348 9 днів тому

      @@MikeShahThank you for your quick reply, it is greatly appreciated. I am almost through Episode 19 now, and math is my most difficult challenge. I am 'C' coder and was one for over 40 years. Systems coder. So, the C++ library you recommended 'GLM' is pretty much unusable for me as I much of the syntax is foreign to me. I never learned C++, so I am going to try and write my own math functions in straight 'C' using structures and the SDL math handlers. It will be a great way to learn graphics math, and I look forward to it. I am doing all of this in VS 2022 and so far it has not been a problem. I love SDL2 and use it to code some of the Game JAMS I have entered. I am 71 years old and am looking forward to finishing your wonderful class in hopes it will make clearer the methods I can use to build a procedural forest like Valheim. I have given my self 5 years to finish the project. Thanks again Mr. Shah, you are an inspiration to many programmers, including myself.

    • @MikeShah
      @MikeShah 9 днів тому

      @@beebstergames7348 Very cool -- and what a career you have had! Happy to help, enjoy!

  • @user-ih2gk9gl8c
    @user-ih2gk9gl8c 10 днів тому

    Does it works on artix Linux? I’m just lazy to open my laptop to test it… Sudo pacman libsfml-dev -Sy is that working?

  • @user-vs7yy7nh9x
    @user-vs7yy7nh9x 10 днів тому

    Hi Mike, I think it would be a good idea if you made explanations about Win32 api

    • @MikeShah
      @MikeShah 10 днів тому

      Thank you for the kind words! I'll have to explore the Win32 API -- it's been a while since I've done anything beyond opening a window for OpenGL :)

  • @Biplab_Mahanty
    @Biplab_Mahanty 10 днів тому

    I needed it man

  • @andrewgannon2820
    @andrewgannon2820 10 днів тому

    Mike, Your videos are exceptional. I thoroughly enjoy using your content to improve my programming skills. Thank you!

    • @MikeShah
      @MikeShah 10 днів тому

      Cheers, thank you for the kind words Andrew!

  • @twenty-fifth420
    @twenty-fifth420 10 днів тому

    10:10 Note for me in the future, this definitely has a future in matrix operations found in linear algebra. Probably would try to intuitively use it for parallelized data for a game. I wonder if you can do that with an array of strings and concat another matrix 'array' to create nonsense strings? lol that would be trippy.

  • @DelbertAud
    @DelbertAud 10 днів тому

    It appears that using write (*, '(A)') "Hello, World!" instead of print removes the extra space at the beginning of an output line

  • @bsdooby
    @bsdooby 11 днів тому

    So this functionality is like an API on steroids for instrumenting the (generated) code or the compiler. What are some exemplary use cases?

    • @MikeShah
      @MikeShah 11 днів тому

      For me serialization and deserialization is a common use case. This has come in handy for both saving/loading data, and also for cases where I need to pack bytes together to send using the std.sockets API. Folks will also use template mixins to avoid the costs of inheritance (i.e. virtual calls), by just 'adding functionality', rather than having to resort to inheritance and creating an is-a relationship (which may or may not be necessary. I'd say it's necessary to use inheritnace as soon as you need to group objects together in a container as one example). Probably folks can think of other more wild (but useful) examples :)

    • @bsdooby
      @bsdooby 11 днів тому

      @@MikeShah Thank you for this excellent response and good use case! much appreciated...

    • @disdroid
      @disdroid 6 днів тому

      I'm working an idea for a language backend that runs in the compiler. mixin templates are used to represent all the parts of the parse tree. every token represents a mixin template, even the variables and function arguments. a script gets converted into a tuple that you can use in a class or anything at all, wherever you add the mixin to invoke the meta-compiler. or, instead of a tuple it can export a string constant that can easily be written to a file. so it's using template mixins as a middleware between a parse tree and blocks of D code.

    • @bsdooby
      @bsdooby 6 днів тому

      @@disdroid What type or kind of language do you have in mind? You seem to know your way round...

    • @disdroid
      @disdroid 6 днів тому

      @@bsdooby an example would be rule based languages, or things like rdf/owl. We could also make parts of JavaScript happen in the compiler, but not eval of a variable, nor anything to do with async/await or threads. I have an idea for a language that appears more like a script than D - but we can have features such as algebraic classes, so we can say "anything which isn't an InpuRange automatically inherits interface X (although it doesn't - there is no actual interface X, its just a set of mixins). Another point to be made is that inside the compiler mixins we purposely don't import tokens that are part of the language implementation - we require the user to provide implementations for certain symbols. Let's say I'm parsing an expression that uses + and this resolves to a template instantiation called add. If I want to ensure that my code is fully ctfe based I can use the version of add that composes an enum, whereas if I want it to read the current value from a variable every time the expression gets evaluated at runtime, I might choose a version of add that uses lambdas. So before I mixin the compiler I need to "import foo.bar : add = addLambdas;". We can then decide how we treat each token, either enum or lambda usually, but I've just written a small interpreter that mixes in each identifier as a mixin template in scope, and aliases the result, inside an expression, which means that we could create custom behaviour for a particular variable without affecting the grammar or the parser. This hasn't been committed yet - the project is called coregrammars and the module is coregrammars.parsers.expr - look right at the end of the file, the last few unittests do a variety of things with the identifiers in the parse tree. I've got compilation time back to normal at last! Hopefully I will push this code to GitHub today. In actual fact, parameters in mixin templates are unnecessary in respect of adding symbols into scope.

  • @kalpakHere
    @kalpakHere 11 днів тому

    Great video. However, a little deep dive on using less or greater for Max vs Min heap would have been better. The counterintuitive nature of it is tricky to understand and grasp

    • @MikeShah
      @MikeShah 11 днів тому

      You can supply std::less or std::greater -- but I have otherwise shown how to build 'EdgeCompare' as a functor. std::less and std::greater are simply functions (or functors) that are available in the standard library for any type that already has '<' or '>' defined. en.cppreference.com/w/cpp/utility/functional/less

  • @ZubairKhan-yg4xy
    @ZubairKhan-yg4xy 11 днів тому

    Please try Haskell and assembly 😁😆

  • @suigetsuhozuki1
    @suigetsuhozuki1 11 днів тому

    You're a legend! A big thank you for this wonderful playlist, the best one I came across so far, when it comes to C++ tutorials.

  • @Chupe_chupe
    @Chupe_chupe 12 днів тому

    Great feature and great video Mike