How C++ took a turn for the worse

How C++ took a turn for the worse

Code Persist

1 год назад

271,092 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@aerospacesoftwareengineer9145
@aerospacesoftwareengineer9145 - 05.01.2024 23:03

As a C++ and Rust developer, C++ is one of the best invented languages, I would highly recommend investing time into learning newest C++ standard to get the best job our there. By the way std::ranges::accumulate hasn't been yet added to the standard, not sure where your code came from.

If you would be a true C++ developer, all the code examles would make an absolute sence, including syntax debate.

Regarding the package manager, again it's related to lack of experience. Python is an interpreted language run by some virtual machine. C++ is compiled language, it is a very difficult task to develop a package manager for all available platforms and compilations types, with freedom the C++ provides. However as you mention in a video some of them have appeared such as vcpkg, and in fact there is a standard package manager for linux systems by default.

Ответить
@VictorMistral
@VictorMistral - 05.01.2024 19:29

I don't know for the std, especially view. To me, it is easier to read and follow in the condensed form. It just makes sense.
Well maybe except for the odd last 0... ( it's the starting value of the accumulate)
You do need to understand iota, but the rest just makes senses to me...

Ответить
@HolographicKode
@HolographicKode - 05.01.2024 19:01

Cool presentation. What tool did you use to create the code animation ?

Ответить
@username7763
@username7763 - 05.01.2024 17:11

There are package managers for C++ such as vcpkg. Linux distros also come with package managers which manage C and C++ packages. But the problems that package managers solve have already been solved better. You want a 3rd party library, you install the 3rd party library. You can clone a repo, you can download it, and it doesn't ever magically semver change versions on you. You also don't get 100+ other dependencies which change between versions. Boost, Intel TBB, Qt are all great 3rd party libraries. I've never had to deal with package version conflicts.

Ответить
@AntonioBarba_TheKaneB
@AntonioBarba_TheKaneB - 05.01.2024 16:05

C++ will become the future Cobol, where nobody knows how to use it and they have to pay loads of money to retired millennials to fix and maintain all that legacy shit. At least I hope so! That's my retirement plan :D

Ответить
@arixachannel
@arixachannel - 05.01.2024 01:36

bro has never heard of the address sanitizer. all of these complaints are due to inexperience. that's understandable, but c++ is not remotely designed for beginners, just like C.

Ответить
@melphiss
@melphiss - 04.01.2024 22:53

C++ is broken

Ответить
@rosa_bot7594
@rosa_bot7594 - 04.01.2024 11:45

"auto concept_name variable_name" is such a great replacement for templates with verbose requirements and/or enable_if's. like, ex: "auto std::integral x" so simple, so readable.

Ответить
@mikerodent3164
@mikerodent3164 - 03.01.2024 23:46

Rust. Let me repeat that. Rust.

Ответить
@postmodernist1848
@postmodernist1848 - 03.01.2024 16:26

Honestly, for segfaults just compile with -ggdb and read the stacktrace

Ответить
@markusfischhaber8178
@markusfischhaber8178 - 03.01.2024 08:39

The c features in c++ are what makes c++ some useable.

Ответить
@eyesopen6110
@eyesopen6110 - 03.01.2024 08:29

Yes auto is garbage. C++ should NOT become python and NOT become lambda spaghetti.

Ответить
@ittakir
@ittakir - 03.01.2024 01:06

For me as C++ programmer, Python has one big red no-no flag that I cannot overcome: The Indentations.
I always use {} in C++ even in one-line blocks. This makes me much easier to see the boundaries of a code block. If I copy-paste a block of code in C++ with {}, it will not lose a boundaries because of shifted indentations.

Ответить
@JustPlainRob
@JustPlainRob - 02.01.2024 15:18

"As a primary python developer" is a statement no serious dev should speak. I use many languages including these, and python is not one to be proud of.
Imagine being so clueless you use a shitty interpreted language using indentation for scope and having the cojones to call the OG low-level language it runs on "weird" and picking at its few flaws.

Ответить
@notuxnobux
@notuxnobux - 02.01.2024 07:51

The issue with packages and linker error is almost entirely a windows issue. On posix systems you can just use pkg-config to automatically include all of the necessary linker and include flags.

Ответить
@diamonddemon7612
@diamonddemon7612 - 01.01.2024 22:32

As someone who started with python, I think C is better than C++

Ответить
@dylanisaking
@dylanisaking - 01.01.2024 20:46

the auto is fine as long as you use a good code editor like visual studio where you could just hover over it and see the return type

Ответить
@chernobylfx2379
@chernobylfx2379 - 01.01.2024 16:38

Package manager: Visual Studio NuGet packages.

Ответить
@JA-in3hw
@JA-in3hw - 31.12.2023 09:21

Auto as a type in a function is just shorthand for a template function. You wouldn’t know anyway that’s fundamental to templates functions that auto determine template parameter.

I get the feeling you don’t do much that needs c libraries or the ability to optimize when you need it. You talk about catching up with modern languages and why bother and I always assume people don’t know what they’re talking about when they view languages that way. The value we get from not jettisoning the last 60 years of code just for foo foo syntax is enormous. All the other languages are great till they don’t come packaged with a performant way to do what you want and now you’re stuck.

It is bad practice to auto a fn return and hide it but the reason for modern auto is to only type the type once in construction and to force you to construct. You can’t forget to call the constructor with auto because that call gives it the type. You can mouse over and see. In templates auto (inside template not in argument) let’s you do a generic action where you don’t need a type. Auto it and if it supports he function call or operator you use it works. Who cares what type that’s the point. Templates are outrageously useful.

Anything good is abusable. You sound like you just read about it and don’t really need c++ for anything

Ответить
@jynx0riZ0r
@jynx0riZ0r - 31.12.2023 04:42

C is not a subset of C++. There is no backward compatibility to C that has to be retained.

Ответить
@skeleton_craftGaming
@skeleton_craftGaming - 30.12.2023 06:26

This video can be summarized as I refuse to use [or learn how learn to use] certain C++ features. Therefore, I have a bad time programming in C++... Every single one of your complaints can and will be solved if you use things like smart pointers [when convaing ownership] and using algorithms (which you're absolutely insane for. Thinking that it doesn't make your code easier to read to call something named std::for_each rather than writing for(const auto& x : container)
And your bar correct about that given that both Linux and windows are written in C++

Ответить
@vz-gv1cr
@vz-gv1cr - 30.12.2023 05:40

CPP was, is, and continue to be the most useful programming language to learn and use.

Ответить
@Bob-tx7hv
@Bob-tx7hv - 30.12.2023 01:27

the problem with C++ is not due to backwards compatibility with C, actually C is a much sane language. C++ is a Frankenstein of programming languages

Ответить
@LunaticEdit
@LunaticEdit - 29.12.2023 00:15

The linker error you showed makes perfect sense. One of your modules (.obj/o) is requiring the function test_fn from some other object file, but that object file wasn't included in the link phase. The entire point of a link phase is to LINK the obj files together. Also that segfault shows you exactly what went wrong... I feel like you are expecting C++ to be a junior developer friendly language. It is not. And those standard library things that you find "confusing"? Yeah those can end up making your apps way less error prone, and way more optimized than whatever hand crafted shenanigans you crafted in the 5 minutes you thought about that logic.

Ответить
@bumpedhishead636
@bumpedhishead636 - 28.12.2023 21:51

As an old Fortran & C engineer, the entire concept of object oriented programming & "frameworks" was the end of my career as a developer. So, I became a manager...

Ответить
@gabrielbarrantes6946
@gabrielbarrantes6946 - 28.12.2023 16:45

Skill issues listed lol

Ответить
@sealsharp
@sealsharp - 28.12.2023 14:14

"auto" in C++ is what "var" is in C# and i really like var. So why do i like auto less?
Probably because in C# i can mouse-over the variable and get its actual type.
In C++ i expect the tooltip to show a typedef which leads to a typedef of a typedef of a template of a typedef.

Ответить
@Yupppi
@Yupppi - 27.12.2023 18:42

I hate being able to do more with less effort and clearer intention. Modern C++ sucks.

"My main issue with STL is that I don't know any algorithms despite Sean Parent and Conor Hoekstra among others trying to educate people on them for a decade, about features that exist in pretty much every language. And I don't care to learn to read them, the unix pipelining/functional programming pipelining scares me even decades later. Give me nested off by one index loops" ftfy. I'm jesting but honestly it's time for people to start using ranges and algorithms that actually read directly what the intention of the writer is and reduce common mistakes. It's 2023 and even C++ engineers are allowed to learn new things that are by now ancient in most languages (in many cases since C++11 even in C++).

Conor's code reads: create an index range (iota), filter the even numbers (filter, number % 2) and sum them up (accumulate). Extremely fundamental algorithms, come up in problems everywhere. It says it right in the code. Check that the top is actually bigger than the bottom number before you do. I recall the irony in the original perfectly readable and debuggable code was that it had a bug that people didn't seem to notice right away despite those two qualities. Also the part where with those loops it's really difficult to reason about what is actually performed in the loops and reason about it, and the bugs being introduced by the indexing of the loops.

In my mind these are specifically things that concern only the people who don't want to use them, before they use them. I haven't heard people who started to use algorithms say they are so disheartened by difficult to debug issues with their unreadable code that literally says "sum up all even numbers in this range" to the reader.

I'm also a bit confused by why summing up a function for each element and sorting the result is so difficult to understand years later.

I understand your point but I feel like the examples are not doing what they're supposed to for the argument, they feel artificial. Like there are actually bad ways to use them too.

Ответить
@dark11demon11
@dark11demon11 - 27.12.2023 18:07

that people can write shitty code, not the language's fault. For me, C++ is the best. Python is weird. But the weirdest is still Ruby for me. I use C++ mostly: Unreal Engine, STM32, QT... and C like: Java, PHP, Swift.

Ответить
@iAmTaki
@iAmTaki - 27.12.2023 16:50

This will sound crazy but I kinda like not having a package manager in C++. It forces me to take care and understand the code I'm using.

Ответить
@ES-cf4ph
@ES-cf4ph - 26.12.2023 23:56

Yeah the function C++ example code in my opinion is a good example for poor naming in C++. The standard libraries of C and C++ have so weird names, mostly because in the old days there was a length limit for function names. Although I like functional programming and I think it can make code more readable (debugging is harder but reading gets so much easier), and the | for piping is a nice syntax, the names like iota or accumulate are so bad. Other languages would just call iota range, and if I would write that code, I would rather prefer to make an alias because the names make it much worse to read 😅

Ответить
@hamrizzy
@hamrizzy - 26.12.2023 17:41

I agree about the modern STL complexity, and C++ doesnt look complicated at its surface, if you get deeper however, it gets super complicated. It just seems like C++ is trying to be so many types of programming language at once. It was OOP at first, then generic programming appeared in C++. What language is C++ trying to be?

Ответить
@czarsonxd2093
@czarsonxd2093 - 24.12.2023 23:58

a python developer that doesnt like c++ that makes a video about how bad c++ is, who wouldve thought, havent seen it yet

Ответить
@danielhalachev4714
@danielhalachev4714 - 24.12.2023 14:52

I don't understand why would a person coming from a language with dynamic types like Python complain about the auto keyword, even in strange use cases such as a parameter type.

Ответить
@JeffJeffGameDev
@JeffJeffGameDev - 23.12.2023 08:47

I don't know man... looks like you are crying out loud because of your bad colleagues.

Ответить
@rinket7779
@rinket7779 - 22.12.2023 07:59

Your criticisms are silly. It’s possible to write bad code in ANY language, and the majority of examples you gave (bad use of auto and bad use of the stl) are possible in ANY language. Really bad examples. Nor do i believe it’s easier to write this bad code in c++ - you can do it in swift, you can do it in rust.

Ответить
@stefanriedel644
@stefanriedel644 - 19.12.2023 23:59

I'm a minute in and already disagreeing... If your function name doesn't give you a clue what it's returning then go and fix your fucking function name. You can't blame a language feature for your total incompetence.

Ответить
@WarrenPostma
@WarrenPostma - 19.12.2023 23:15

c++ HAS always had 99% of these issues, ever since the first C++ implementations in the 1980s. Sure the auto keyword wasn't in the initial spec, but C++ has always had insane linker error messages because of how C++ method names map to linker symbols. In 2023 you still need to know what a linker is and how it works. That's the problem. Before the Auto Keyword your problems were more like CEnumerableWangDoodleIterator<AComparison,AWangDoodleManager,P,Q,R,S,T> not compatible with AWangDoodleManager... and so on.

Ответить