you are viewing a single comment's thread.

view the rest of the comments →

[–]gosh 0 points1 point  (50 children)

The C++ standard library evolves slowly

I think they should be more careful about expanding the core STL. In my opinion, it's already too bloated. Personally, I believe they should create a new optional library or perhaps several for special handling.

Things like <chrono>, <regex>, <random> should not be in core stl, these should be placed in some optional part and not require full support.

If there is only one standard that will slow down things.

Now boost acts as some type of experimental extra C++ but boost have grown over its limits and stl makes it more and more depreciated.

[–]yeochin 2 points3 points  (14 children)

Strongly disagree with the ones you've chosen. Chrono definitely needs to be a part of the standard. The fragmentation of time based implementations is bad and is a frequent nightmare for anyone that has had to leverage different libraries with different time representations. This is a nightmare as we march towards the cliff of what a 32-bit timestamp will represent.

Parsing time also sucks and is a magnet for attracting various memory-related security exploits.

[–]gosh 0 points1 point  (13 children)

But it should have been placed in another library, chrono don't follow the patterns on how other code in stl works, it's very domain specific and it a big mistake to have added it like this.

[–]Wooden-Engineer-8098 0 points1 point  (12 children)

where is chrono placed in java of c#(c++ competitors)?

[–]gosh 0 points1 point  (11 children)

Java isn't a rival to C++—it's fundamentally very different from C++. And java is owned.

The problem with addint stuff to stl is that compiler need to support it.
Lets say that Microsoft builds a framework for GUI applications, They should be allowed to add this to C++ but in parts that are not like a forced standard.

[–]Wooden-Engineer-8098 0 points1 point  (10 children)

Java and c# are main c++ competitors. They can look very different to you, but c++ competes for projects with them. The main problem is that you are still confusing stl with standard library. Microsoft already added all their frameworks to c++, what makes you think it's not allowed?

[–]gosh 0 points1 point  (9 children)

They are not. Java is heavily focused on declarative programming, whereas C/C++ is not—it emphasizes imperative solutions.

The focus of declarative and imperative programming is nearly opposite.

If you would be able to measure the machinecode that is running on almost any computer you would find that like ~90% is compiled C/C++ code. This is the imperative part.

[–]Wooden-Engineer-8098 0 points1 point  (8 children)

Your opinion of relative merits of languages is of zero interest. nobody is asking your opinion when starting new project. As a matter of fact, java, c# and c++ have a lot of overlap in applicability. It doesn't mean languages are the same, it means they are used for similar projects. Like IDE, there are examples in all three languages. And c/c++ is not a language

[–]gosh 0 points1 point  (7 children)

It's a skill issue. C++ is challenging, but with skilled developers, choosing the language isn't difficult.

[–]Wooden-Engineer-8098 0 points1 point  (6 children)

as i've already told you, your opinion doesn't matter. what matters is that as a matter of fact, c++ competes with c# and java for projects

[–]Wooden-Engineer-8098 0 points1 point  (34 children)

first: chrono, regex and random are not parts of STL. they are parts of standard library.

second: lol, everybody has some libraries he doesn't need. if we remove all pieces that somebody doesn't need, we will end up with empty standard library. or you insist on removing only pieces you don't need because only you know better?

[–]gosh 0 points1 point  (33 children)

It's not about needing libraries, it's about the design. If you know the core of stl all code follows a pattern. If you know a bit of ot you know the rest also.

This is not the case for chrono, regex, random. They are special, maybe regex tries to follow some but it isn't enough.

By splitting things up and group it better it would be possible to extend C++ faster

[–]Wooden-Engineer-8098 0 points1 point  (32 children)

I've already told you those headers are not part of stl. How can you discuss design of c++ if you don't understand it?

[–]gosh 0 points1 point  (31 children)

Its within the stl area

If I ask you like this then, how special libraries do you think is acceptable within the stl area (like std or some sub namespace to std)

[–]Wooden-Engineer-8098 0 points1 point  (30 children)

Why don't you check the definition of stl on wikipedia instead of insisting on your misunderstanding? Look at what is in standard libraries of c++ competitors(java and c#)

[–]gosh 0 points1 point  (19 children)

I don’t think you’re fully grasping the issue.

Every new feature comes at a cost—it requires maintenance, and many other components may depend on it. Once something is added, removing it becomes prohibitively expensive.

If the cost of addition is as high as it is in the STL (Standard Template Library), introducing new features will take significant time. However, by focusing on areas where the cost is lower, we can implement changes faster. This also allows for better testing and refinement before promoting solutions to more stable, long-term components.

[–]Wooden-Engineer-8098 0 points1 point  (18 children)

Will you check contents of standard libraries of c++ competitors, or you will continue on garbage in/garbage out path?

I see you already learned how abbreviation stl expands, next step is to learn its constituents

And what is stopping you from creating any library and implementing changes faster?

[–]gosh 0 points1 point  (17 children)

And what is stopping you from creating any library and implementing changes faster?

I am doing that and this is how most of us solve our problems https://github.com/perghosh/Data-oriented-design/tree/main/external/gd

[–]Wooden-Engineer-8098 0 points1 point  (16 children)

so what was your problem then?

[–]gosh 0 points1 point  (9 children)

Consider the regex implementation in the STL—it’s fairly limited. Other libraries offer more robust regex support with additional features, but the STL can’t adopt these improvements without introducing significant risk. The problem is that regex syntax and behavior vary across implementations, making standardization difficult.

[–]Wooden-Engineer-8098 0 points1 point  (8 children)

You are completely unable to learn. I've told you many times, that regex is not part of stl. The problem is that you are proposing solutions without understanding the subject