CppCon 2018: Bjarne Stroustrup “Concepts: The Future of Generic Programming (the future is here)”

Sdílet
Vložit
  • čas přidán 24. 09. 2018
  • CppCon.org
    -
    Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2018
    -
    Concepts have arrived. They will change the way we think about programming. Implementations are available in GCC and Clang. Many fundamental concepts are in the standard committee’s working paper and the next generation of the STL depends critically on concepts.
    After briefly introducing concepts, I consider their role in design. What makes a good/useful concept? How do you design good concepts and use them well?
    From a language-technical point of view, concepts are a way of constraining template arguments. From a design perspective, they are a focus comparable to user-defined types (classes): The intent is for a concept to represent a fundamental concept in an applications domain (hence the name “concept”).
    I will mention technical issues recently resolved or currently being resolved in the committee, but my primarily focus is not concepts as a language mechanism but as a support for the development of good software.
    -
    Bjarne Stroustrup
    MD, MorganStanley
    C++: history, design, use, standardization, future; performance, reliability; software developer education; | distributed systems | Bio: www.stroustrup.com/bio.html
    -
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    *-----*
    Register Now For CppCon 2022: cppcon.org/registration/
    *-----*

Komentáře • 151

  • @antoinefortin1386
    @antoinefortin1386 Před 5 lety +181

    67 years old, and handles it for almost 2 hours . What I ninja you are Stroustrup

    • @c0xb0x
      @c0xb0x Před 5 lety +10

      Bernie Sanders at age 69 filibustered for 8 hours. www.washingtonpost.com/wp-dyn/content/article/2010/12/10/AR2010121005431.html

    • @gongfei
      @gongfei Před 5 lety +1

      who has a higher aim?

    • @Atameow
      @Atameow Před 5 lety +2

      @@c0xb0x bjarne and Bernie ftw

    • @c0xb0x
      @c0xb0x Před 5 lety

      @@indubitably5986The purpose was to rectify his image of senescent endurance. You are the one highlighting the irrelevant part of the example.

    • @prathamyadav3105
      @prathamyadav3105 Před 3 lety +1

      The guy invented C++. What do you expect?

  • @iliasalaur
    @iliasalaur Před rokem +2

    Hello from future, finally we DO have concepts in c++

  • @DanielLiljeberg
    @DanielLiljeberg Před 5 lety +139

    15 mn into the video... One thing that has kept me with C++ since I started using it about 20 years ago is this... A constant critical look at the language by the users and creators and a wish to make it better. "Horrible error messages"... This shows a very sane and healthy stance that I believe will allow C++ to mature and progress for quite some time.

    • @leftaroundabout
      @leftaroundabout Před 5 lety +16

      Yes, though the really astonishing thing is how they managed to do this without ever really breaking backwards compatibility. Mind, the developments have been slow. Concepts could have been here much earlier. Haskell has basically had them for 22 years now (called typeclasses).

    • @michaelthompson7217
      @michaelthompson7217 Před 4 lety +11

      I used to fucking hate c++ but now I love it. I love how it’s driven by engineering decisions and not perfection - it’s what has made c++ so widely adopted. This attitude is part of that.

    • @michaelthompson7217
      @michaelthompson7217 Před 4 lety +2

      B A especially with generics / templates

    • @destiny_02
      @destiny_02 Před 2 lety +2

      And 90% of problems/complaints about c++ can be removed by just letting go of backward compatibility...

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před 2 lety +3

      @@destiny_02 then 90% of problems/complaints are stupid and made by inexperienced programmers who dont know what they are doing :)

  • @antonlogunov1936
    @antonlogunov1936 Před 5 lety +13

    Started thinking about concepts even before they arrived. I saw them in Haskell and found that found that it's absolute solution for problems we have with templates. Because I hate to involve inheritance.

  • @jamesjanzen2604
    @jamesjanzen2604 Před 5 lety +26

    Only 30 minutes in so far, but this talk has already clarified so much. Always love Bjarne talks.

    • @CWHolemanII
      @CWHolemanII Před 5 lety +4

      That is the point where I clicked the thumbs up.

  • @X_Baron
    @X_Baron Před 5 lety +9

    "The ability to add things is not a fundamental thing for a large group of things." One of my favourite quotes.

  • @daggawagga
    @daggawagga Před 5 lety +25

    Wow I can't believe it's actually officially happening for real now... I'm so happy!

  • @mikicerise6250
    @mikicerise6250 Před 2 lety +3

    At my school we've been required to understand and re-implement enable_if. I'm traumatized for life. I'm considering running off to a hippie commune and programming Python.

  • @homomorphic
    @homomorphic Před 5 lety +10

    I totally agree with Bjarne on concepts and the use of them, specifically the idea that we should encourage plug and play over constrain-ability.

    • @mrpisarik
      @mrpisarik Před 5 lety

      could you advice some articles or whatever on plug and play approach?

    • @homomorphic
      @homomorphic Před 5 lety +3

      @@mrpisarik "plug and play" is not a thing, it is an aspiration. If you watched the talk, Bjarne took a question that pointed out there are corner cases where certain constraints are impossible to enforce in the context of concepts. Bjarne's position (and mine) is that the presence of these corner cases is not reason to conclude that the design of concepts is lacking.
      Appropriate application of concepts yields architectures that are both highly interoperable and type safe, and we should not let concerns over some specific edge case where a constraint can not be adequately imposed, diminish the enormous advantage of that interoperability and generally exceptionally high degree of type safety. We should favor features that improve type/algorithm interoperability when doing so requires that some specificity of constraint must be sacrificed.

  • @MicheleTurchiarelli
    @MicheleTurchiarelli Před 5 lety +12

    What a great master, for a great language! ❤️

  • @hubertliberacki3185
    @hubertliberacki3185 Před 5 lety +55

    feels like Christmas ;)

  • @TUMATATAN
    @TUMATATAN Před 5 lety +15

    I won't lie..... I teared up a bit. Pure Happiness from me!!!!

    • @shadowagent3
      @shadowagent3 Před 5 lety +1

      If only Christianity could do the same for atheists.

  • @sams_3d_stuff
    @sams_3d_stuff Před 5 lety +1

    What an era we live in! All of these legends who'll live for thousands of coming years....

  • @ninepoints5932
    @ninepoints5932 Před 5 lety +1

    Can't come soon enough. I just pray all major platforms will adopt it quickly

  • @albertwang5974
    @albertwang5974 Před 5 lety

    What a wonderful talking, I love the abstract thought!

  • @aqg7vy
    @aqg7vy Před 5 lety +3

    I can see more expressive functional programming styles in c++ enabled through this. Having a filter for how data/types are allowed to be transformed will make it easier to write code as data transformer, tied closely to the actual problem at hand.

  • @vonkruel
    @vonkruel Před 5 lety +8

    I always find Bjarne's talks to be well worth the time. Although I haven't yet written any code using concepts I'm fully convinced of the benefit. I appreciated his point about not expecting to completely nail your concepts from the start. What matters at the start is that you create concepts that make sense and provide actual utility. By giving a name to a valid & useful concept you've made it something you can work on, and all users of the concept will get the benefit as you constrain it more precisely. I don't sympathize with any hand-wringing about concepts. It's a big step forward.

    • @MSheepdog
      @MSheepdog Před 5 lety +3

      Yeah it even makes sense when throwing something together to come back to later.
      bool Serialise(Serialisable*, Stream*); // where Serialisable and Stream are concepts
      is clearer than
      bool Serialise(T*, U*);
      even if Serialisable and Stream are currently unconstrained concepts.
      Can hack something together giving them those names then go in later to constrain the types as needed once you've figured out exactly how you want your stream class to work.

  • @TheLavaBlock
    @TheLavaBlock Před 5 lety +4

    Great concepts! Great talk! Thanks

  • @cicciobombo7496
    @cicciobombo7496 Před 5 lety +50

    Cppcon 2018!
    Noice

  • @hl2mukkel
    @hl2mukkel Před 5 lety

    Oh my! It's happening, amazing!!!

  • @vonkruel
    @vonkruel Před 5 lety +3

    What do we want?
    THE FUTURE!
    When do we want it?
    NOW!

  • @mrlithium69
    @mrlithium69 Před 5 lety +25

    Bjarne you are a legend but this was too advanced for us mortals. Good progress on Concepts!

  • @cgoobes
    @cgoobes Před 5 lety +26

    They messed up the audio pretty bad. There is quite a bit of feedback / phasing in the mic.

    • @joeyalfaro2323
      @joeyalfaro2323 Před 3 lety

      I had cheap pair ear plugs said their has to be better way Google play store has bass booster. It's baby equilizer. I highly recommend it.

  • @Ven_de_Thiel
    @Ven_de_Thiel Před 5 lety

    The future is now, sparkly man.

  • @damirdze
    @damirdze Před 5 lety +2

    My favorite lang is the C++, but this speech is not only about the futuristic C++, it is a motivation to modernise our thinking about the future of the computing in general. Thanks Bjarne for wonderful presentation.

  • @WalderFrey
    @WalderFrey Před 5 lety +22

    Herb: "auto almost always". Bjarne here: "auto has been overused". Cards on the table - I like auto. If I'm having to flip to a header it's usually so that I can see which header to include, which is a language problem that has cursed us for decades. Is the use of auto subjective then? Who to believe?!

    • @vonkruel
      @vonkruel Před 5 lety +4

      I think he meant that a concept name could be a better choice than the use of auto sometimes, so along with concepts comes the need to question the use of auto a bit more. So "auto almost always" might not be quite right anymore. But if you can honestly say to yourself "a concept won't help here", and there's no other valid reason not to use auto, by all means use auto. I'll continue to use it quite often myself. Usually when I use auto it's not even in a generic programming context, and I know for sure what the actual type will be.

    • @MSheepdog
      @MSheepdog Před 5 lety +16

      Like most things it's a tradeoff between readability and flexibility.
      vector v = Fn(); // reader can see what v is giving them a clue as to what might be done with it, but Fn() can't change return type.
      auto v = Fn(); // reader must look at Fn() to see what v is, doesn't express any special intent.
      Container v = Fn(); // reader knows v has some foo's in it. Actual container type doesn't matter.

    • @johnappleseed8839
      @johnappleseed8839 Před 5 lety +3

      "Who to believe?!"
      Believe your own experience! Take advice with a grain of salt.

    • @MatthewChaplain
      @MatthewChaplain Před 5 lety +8

      With respect, I see this argument all the time, and the problem with it is that it falls flat on its face the moment the function in question is named something sensible. E.g. GetVersion() had better return the type that is your API's version abstraction, and SetVersion() had better accept something of that type. IncrementPatchNumber() had also better accept something of that type. You don't need to know the concrete type in order to do this, or even to know what's going on. If that's not true for your code, then your API needs a second look.

    • @pooya130
      @pooya130 Před 5 lety +3

      Herb clarified that he meant during initialization where you get the type also on the right hand side.

  • @MrSwac31
    @MrSwac31 Před 5 lety +19

    2001's future, today. Amazing.

  • @tuannabolas591
    @tuannabolas591 Před 3 lety +1

    He is genius and also good speaker.

  • @dimka11ggg
    @dimka11ggg Před 5 lety

    Concepts and ranges already work in GCC?

  • @arturivanov2302
    @arturivanov2302 Před 5 lety

    Good job thanks Bjarne

  • @davnmu
    @davnmu Před 4 lety

    Great talk from Bjarne, certainly taking time to explain concepts and their relevance in evolution of generic programming. However didn't get much info on #include

  • @Astfresser
    @Astfresser Před 2 lety

    I wish we could eradicate the intermediary steps of template metaprogramming and switch to concepts altogether. Use concepts as function arguments and such

  • @p39483
    @p39483 Před 2 lety

    Overloading, from sqrt 2 to sort list, is essentially DWIM is it not? Is that really a good underpinning for generic programming? Will this invite surprising cases or is it actually more ergonomic?

  • @MalcolmParsons
    @MalcolmParsons Před 5 lety

    On slide 56, T1, T2 and T3 should be For, For2 and Out.

  • @z08840
    @z08840 Před 2 lety +1

    well, quick sort can be implemented with only forward iterator and comparable requirements...

  • @jpal00
    @jpal00 Před 5 lety +6

    46:20 having the accumulator defined as Number instead of an Addable is unfortunate. It means for example that you can't accumulate Vectors (which aren't numbers and can't be multiplied by a vector).

  • @Swedishnbkongu
    @Swedishnbkongu Před 3 lety

    Isn't a list merge sortable without extra space? Shouldn't the standard library provide this?

  • @naoufal450
    @naoufal450 Před 5 lety

    Upload more videos!

  • @redradist
    @redradist Před 3 lety

    No, I realised that it still would be nice to have more strict concepts that catch all errors in body, because it would allow to catch more errors and also compile concept function in binary by providing in function bunch of pointer to methods for parameter ... With less constrained concept it is harder to do

  • @AlinNemet
    @AlinNemet Před 5 lety +1

    great man bjarne )

  • @IllumTheMessage
    @IllumTheMessage Před 5 lety +2

    1:26:31, so true. It's kind of in our DNA to be pessimistic. Developers who assume things are going to work well don't stay developers long :-).

  • @cmilkau
    @cmilkau Před 5 lety +5

    So we invented OOP to unite structure and behavior, then (among others) concepts to separate them again.
    I think C++ is duplicating all its terms and tools because its type concept is flawed. It requires a type to include a definite data structure and even a structure for operations, i.e. behavior. Then it uses types to constrain algorithm parameters. But algorithms don't always require their parameter to have a specific structure. Now generics and concepts drop structural requirements altogether.
    Just make types what they are actually used for: parameter constraints. Those can be structural (without necessarily being a specific structure) and they can be behavioral, and they can be any mixture of those. But in the end, they're still just (abstract) types.
    More and more terms and tools to patch shortcomings of existing ones won't make a clunky syntax elegant, and it also won't make a complex philosophy simpler.
    Add. Requirements, like concepts, may express relationships rather than properties. Types don't seem to have that capability. However, if two parameters have related types, most often they also have related values, and you are probably better of with a single parameter capturing the same information. Example: a single range parameter instead of two related iterators.

  • @TarunSingh-je9my
    @TarunSingh-je9my Před 5 lety

    Nice explanation.I have doubt on iterator Why we need to provide specialization in iterator
    template
    void process(Iterator begin, Iterator end)
    {
    for (; itr != end; ++itr) {
    process(*itr);
    }
    }
    why i can't write
    void process(Iterator begin, Iterator end)
    {
    for (; itr != end; ++itr) {
    process(*itr);
    }
    }
    please explain

    • @avis9ditiu
      @avis9ditiu Před 5 lety

      Tarun Singh you can write this and it compiles

  • @andreizissu733
    @andreizissu733 Před 5 lety

    After having watched both this presentation and Herb's on meta-classes, I can't help but build a mental image of concepts as a form of specification, analog to abstract interfaces in the run-time world, with associated implementer meta-classes which would take a partial (or even empty if applicable) corresponding concept implementation and bring it to full completion. I know of a similar "abstract classes" model in Python, won't be surprised to discover such things in other languages too.

  • @momoanddudu
    @momoanddudu Před 5 lety

    Minute 59 - the number concept would match matrix type as well.

    • @miyurosewood3837
      @miyurosewood3837 Před 2 lety

      Maybe because numbers (scalars) and matrices 1x1 are same, because a ring of 1×1 matrices over a field K is isomorphic to K

  • @Asdayasman
    @Asdayasman Před 2 lety

    19 minutes in and I'm like "so... Go's interfaces then?"

  • @qwertz314159
    @qwertz314159 Před 5 lety

    Why is there a picture of LHC in the first slide?

  • @AxelStrem
    @AxelStrem Před 5 lety

    we meet again, David Hilbert

  • @Astfresser
    @Astfresser Před 2 lety

    Does bjarne change his mind every year? I thought I have listened to a talk where he claimed "almost always use auto". But now it's a code smell?

  • @JackAdrianZappa
    @JackAdrianZappa Před 5 lety

    28:28 there's no place in a constructor
    to use an enable_if.
    What? What about:
    template class Pair {
    // ...
    template
    Pair(const TT& const UU&);
    };
    Kinda surprised that he made that statement.

    • @liangwang4089
      @liangwang4089 Před 5 lety

      Enable ifs are horrible to look at and they are strains on the compiler. This could be replaced by concepts.

    • @JackAdrianZappa
      @JackAdrianZappa Před 5 lety

      @@liangwang4089 when concepts become available. Until then, this is what we have, and it does work. I'm just saying that his statement was false, or maybe glossed over.

  • @hanyanglee9018
    @hanyanglee9018 Před 2 lety

    Can we literally calculate the types with the same grammar with which we calculate number and deal with std::vectors? And also print it into cout or something?
    Anyway, concept and constrains are already good enough. STL is not very usable only because it's based on template. When I use anything from STL, the only hope is figuring out the correct code with pure guessing or find any example from internet. The error message literally equals nothing, even on my favorite VS 2019. That was painful. Also, when a function can receive a parameter as value and also as ref, it has to be decleared with template, but this solution is also so ugly. It literally forces people to check every template parameter to see if they are designed to receive a value or a ref or pointer or anything possible.
    At last, thank Typescript for providing us a better c++.

  • @raghureddy3237
    @raghureddy3237 Před 5 lety +1

    can anyone tell me any standard concepts that will be available in c++20?

    • @bjarnestroustrup7067
      @bjarnestroustrup7067 Před 5 lety +5

      From the current working paper (more coming for algorithms):
      17.3 Header synopsis [concepts.syn]
      concept Same = see below ;
      concept DerivedFrom = see below ;
      concept ConvertibleTo = see below ;
      concept CommonReference = see below ;
      concept Common = see below ;
      concept Integral = see below ;
      concept SignedIntegral = see below ;
      concept UnsignedIntegral = see below ;
      concept Assignable = see below ;
      concept Swappable = see below ;
      concept SwappableWith = see below ;
      concept Destructible = see below ;
      concept Constructible = see below ;
      concept DefaultConstructible = see below ;
      concept MoveConstructible = see below ;
      concept CopyConstructible = see below ;
      concept Boolean = see below ;
      concept EqualityComparable = see below ;
      concept EqualityComparableWith = see below ;
      concept StrictTotallyOrdered = see below ;
      concept StrictTotallyOrderedWith = see below ;
      concept Movable = see below ;
      concept Copyable = see below ;
      concept Semiregular = see below ;
      concept Regular = see below ;

  • @numv2
    @numv2 Před 5 lety

    C++0x is here

  • @jpal00
    @jpal00 Před 5 lety

    28:00 These are unfortunate examples - I believe both of these are unproblematic even in plain c++03. Converting of the arguments of the constructor is handled by the language and applying a -> to a non-struct would bomb with a quite understandable error message.

  • @noxabellus
    @noxabellus Před 5 lety +5

    Theres uh, a band...At CPP con.... are they lost??

    • @noxabellus
      @noxabellus Před 5 lety +2

      Ali Kouhzadi wow I never knew that, I've watched a lot of cppcon videos but havent seen them before

  • @oj0024
    @oj0024 Před 5 lety

    Are consepts just interfaces?

    • @Sopel997
      @Sopel997 Před 5 lety +1

      No, they are much more powerful and also compile time

    • @oj0024
      @oj0024 Před 5 lety

      ok, so they are better interfaces, nice.

    • @alectoperez1383
      @alectoperez1383 Před 5 lety +5

      Sopel997 they're much broader than interfaces because you can use a contract to specify how two or more different types should interact. In addition, they're implemented very differently under the hood. An interface contains some virtual methods, and so types must inherit from it. But a concept merely specifies which methods or functionality must exist, and you don't need to derive from a concept (or even know it exists). An int primitive would satisfy the Number concept, even though int isn't even a clasd

    • @FooBar89
      @FooBar89 Před 5 lety +2

      compile time algebraic types meets interfaces sort of thing

    • @MSheepdog
      @MSheepdog Před 5 lety +1

      Apart from the whole compile-time vs run-time thing, interfaces are intrusive where concepts aren't. So to implement an interface your class needs to explicitly say it is one of those things, but if it matches a concept it already is that.
      Means you can express things as concepts without having to go through all your headers and explicitly add it to all the matching classes.

  • @ridwanhafidh9403
    @ridwanhafidh9403 Před 5 lety +5

    subtitle please, even only in plain english.. to help his voice clarification.. like you did before in cppcon 2017

  • @WutipongWongsakuldej
    @WutipongWongsakuldej Před 5 lety +3

    The audio sounds like it is badly encoded. Well it does not affect the content by any mean. Bjarne's voice is heard loud and clear. It's just a little bit annoying.

    • @micaevski
      @micaevski Před 5 lety

      i think its feedback in the recording. really annoying

  • @llothar68
    @llothar68 Před 5 lety +6

    void* is the code smell of lavendar

    • @Evan490BC
      @Evan490BC Před 5 lety +1

      More like the smell of a lavatory...

  • @dawidbujak
    @dawidbujak Před 5 lety +1

    Great haircut as always ; *

  • @fangjunkuang5061
    @fangjunkuang5061 Před 4 lety +1

    不错!

  • @alexeiz
    @alexeiz Před 5 lety

    requires requires requires? requires.

  • @Carewolf
    @Carewolf Před 5 lety +1

    What, Bjarne doesnt know what Duck typing is, and thinks it is something bad??? What.. Templates have no real type system without concepts, not duck-typing which is a type of type system.

  • @gracicot42
    @gracicot42 Před 5 lety +5

    1:15:55 lmao this guy and his pumpkins

  • @__hannibaalbarca__
    @__hannibaalbarca__ Před rokem

    This why mathematics is... ,
    What he want said : go back a dig deep in mathematics concepts, algebras, logic , and something of topology.

  • @cicciobombo7496
    @cicciobombo7496 Před 5 lety +3

    1:08:25 4chan

  • @dickvalentine5847
    @dickvalentine5847 Před 5 lety +9

    Just make a new language Bjarne!

  • @Bestmann3n
    @Bestmann3n Před 5 lety +11

    Barney Starsoup

  • @Courserasrikanthdrk
    @Courserasrikanthdrk Před 5 lety

    keep it up, thanks😠😠😝😠

  • @PaulSebastianM
    @PaulSebastianM Před 5 lety +9

    Rust already has these. C++ concepts = Rust traits. Is C++ going the direction of data driven design?

    • @JanuarAndaria
      @JanuarAndaria Před 5 lety +15

      38:35 Concept in C++ is older than Rust. Concept already used witt ugly syntax like a lot of enable_if. One of benefits of this standardized Concept is make syntax more readeble.

    • @FooBar89
      @FooBar89 Před 5 lety +7

      concepts are completely different from Rust traits, Rust traits is more akin to abstract classes or interfaces

    • @TheDucob
      @TheDucob Před 5 lety

      Rust traits are closer to templated interfaces, which is a lot like concepts IMO. You also have trait bounds and generic trait implementations, which are even more powerful. The big issue with Rust generics right now is that they're lacking const-generics (think template ).

    • @user-sz2hv7jx3k
      @user-sz2hv7jx3k Před 5 lety +1

      @@FooBar89 No. Trait objects are similar to interfaces/abstract classes (because of late binding), but traits itself are similar to concepts in c++ (both of them are resolved at compile time and implemented with the help of monomorphisation).

    • @Qizot
      @Qizot Před 5 lety +5

      so go use your rust then and wait for everyone to start using it...

  • @cicciobombo7496
    @cicciobombo7496 Před 5 lety +6

    I still wonder why c style code isn't deprecated yet.
    Make the compiler spit out an error *by default* when you create a owning raw pointer or a c-style array ecc, with a suggestion in the error itself for a replacement. Adding then a compiler flag if you really need C compatibility.
    A lot of this talk was about making code more meaningful, simpler and smaller. Having the compiler yelling at you to use std::array instead of name[] would make it easier for a beginner to start writing modern correct c++( the former has array *in the name*)

    • @cicciobombo7496
      @cicciobombo7496 Před 5 lety

      @Peterolen that's the point, a lot of people don't even know what clang-tidy and compiler options are. They just download VS2017 and start writing messy (probably) garbage code, and some of those habits may then persist in the future.
      It should be there by default, then if you know what you're doing you can disable it

    • @botetescribavicentej.2326
      @botetescribavicentej.2326 Před 5 lety +6

      How would you define your own class that do e.g. a static vector that is a POD and .... You need the low level to build the high level. As other said, you would need to adapt some lint like tools as clang-tidy or request you compiler provider to provide this kind of features. But the language cannot forbid them because they are really useful and removing them would break a lot of code :(

    • @FooBar89
      @FooBar89 Před 5 lety +10

      because sometimes there is nothing wrong with c style code

    • @MSheepdog
      @MSheepdog Před 5 lety +1

      This is the sort of thing you get when you turn on all the static analysis tools, I tried it recently in Visual Studio to see what suggestions it had. Sometimes there was things that could be improved, but lots of times it was flagging things that were far better or nearly impossible to change.
      In particular if you're writing any of your own container classes or string manipulation functions or even your own kind of smart pointer, these things rely on the low level functionality.

    • @muamersmajlovic2437
      @muamersmajlovic2437 Před 5 lety +4

      If you're a shit programmer who thinks the newer style is better, compiler doesn't want to ruin the capability of the programmers who write C style code.

  • @thesanctuary225
    @thesanctuary225 Před 5 lety

    C/C++ is "AMAZING" language~~~

  • @sheldonhawke8868
    @sheldonhawke8868 Před 5 lety +2

    59:24 - That's a disaster. So this feature is yet another syntax sugar that does not add anything to the type system.

    • @jpal00
      @jpal00 Před 5 lety

      I believe it would be a nightmare to actually check that the concept requirements are sufficient for instantiation (however nice it would be. You could for example compile template code to machine language and call it, with any possible parameter type, with some boilerplate added).
      Concepts are designed to work just like templates, which means you have to consider argument dependent lookup for instance, and that means you'd have to bind it early (which is a deviation from the norm in template code) if it wasn't specified in the concept.
      That would shift C++ more to the purely functional languages where basically the type specification is as long as the program itself (but then, if it type-checks, it will likely work).

    • @sheldonhawke8868
      @sheldonhawke8868 Před 5 lety +2

      Haskell typechecks generic code, Rust too, as well as many other languages. Why would it be a nightmare to do so in C++? Also, you don't need "type specification which as long as the program itself" to write generic code in Rust or Haskell.
      Yes, typecheck in generic code would be not compatible with "just templates", because they are basically untyped. But do we really need this compatibility?
      Concepts in current form solve nothing - "compile-time duck typing" is still a thing. They only make it a bit less painful to do the work that compiler should do.

    • @nemetroid
      @nemetroid Před 5 lety +3

      I was also disappointed by the lack of definition checking. From a C++ perspective, it still makes some sense, since it will *let* you be explicit about the requirements on the template parameters (though I would have preferred if it had forced you to do so). Easing the horror that is template instantiation error messages is probably worth its own syntax. However, from a Haskell/Rust/etc. perspective it looks more like templated unit tests than a tool for actually guaranteeing correctness... I.e. it only seems to make sense if you consider what it's supposed to replace, which I don't think is a good thing.

  • @thesanctuary225
    @thesanctuary225 Před 5 lety +1

    Sir Stroustrup~~~
    He is one of the most remarkable genius in the world in our time.
    Although, another genius, sir Ritchie has gone, He(Bjarne) is still with us(and Dennis is in our memory).
    Praise him~~~
    Praise sir Stroustrup~~~
    Praise sir Ritchie~~~

  • @antoinefortin1386
    @antoinefortin1386 Před 5 lety

    The Godfather

  • @apenasmeucanal5984
    @apenasmeucanal5984 Před 2 lety

    he kind of thinks of concepts like java/c#’s interfaces

  • @a314
    @a314 Před 5 lety +1

    Wow, welcome to the past C++. D has been doing this since 2008?!

  • @captlazerhawk
    @captlazerhawk Před 5 lety +2

    Just Code in C all this is bull shit that waste your time!