News for hackers. Stuff that matters.
[dead]
Re:C++ Cheat Sheets by moth-fuzz on Monday March 07, 2022 @03:00AM (#30585275)
Why do these types of comments come up in every thread about C++? Sometimes people who like C++ just want to talk about C++ on the internet. It doesn't have to be for everybody.
Re:C++ Cheat Sheets by gpderetta on Monday March 07, 2022 @04:29AM (#30585787)
Just flag and move on. There is no point to be dragged in flame wars for every C++ submission.
Re:C++ Cheat Sheets by jcelerier on Monday March 07, 2022 @03:28AM (#30585431)
What are you talking about exactly ? I don't see anything in there that wouldn't be great for any language. E.g. knowing complexity bounds, random distributions... Those are things you need to know when you program, before even writing a single line of code.

Surely you agree that the same slide (https://hackingcpp.com/cpp/std/sequence_containers.png) for any JVM or CLR language would be much longer ?

Re:C++ Cheat Sheets by pjmlp on Monday March 07, 2022 @08:09AM (#30587284)
In fact, similar kind of information would be welcomed in any programming language.
Re:C++ Cheat Sheets by dalleh on Monday March 07, 2022 @12:57AM (#30584623)
It does not make sense if you think you have to learn every single function in a language's standard library. And if you think you have to, you are thinking wrong of a language like C++. This sheets are just a summary of what a language is capable of, you don't have to memorize every library function just look up what you need.
Re:C++ Cheat Sheets by jug on Monday March 07, 2022 @04:41AM (#30585853)
It's because this cheat sheet goes in depth. That's why it's so many pages long. I would expect what you compare to does not delve into in-memory layouts of vectors and random distributions because they usually don't.

This looks aimed more for computer science students or mathematicians wanting to quickly adapt pseudeo code to C++ more than a novice wanting to see what C++ is about.

Re:C++ Cheat Sheets by Adiqq on Monday March 07, 2022 @04:10AM (#30585687)
I agree, you can do a lot with C++, there's a lot of advanced libraries for different purposes, but it's simply not pleasant experience, especially, if anyone gets fancy with everything that C++ offers and you need to understand it.

Personally I want to focus on what code is doing, it's also important to understand how it's doing something, but typically I don't care that much about performance, I just want language that will produce valid code without too much effort and thousands little details that you need to be aware of and with languages like C++ you need to pay high attention to code you write and debugging can be horror story, once something goes bad.

For me, if I need to go low-level, Go is sufficient. It's readable, performant and it's harder to shot your feet with it.

Re:C++ Cheat Sheets by pjmlp on Monday March 07, 2022 @01:12AM (#30584678)
What simple languages, Python?

My pocket reference for Python 1.6 already has several pages, let alone an updated version for 3.9.

Re:C++ Cheat Sheets by nyanpasu64 on Monday March 07, 2022 @04:33AM (#30585808)
Your criticisms of C++ are correct. The language is janky to use and filled with edge cases. The standard library is designed by implementers to make most things possible but few things easy (std::string::contains will be added in C++23 yay!). And using the same-ish iterator interface for vectors and hashmaps results in needlessly unsafe and verbose vector methods (foo.bar[index].insert(foo.bar[index].end(), ...)) and great difficulty implementing hashmap iterators that act like pointers.

Nonetheless the cheat sheets largely do not reflect these issues, but the breadth of functionality C++ supplies. span and string_view are simple and elegant (aside from lifetime errors caught by Rust). Personally I think algorithms try to do too much, and it's not like other languages could cram in binary search, heap algorithms, reduce, scan, permutations... in a "simple, intuitive fashion", though duplicate functionality between iterators and ranges is a problem. Arithmetic conversions and promotions were a mistake (inherited from C) though, and lambda captures and mutability are complex. Reference collapsing has a simple slide but confusing semantics. I'm not sure I see any structured bindings either (these interact poorly with lambda captures lol).

Re:C++ Cheat Sheets by ho_schi on Monday March 07, 2022 @02:33AM (#30585127)
Feels fluid for me :)

C++ overs all kind of high-level features and allow to go low-level when need. I know the core stuff and what I use regularly in addition. Will likely never learn all possibilities of C++. I don't think that is neither intended nor possible. The compiler does know all that stuff and according to my knowledge that is its purpose. Compiler, the best friend of the developers. Nowadays the compilers talking most of the time in clear language ;)

Re:C++ Cheat Sheets by tjoff on Monday March 07, 2022 @01:50AM (#30584891)
Everything is simple once you know it. The struggles I have with python would be hilarious if it wasn't so frustrating.

Not saying that C++ isn't much, or has lots of baggage.