Typical C++, But Why? - Björn Fahller - Meeting C++ 2023

Ғылым және технология

Typical C++, But Why? - Björn Fahller - Meeting C++ 2023
Slides: slides.meetingcpp.com
Survey: survey.meetingcpp.com
The C++ type system is both very weak and very strong. In this presentation I will show you how using the strengths of the type system makes your code better. I will show you how types...
prevents incorrect code from compiling
improves readability of code
reduces the risks when changing code
and I will show you how very simple changes to your code will take you far in the desired direction.

Пікірлер: 6

  • @Carewolf
    @Carewolf4 ай бұрын

    We do have compiler warnings for implicit casts from bool to int.

  • @martinlicht7132
    @martinlicht71324 ай бұрын

    The example on Slide 15 just shows the dangers of the implicit conversions introduced in C and adopted in C++. While it allows for very "concise" writing, ths s nt vr rdbl jst lk lvng t vwls in wrtng. Modern compilers should introduce flags optional warning about such accidental conversions even if they are perfectly valid C/C++.

  • @Carewolf

    @Carewolf

    4 ай бұрын

    We might need an explicit "implicit" marker then.

  • @apenaswellignton
    @apenaswellignton4 ай бұрын

    @ 25:05 I'd argue even more, you **should** keep it very minimal. Restrain yourself and prefer to declare only the minimal set of functions that is needed to make your class actually do the job it is intended to do. Tony Eard actually has a pretty good talk on this which goes more in depth, its a talk about the somewhat controversial SOLID principles. kzread.info/dash/bejne/maCN04-dpsrIqZc.html

  • @apenaswellignton

    @apenaswellignton

    4 ай бұрын

    anyways, very great talk! it was fun to watch.

  • @varshneydevansh
    @varshneydevansh4 ай бұрын

    noice

Келесі