CppCon 2018: Jonathan Boccara “105 STL Algorithms in Less Than an Hour”

Поделиться
HTML-код
  • Опубликовано: 9 фев 2025

Комментарии • 118

  • @schleppel12
    @schleppel12 6 лет назад +342

    Haha. That world map. As nerdy as it gets.
    Loving it.

    • @DarrinCullop
      @DarrinCullop 5 лет назад +13

      What's amazing is that they work on things besides std::map !

  • @mrlithium69
    @mrlithium69 6 лет назад +159

    Very clever. Not only will I remember the algorithms but I will remember the map too now :) Thanks for the good talk!

  • @Yupppi
    @Yupppi Год назад +5

    Conor Hoekstra mentioned this talk in his algorithm talks and I'll admit this is a wonderful presentation. Just the way to present the idea and the vehicles to carry the presentation are so nice that you can't help but want to just dabble a tiny bit into algorithms, just to get a piece of the presentation's atmosphere. Very nice presentation!

  • @fgfanta
    @fgfanta Год назад +5

    Can't like this video enough.

  • @luisfsalazarb
    @luisfsalazarb 6 лет назад +78

    Clear, concise and entertained. Having been through all std algorithms at least once is absolutely educative.
    I will remember your talk. Thanks man.

  • @mindasb
    @mindasb 6 лет назад +61

    As a teacher of programming, I'm absolutely amazed and inspired about / by this map. A great educational tool.

  • @andrewf6725
    @andrewf6725 6 лет назад +173

    Amazing presentation. Absolutely recommended for every STL beginners!

  • @mayankdutta2832
    @mayankdutta2832 5 лет назад +15

    OMG , It's not just a video , It's a movie. I never enjoyed that much before !!

  • @paulchoudhury2573
    @paulchoudhury2573 2 года назад +5

    Outstanding and I've learned quite a bit over the years by regularly visiting his web-site!

  • @NomoregoodnamesD8
    @NomoregoodnamesD8 6 лет назад +17

    24:00 if you can write your algorithm as a call to reduce, then you have made an nonsequential parallel algorithm. If you want to introduce yourself to multithreaded programming, this is the best place to start, as it is the fundamental algorithm for highly parallel code.

  • @srcmake
    @srcmake 6 лет назад +29

    Nice presentation. I was looking for a tutorial on the STL, and you did it very succinctly and well.
    I'll be sure to check your blog out. Thanks.

  • @bubblesort8760
    @bubblesort8760 Год назад +1

    That map was phenomenal !. Remarkable presentation!

  • @nikitademodov3446
    @nikitademodov3446 4 года назад +2

    As someone who just started learning C++ and took a yt-course which only covered the syntax, this was very helpful and I'm excited to use it in my projects.

  • @Karsteski
    @Karsteski 2 года назад +1

    I love how much effort went into this. Great talk

  • @jvsnyc
    @jvsnyc 3 года назад +7

    I somehow left lower_bound and upper_bound out of my notes, thought we might have missed it, so re-watched. Technically, the whole thing doesn't need to necessarily be fully sorted for a lower_bound call to work, as long as everything < val comes before the first element equal to val, and upper bound should be good as long as everything there onwards is > val. They both give correct answers for all val if the whole range is fully sorted, by far the neatest case.

    • @constantijndekker8343
      @constantijndekker8343 3 года назад +1

      Actually, I believe the entire functuon is redundant because you can use partition_point with the right predicate, which as you describe only demands that the range is partitioned with respect to this predicate.

  • @shrektan6460
    @shrektan6460 5 лет назад +4

    I need to reread your slides. Great and innovative explanation!

  • @nichevo
    @nichevo 5 лет назад +9

    Great talk! Few notes:
    22:51 There is no such thing as is_partitioned_until in STL
    51:51 C++17+: uninitialized_move, destroy, uninitialized_default_construct, uninitialized_default_construct

    • @Evan490BC
      @Evan490BC 3 года назад +4

      "There is no such thing as is_partitioned_until in STL" ... yet!

    • @gordazo0
      @gordazo0 Год назад

      is partitioned until partition point xd

  • @ughadunk
    @ughadunk Год назад +1

    This is pure gold!

  • @grahambest3809
    @grahambest3809 5 лет назад +2

    Awesome talk. Johnathon Boccara explains it beautifully! Acquired a few new tools :-)

  • @deepcoding...2520
    @deepcoding...2520 5 лет назад +3

    Amazing presentation and glance of STL algorithms

  • @zhangzhang2851
    @zhangzhang2851 2 года назад +1

    clear presentation, recommended for me in the 2017

  • @mattt2684
    @mattt2684 6 лет назад +4

    ...and I thought my day wouldn't get any better!
    Amazing talk!

  • @shaovoon
    @shaovoon 5 лет назад +8

    Thanks, Jonathan for the good talk, that was the most productive hour in my C++ learning history! 105 STL Algos in less an hour! Is your world map from a mindmap?

  • @akaDL
    @akaDL Год назад +1

    Great content. Coming from learncpp!

  • @1aggin_5amurai
    @1aggin_5amurai 3 года назад +3

    Great presentation! Thanks!

    • @CppCon
      @CppCon  3 года назад

      Very welcome!

  • @KangoAbhiram
    @KangoAbhiram 6 лет назад +2

    Excellent presentation. Concise and very informative.

  • @TruthNerds
    @TruthNerds 6 лет назад +7

    Very informative talk. Here are the obligatory flies in the ointment:
    30:29 adjacent_find does not take a value and it does not return the first position where there are two adjacent occurrences of the value. Instead, adjacent_find returns the first position where ANY two adjacent and equal values appear. (You can use the overload with binary predicate to perform the operation described, but that's, I reckon, not a common use case, and requires extra typing at least.)
    31:40 This is misleading, *all* of lower_bound, upper_bound, equal_range and binary_search do a binary search (the complexity guarantees practically mandate that). binary_search is just the only algorithm to carry the binary search in its name. (If you are extra pedantic, equal_range actually does two binary searches, one of which may be limited in scope.)

  • @cicciobombo7496
    @cicciobombo7496 6 лет назад +3

    Lovely talk, really good english and you look better on camera rather than google images
    The map is AWESOME
    9/10 talk, would listen again

  • @shitshow_1
    @shitshow_1 2 года назад

    Thanks for the Amazing presentation !

    • @CppCon
      @CppCon  2 года назад

      Thank you too!

  • @lupinedreamexpress
    @lupinedreamexpress 6 лет назад +3

    Interesting video. I will definitely be saving the slides and pdf offline for reference. *Edit: After reviewing the github link shared in the video description, Jonathan's talk is not among the presentations shown in CppCon2018 in the list in their README ~Wonders if they found him relevant enough for inclusion~ *

    • @thx947
      @thx947 6 лет назад

      I found one. 2018.cppconf.ru/talks/day-1/track-a/3.pdf

  • @MindGameArcade
    @MindGameArcade 3 года назад +2

    Great talk

  • @scotthamilton228
    @scotthamilton228 5 лет назад +7

    24:44 francais spotted, excellente vidéos

  • @logancheatum8397
    @logancheatum8397 Год назад +1

    When the man pulled out the map of algorithms I knew I was on some nerd shit

  • @Betadel
    @Betadel 6 лет назад +26

    Great talk! Any plans of updating it for C++20 (with ranges and other new algorithms)?

    • @darkee03
      @darkee03 6 лет назад +15

      dude, not even c++17 is fully supported by major compiler vendors...

    • @Iuigi_t
      @Iuigi_t 6 месяцев назад +1

      @darkee03 now it is :)

  • @mirrorless_mirror
    @mirrorless_mirror 2 года назад +1

    Great talk!

  • @no2boblennon
    @no2boblennon 5 лет назад +5

    And now I want the map!

  • @maryguty1705
    @maryguty1705 Год назад

    are there other videos on rest of the stl library ?

  • @einher1
    @einher1 Месяц назад

    Really nice, but I wanted to see how the code will look like, so I did some exercises. Fun fact: for me std::copy (38:20) worked just fine and even produced the correct result! That's so weird. I think it's undefined behavior, though.

  • @cafelashowerezweb
    @cafelashowerezweb 4 года назад

    Thank you for the great explanation,
    really helpful

  • @madpad759
    @madpad759 6 лет назад

    Really great presentation

  • @computervisiondev
    @computervisiondev 3 года назад +1

    Are the posters no longer available? D:

  • @childhood1888
    @childhood1888 3 года назад

    Why didn't the committee overload functions like fill instead of writing new ones with _n like fill_n?

  • @bnd8371
    @bnd8371 6 лет назад

    great presentation

  • @kirubakaransujanaranjan2877
    @kirubakaransujanaranjan2877 4 года назад

    Thank you for the talk

  • @guykeren9666
    @guykeren9666 4 года назад

    Great video, thanks

    • @CppCon
      @CppCon  3 года назад

      Glad you liked it!

  • @LukenSkyne
    @LukenSkyne 5 лет назад +6

    Used only for std::sort until now.

    • @brainplot
      @brainplot 5 лет назад +2

      Once you start using other algorithms you really can't go back. is still something I miss when writing other languages besides C++.

  • @YourCRTube
    @YourCRTube 6 лет назад +8

    It would have been helpful to see the signatures of the functions. Also it would have been nice to mention lower_bound can be used if one wants binary search that finds an item. More (any) uses would have been great even if this makes the talk 105 minutes long.

  • @Lazlowi
    @Lazlowi 5 лет назад +3

    Am I working with too many abbreviations if my first thought at IOTA - quite a funny name was that it is "increment over the array - why is that funny?"

  • @mehershrishtinigam5449
    @mehershrishtinigam5449 3 года назад +1

    i didnt get the each joke at 13:24 :(

  • @zhaoli2984
    @zhaoli2984 6 лет назад +2

    The talk is awesome.

  • @tomhollins9266
    @tomhollins9266 5 лет назад

    Superb. Kudos.

  • @venkateswarans1012
    @venkateswarans1012 5 лет назад +3

    Still my interviewer ask me to write binary search tree using doubly linked list with raw pointer😣.

    • @narTniveK
      @narTniveK 5 лет назад

      Did they want you to build a BST using the values from the doubly linked list?

    • @zuradzindzibadze8733
      @zuradzindzibadze8733 5 лет назад +6

      if you have no idea how code works most likely when need arise you wouldn't realise which algorithm is the most appropriate.
      That's why big tech companies are so obsessed with Algorithms and tricky problems. If you pass them, it's most likely that you will solve any future problem with high efficiency.

    • @brainplot
      @brainplot 5 лет назад

      @@zuradzindzibadze8733 Even if you don't properly "pass" them, seeing how you go about solving a hard problem can outline your problem-solving skills.

  • @raymondlu9232
    @raymondlu9232 6 лет назад +1

    Good job! I want that map, haha~

    • @-taz-
      @-taz- 5 лет назад

      Yeah, this map needs to be in a museum, er, store. EDIT: As someone else pointed out: www.fluentcpp.com/getTheMap/

  • @Svitlana.Lubenska
    @Svitlana.Lubenska 4 года назад +1

    Reminded me a C++ map by Alena ;)

  • @bwatspro
    @bwatspro 6 лет назад +2

    that was really amazing

  • @Alex_ssss
    @Alex_ssss 5 лет назад

    Thank you very match!

  • @ABaumstumpf
    @ABaumstumpf 5 лет назад

    I should have watched that video a year ago.
    wouldn't have solved my problems cause the requirements were just so strange but it might have made some of my constructs a little easier to read.
    remove-erase: In some situations you just want to remove the elements but not erase them. Does not happen often, but can be quit useful for example if you need a static memory footprint.
    Would be good if there was a "pure" erase too.

  • @arunpal3792
    @arunpal3792 6 лет назад +1

    I need that video which start at 7.55 😍

  • @jh-lp7cg
    @jh-lp7cg 4 года назад +1

    I want this map.

  • @larrytroxler7017
    @larrytroxler7017 2 года назад

    Once he said "use case", I split the scene soon after.

  • @JohnJTraston
    @JohnJTraston 4 года назад

    It's also for_every and for_any

  • @jakubhorak636
    @jakubhorak636 6 лет назад +8

    Hmmm... he said that set_symetric_difference is the longest name, but I think uninitialized_default_construct_n is longer :D

  • @muradghazzawi5088
    @muradghazzawi5088 6 лет назад

    amazing presentation , where can i find the presentation slides ? i didn't found them in the link that's in the description

    • @thx947
      @thx947 6 лет назад

      I found one. 2018.cppconf.ru/talks/day-1/track-a/3.pdf

  • @PawanKumar-jh4bj
    @PawanKumar-jh4bj 6 лет назад

    Now, this is what i am looking for.

  • @kennethj.5683
    @kennethj.5683 6 лет назад +3

    13:20

  • @debugx1
    @debugx1 6 лет назад +1

    greate talk, thanks a lot

  • @childhood1888
    @childhood1888 2 года назад +1

    24:44 C plüs plüs

  • @za3kazeb
    @za3kazeb Месяц назад

    Hi ayadi, rivez C++

  • @gggrow
    @gggrow 4 года назад +1

    What accent is that?

  • @YourTVUnplugged
    @YourTVUnplugged 5 лет назад

    C++ FTW!!!!!! :D

  • @ViktorEngelmann
    @ViktorEngelmann 6 лет назад +1

    I wish there were "functional" equivalents for them all. Like list, vector, etc. should have a common base-class "container" (or so) that has a begin() and end() method. And then there should be inline for_each(container& c, f) etc. which does nothing other than call the other for_each(c.begin(), c.end(), f). The absence of these forces you to first construct the container and then pass it to the algorithm. Kevlin Henney calls such code "object-assembler" because of the "first X then Y" way of thinking. I would just prefer to do that in a nested way in one single expression, which I would consider a more "functional" way of doing it. In particular, it would allow you to compose the algorithms!

    • @NomoregoodnamesD8
      @NomoregoodnamesD8 6 лет назад +4

      The reason you have to pass iterators to algorithms is that it promises that the algorithm will not modify the underlying container (save for giving a back_inserter to transform, generate, etc). This strong promise means that you are guaranteed that none of your other iterators will be invalidated after the algorithm ends.

    • @NomoregoodnamesD8
      @NomoregoodnamesD8 6 лет назад

      Also, this would put more requirements on the container using the algorithm. You have to supply an overload for std::begin and std::end OR have a container.begin and container.end. By only requiring an iterator, you can pass raw pointers to algorithms, and provided they meet the criteria, they will function just as well as a vector.

    • @GasperAzman
      @GasperAzman 6 лет назад +2

      Ranges will get you that sugar, in C++20, and much, much more. You also don't need a common base-class to write generic code - they have a common Concept - Container! It is easy to implement the `for_each` you want above :), or should I say the N versions of it, since you have quite a large design space for a functional for_each :)

    • @joestevenson5568
      @joestevenson5568 4 года назад +1

      But thats what for each does already? It works on anything with iterators ie any container you can dream up. Plus const_iterators exist, giving you the ability to trust algorithms to not have side effects on your data, which is about as "functional" as you practically often want to be.

  • @PixelPulse168
    @PixelPulse168 6 лет назад +2

    where can I get this map

  • @NewInfinityRecursion
    @NewInfinityRecursion 6 лет назад

    WOW

  • @pedromiguelareias
    @pedromiguelareias Год назад

    It's great, and std algorithms are probably the best designed part of the C++ universe. Why do we need std::move, really? To create something in a function and then move it to a container? Or to "move it" out? It's a bit convoluted and unnecessary.

  • @piotrlezanski5156
    @piotrlezanski5156 11 месяцев назад

    Well, to be honest, this presentation is useful but that's just reading a cpp STL docs...

  • @sacredgeometry
    @sacredgeometry 3 года назад

    3:08 The perfect example of someone taking some horribly written code and turning into exponentially worse code albeit more terse code (the terseness isn't a good thing here, it just makes it worse)

  • @tanujnagpal572
    @tanujnagpal572 5 лет назад +14

    1.25x do yourself a favour

  • @tosemusername
    @tosemusername 6 лет назад +11

    Jonathan is overly charismatic lol

  • @GeorgeTsiros
    @GeorgeTsiros 5 лет назад +1

    i managed 15 minutes.

  • @__hannibaal__
    @__hannibaal__ 2 года назад

    All these Algorithms deal with Sorting and Looking for,
    Programmer need to dig in mathematics to change these situations.

  • @szirsp
    @szirsp 2 года назад +1

    4:20 "When we write for loops"... UB... And NO! Literally NOT everything can happen, only what is allowed by the law of physics can happen.
    But now I know not to trust anything you say. Well done. You lost my trust in the first 5 minutes. ;)
    "With the STL algorithms this doesn't happen they said"...
    int arr[3] = { 1,2,3 }; int sum;
    sum = accumulate(arr, arr+5, 0); /// Oh, NO, how could the STL algorithm fail us
    sum = 0; for (auto v : arr) sum += v; /// meanwhile the for loop is just fine
    sum = accumulate(begin(arr), end(arr), 0); /// to be fair we can make it safe with the STL, but did you notice how it is longer than the for loop? ... even without the std::
    sum = std::accumulate(std::begin(arr), std::end(arr), 0); /// now it's "beautiful"!
    sum = 0; for (auto const& v : arr) sum += v; /// the for loop is still shorter even with const ref...
    "STL algorithms are used by" ... BS number ...
    and for loops are used orders of magnitude more...
    Just remember: for loops run the world

  • @KilgoreTroutAsf
    @KilgoreTroutAsf 6 лет назад +2

    105 ways to make your code run even slower

    • @KilgoreTroutAsf
      @KilgoreTroutAsf 5 лет назад

      @@Lunaticracy I feel sorry for the users of the code.