[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1750837596871868.png (381 KB, 476x795)
381 KB
381 KB PNG
I have absolutely nothing good to say about C++'s direction taken over the past few fucking decades of terrible design choices and historically bad naming conventions of the STL (also tuple is fucking terribly implemented (SO I HAD TO WRITE MY OWN (it's on github btw))).

While I like the overall syntax and the performance I can squeeze out of it while keeping things portable, I can't stand its header/source duality. It is the most retarded and needles thing in this otherwise pretty good lingo.

Also STL's naming conventions are very 1984.
C# is a shining example of good, readable naming conventions and on the point standard libraries implementations.

I'm in the process of rewriting my ginormous game engine from C++ to C# + AOT + my own comptime implementation.
I still think it's the sane way to go about years of years of frustrating double speak because backwards compatibility.

I'm fucking out as soon as all my projects are rewritten (with a few exceptions (qt projects)).

Good bye C++ and good riddancne.

P.S.
Python sucks balls as do Python (((developers)))
>>
I love you anon
>>
>>106805062
>C# is a shining example of good, readable naming conventions
that's just Microsoft in general. Say whatever you want about their software but their naming practices are quite clear. C, C++ and Linux are all stuck in the 1960s where everyone was using 1 or 2 or 3 letter variable names and desperate to abbreviate everything to save bytes.
>>
>>106805062
C is chad tier
C# is good tier
C++? trash tier
>>
>>106805062
So when is your game coming out?
>>
>>106805062
Anon, did you try Vala?
>>
Zig sucks, DLang sucks and Nim sucks, and of course C# sucks.
>>
>>106805295
It's already out (rts) on steam
Won't dox myself on 4chins
>>
File: 1728718185215174.jpg (580 KB, 827x1254)
580 KB
580 KB JPG
>>106805453
I read GNOME and GTK on the website so basically red flags, but I will try it as soon as I'm back home since the syntax looks very good and it compiles to binary.
>>
>>106805062
LLM post?
>>
>>106805457
it turns out everything sucks
>>
>>106805725
No, I wrote it myself, but I reposted it 2 times already
>>
>>106805544
I think gnome abandoned that.
>>
>>106805761
Yeah, but it still works and Anjuta still supports it.
>>
>I<GC PAUSE>have absolutely nothing good to say about C++'s direction taken over<GC PAUSE>the past few fucking decades of terrible design choices and historically bad naming<GC PAUSE>conventions<GC PAUSE>of the STL (also tuple is fucking terribly implemented (SO I HAD TO WRITE MY OWN (it's on github btw))).

>While I like the<GC PAUSE>overall syntax and the performance I can squeeze out<GC PAUSE>of it while keeping things portable, I can't stand its header/source duality. It is the most retarded and needles<GC PAUSE>thing in this otherwise pretty good lingo.

>Also STL's naming conventions are very 1984.
>C# is a shining example<GC PAUSE>of good, readable naming conventions and on the point standard libraries implementations.

>I'm in the process of rewriting my<GC PAUSE>ginormous game engine from C++ to<GC PAUSE>C# + AOT + my own comptime implementation.
>I still think it's the<GC PAUSE>sane way to go about years of years of<GC PAUSE>frustrating double speak because backwards compatibility.

>I'm fucking<GC PAUSE>out as soon as all my projects are<GC PAUSE>rewritten (with a few exceptions (qt projects)).

>Good bye C++ and<GC PAUSE>good riddancne.
>>
>>106805751
Troll post.
>>
>>106805062
I wish more c operators had rank polymorphism
Is there a version of c like this?
>>
>>106805062
> blog post
Still using C++17.
>>
>>106806468
No, but in Nin you can kinda create your own operators.
>>
>>106805728
We are living in a programming languages dystopian world.
>>
>>106805982
you trade some short gc pauses nobody cares about for 90% more complexity and 9000% more issues and bugs.
not very good investment of time in my opinion.
>>
>>106805453
>>106805544
Vala sucks
>>
>>106805062
>SO I HAD TO WRITE MY OWN
this is C++ in a nutshell, kekw. absolutely horrific language. at least C is too retarded to add anything useful so you don't have to compete with stdlib.
>>
>>106805982
I'm not gonna say GC doesn't suck (it does), but honestly, real world usage and modern GCs are not *that* bad. it's 2025, boomer.
>>
File: 1578354913798_1.png (526 KB, 1026x2748)
526 KB
526 KB PNG
>>
There is absolutely 0 excuse for using C++ in 2025 outside legacy codebases. Dead horrible language and anybody who disagrees is fully stockholm syndromed
>>
>>106805244
Good morning.
>>
>>106805982
kek
>>
>>106805062
> ginormous game engine
> in c#
Guys, don't tell this anon about Unity written in C# and used in various production games.

Unless this is just some exercise by OP, nd is never meant to be used in the real world.
>>
>>106808035
Unity isn't written in c#
>>
>>106805205
I can't believe Ryan from Huth & Ryan is here!
>>
>>106805062
#include <shitlang>
#include <boost/basic_feature_one.hpp>
#include <boost/basic_feature_two.hpp>
#include <...>

requires requires { requires NIGGER; } requires requires requires requires

template <typename... Args>
[[gnu::always_inline, gnu::const, gnu::faggot, nodiscard]] noexcept bool cuck() -> { std::chastity_lock(x}; return std::is_male_v<OP>; }

#ifdef WINKEK
obscure workaround because MSVC is fucked
#endif



>*clangd crashes for the hundredth time*
check github issues: "we get day strange random crash issues all day timez but we dun have enough contraybutors"
>>
>>106805062
using C++26 with modules, static reflection and completely ignoring the STL will be godtier programming
>>
>>106807008
>Manually add files to CMake
skill issue
>>
>>106805062
Have you ever read BileBlog back in the day? It assraped Java in the awesomely humourous style you bring with this post on C++.

Please post more. I use C++ for 3 decades now and the shortcomings repeatedly haunt so much, at times I've resorted to C to dump all the baggage.
>>
>>106805728
That's impossible. C exists.
>>
>>106810041
Can't reasonably handle webshit with that, unfortunately.
>>
>>106810529
No, no, no. C is simply beautifully perfect. There can be no debate, a priori perfection, no matter what anyone says.
>>
>>106807869
>There is absolutely 0 excuse for using C++ in 2025 outside legacy codebases.
https://github.com/pytorch/executorch
https://ryzenai.docs.amd.com/en/latest/ryzen_ai_libraries.html
c++ is and will be the real powerhorse of DeepLearning, all the AI infraestructure depends and will continue depending (old a new one) on C++
keep taking your copium.
>>
>>106811279
This doesn't mean C++ isn't complete ass. It's just that everybody and their brother has made an alternative, so none of them have the userbase or level of support needed to supplant the old industry standard.

That and the abstraction level at which C++ exists is just fucked. GC has issues but manual memory management does NOT mix with more complex language features like OO. That's why C is still loved, it keeps things simple enough that manual management makes sense, the user can reason about what's going on. If you want something significantly more expressive than C, just take the hit and use a GC'd language, because anything else you use or invent is gonna have the same fundamental issue. And no, Rust doesn't get around the problem, it just introduces an asinine model to reason (poorly) about it. "Ownership" and "lifetime" - how about I own you and you blow me for a lifetime, pal
>>
>>106805062
There should never have been an STL, there should naturally never have been bullshit like smart pointers, and they should have left the auto keyword alone
Modern C++ sucks
It should just have stayed as C with classes
>>
>>106810529
You can write a custom web app backend in C, no problem.
>>
>>106805728
I've been enjoying Raku for a long while now. It sucks of course but in minor ways I'm willing to tolerate. Bugs here and there in the dominant compiler implementation (Rakudo) but it at least has people actively working on it.
>>
>>106811969
Almost everything about Raku sucks and the lead dev quit. It's dead.
>>
You realize it's possible to write C++ however you want to, right? Use STL or don't, write it like C or use all the language features you want.
C++ will live forever.
>>
>>106805062
>(SO I HAD TO WRITE MY OWN (it's on github btw))).
Link or didn't happen.
>>
>>106811810
biggest retard award goes to this anon. you do not have to use the stl. oh boy i will now implement my unordered_map instead of using a perfectly fine implementation where there are likely zero bugs. smart pointers are just classes that use raii, they are not a new primitive. you are right, why would u want to use auto instead of std::unordered_map<std::string, std::vector>::const_iterator.
>>
>>106805062
>Also STL's naming conventions are very 1984.
What, you don't like std vectors?
You don't like your std cout?
Your std sin?
Your std map?
Your std queue?
>>
>>106813890
I know that you're just shitposting, but I unironically do this, and it works.
>>
>class
the keyword that fucked up programming forever
>>
>>106813890
I don't know why I would use anything but cpp anymore because it can truly do anything.
Don't care if cmake is a pain. I refuse to learn any other tooling unless I'm being paid
>>
>>106814922
If you aren't being paid, why would you even bother with cmake?
>>
>>106805062
herbs

You didn't even name the variants. Fix your image.

C
C centerline aligned H small caps strikethrough
C tic tac toe
C 3d tic tac toe

I take exception here. I was hoping for tic tac toeseract, being pretty into toes.
>>
>>106814313
Why the fuck would you use a std::unordered_map<std::string, std::vector>::const_iterator when you could use an array of void*
>>
>>106816067
>void*
retard, yesterday I declared this:
template <pointer_sized T>
struct [[gnu::packed]] epoll_event
{
u32 events;
T data;
};

And it's fucking beautiful, type safe, unlike cnile garbage. It compiles down to same thing, and justwerks, kill yourself.
>>
>>106816101
>typesafe
got more reddit buzzwords?
>>
Types existed before C, and C was invented by trannies who only implemented void* so they could cast their male body into female body.
>>
>>106816101
You're packing the struct? That's fucking disgusting.
>>
>>106816444
Look at the name of the struct, retard.
>>
IFuckingHateLongNames AndPascalCase
>>
>>106816854
Nobody is stopping you from using snake case in your C# projects. You can even alias existing types for consistency.
>>
>>106816933
yeah, just don't use anything from the C# standard library or .NET
>>
>>106816986
but unironically
>>
>>106816986
>You can even alias existing types for consistency.
>>
>>106817000
yeah, just don't use any methods
>>
>>106817009
Meh, F# manages mixing camel case and pascal case. You'd live. Could always make wrappers if it bothers you that much.
>>
>>106817026
i'll continue not using c#
>>
>>106817041
>ditching a superior language, platform, and ecosystem because some upper case characters trigger your autism
your loss
>>
>>106816101
Intresting, so instead of standardize commonly used attributes now we have specific vendor attributes but with a retarded syntax?
>>
>>106817058
it's all shite
>>
>>106805062
Okay but if you only care about the game you should use an engine and Godot or Redot seem like the go-to solution although you could use JMonkeyEngine or PyGame, it doesn't matter.

If it's 2D it doesn't matter. Use whatever high level programming language you want. It doesn't matter if it's Python, Ruby, JavaScript, Typescript, C#, Java, Kotlin, Scala, Haskell, etc. All those programming languages can do 2D fine. Doing 2D in a low or mid level language like Zig, Rust, C or C++ is a waste of time.
>>
>>106817087
I hate this timeline.
>>
>>106805062
What would the fifth dimensional C look like? What's a good book to learn C 3d tic tac toe?
>>
>>106817087
>>106817119
This was always the case and that LLM response is proof that LLM will never take real programmer's jobs. You fucking retard, the correct way is to
#define PACKED

And use it everywhere with identical syntax, even Linux does this, but that's for cucks, I'm not a cuck, I only support GNU, fuck off proprietoddler.
>>
File: fastcrab.png (93 KB, 1229x862)
93 KB
93 KB PNG
>>106816101
Kek. C++ will never catch up.
>>
>>106817206
Was meant for >>106817087 and >>106817119
>>
>>106817206
Catch up to what? When is f128 going to be stable, lil bro?
>>
>>106817213
There is no proposal to standarize quadruple floats in C/C++, so it will take at least 10 years from now, if ever.
>>
>>106817229
long double is already standard lil bro
>m-muh quadruple floats
I can actually enable them too without having to use unstable compiler that updates daily
>>
File: 1563959638999_0.png (249 KB, 600x600)
249 KB
249 KB PNG
>>106817239
>I can actually enable them
https://github.com/gcc-mirror/gcc/blob/834f34947b20b18696487fc5d2bccab5ea720351/libgcc/config/m68k/fpgnulib.c#L523
>>
>>106811713
Memory management in C++ would be fine if they stopped being retarded about the memory model and shoehorning in every UB they can for compiler developers to wank over. The tools and behavior on the face of it let you build what you need to suit your purpose.
>>
>>106816101
> it's fucking beautiful
Its not, what does pointer_sized mean for example
I mean it's obvious but also not needed
>>
>>106818288
Yeah, upholding ABI wth Linux and blocking wrong sized types is not needed... What other retarded fizzbuzzer opinions do you want to tell me or are we done here?
>>
template <typename T>
struct is_const_impl { static constexpr bool value = false; };

template <typename T>
struct is_const_impl<const T> { static constexpr bool value = true; };

template <typename T>
concept is_const = is_const_impl<T>::value;

template <typename T>
concept is_mut = !is_const<T>;

struct empty {};

template <bool condition, typename T, typename F>
struct type_if_impl { using type = F; };

template <typename T, typename F>
struct type_if_impl<true, T, F> { using type = T; };

template <bool condition, typename T, typename F>
using type_if = typename type_if_impl<condition, T, F>::type;

template <typename T, i64 N = -1>
class slice
{
public:
constexpr
slice(T* const ptr, i64 const len) noexcept
requires (N == -1)
: ptr_{ptr}
, len_{len}
{}

constexpr
slice(T* const ptr) noexcept
requires (N >= 0)
: ptr_{ptr}
{}

template <u32 L>
constexpr
slice(T (&raw)[L]) noexcept
requires (N == L)
: slice{raw}
{}

constexpr
T const*
as_ptr() const noexcept
{
return ptr_;
}

constexpr
T* as_mut_ptr() const noexcept
requires is_mut<T>
{
return ptr_;
}

constexpr
i64
len() const noexcept
{
if constexpr (N == -1)
{
return len_;
}
else
{
return N;
}
}

constexpr
operator slice<T, -1>() const noexcept
requires (N >= 0)
{
return slice<T, -1>{ptr_, N};
}
private:
T* ptr_;
[[no_unique_address]]
type_if<N == -1, i64, empty> len_;
};

template<typename T, u32 N>
slice(T (&)[N]) -> slice<T, N>;

I'd like to see cnile version of this.
>>
>>106819042
What do you need any of that for
>>
>>106819208
You'll figure it out when you're old enough.
>>
File: lilebus.png (360 KB, 512x512)
360 KB
360 KB PNG
>>106819208
>t.
>>
>>106819217
Sounds to me like you just dont know your code well enough
>>
>>106819310
Direct any hallucinations regarding sound to a licensed professional.
>>
>>106819319
Direct your tongue to my asshole
>>
>>106818243
NTA, but I feel like C++ is designed with the most primitive compiler in mind. The APIs are made as if they had 0 trust in optimizations.
Which is very naive because if your compiler doesn't do any fancy optimizations, it is going to cost you way more than having that one non-trivial(as in can't be optimized away) runtime check made to avoid UB in the API.
There is really no good reason to not make your stdlib more safe at cost of few checks that get optimized away 90% of time.
>>
>>106820077
>There is really no good reason to not make your stdlib more safe
safety is fake and a meme theres no safety you can open the computer and shoot it with a gun wheres your safety now
>>
>>106820085
And how is this related to the prevalence of UB in C++ API? Does the UB reflect bullets?
>>
>>106820098
>Does the UB reflect bullets?
Maybe. It's undefined. It can do anything.
>>
>>106820098
UB is synonymous with IQ test and it seems like you're mad that you keep failing them.
>>
>>106820121
>>106820142
Nice technical arguments.
>>
>>106820158
There's not much to say, if we can assume that user is white, we can go very fast, it's like assuming that we're in middle of nowhere, it lets us drive faster than speed of sound with no risk of hitting some retard who ran out into the street.
>>
File: .jpg (110 KB, 500x500)
110 KB
110 KB JPG
Consumer grade cars can go way faster than is legal anywhere on the road.
There are subhumans who want to change that because they believe that safety is better than fuel efficiency and actually having an engine and a car that takes you from point A to point B.
>>
>>106817087
>>106817119
They could implement things on different files and change compilation paths at compile-time.
.
── include
── nigger.h
── src
── nigger
── linux
── linux-specific-niggers.c
── win32
── windows-specific-niggers.c
── portable-niggers.c


But for some reason they don't do this. Oh well.
>>
>>106820321
Well too bad I don't implement for shit OSes so I have no usecase for such setup. This goes without saying when windowns doesn't even have a good compiler.
>>
>>106814897
Not shitposting at all. I love C++ and I love VHDL, only brainlets hate it when the language doesn't hold their hand.
>>
>>106817087
epoll is linux specific. also gnu:: is supported by most major compilers than can output to elf, namely gcc and clang. msvc is so far behind on the specs that it's not even worth mentioning
>>
>>106819042
instead of the no_unique_address, since it's kinda recent, you could simply have the len be stored using CRTP

template <typename T, i64 N = -1>
class slice : public type_if<N == -1, i64, empty> {
...
}

the standard guarantees that deriving empty structs takes no extra storage.
>>
>>106817213
it's unlikely to ever make it into the standard.

if you're on platforms that don't have quad-floats, then you'll have to emulate them. however for most use case you want to use something other than IEEE754 since it's slow to emulate.

for instance https://github.com/ucb-bar/berkeley-softfloat-3
>>
>>106820737
How does that help me and how do I reference this value?
Also I'm using stable version of GCC on Gentoo and it has -std=gnu++23 with which my entire system is compiled and it just works, so don't forget to ask me if I care that some loser doesn't have that.
>>
>>106820910
if you use c++23, then no_unique_address can be used, otherwise you have to add boilerplate:
template<typename T>
struct len_holder { T len_; };

template ...
class slice : public type_if<N == -1, len_holder<i64>, len_holder<empty>> // optionally use plain `empty`, so accessing slice.len_ results in a compile-time error

that's how the standard library prevents empty types from contributing to the size of a tuple
>>
>>106821051
So it's more verbose than what I already have, and pollutes namespace with type that's only used in one place.
Standard library is garbage because it has to compile on ancient compilers and fossil "standards" so I don't care how it's done there.
>>
>>106821071
that's it, if you don't care about older c++ versions, then you can simply use newer features. that said, standard library will always try to use the latest features when implementing new algorithm/functions.

but a lot is there due to legacy, for instance due to c++20's constexpr requirements for a lot of classes, a ton of boilerplace god added:
#if __cplusplus > 201402L
constexpr
#endif
void
push_back(value_type && __x) ...


that said, the standard lib is still high quality, and a lot of features are gated behind it. for instance gcc and clang have compile-time specific functions that speed up compilation a lot, that you can only access in the stdlib:
  template<typename _Tp, _Tp _Num>
using make_integer_sequence
#if __has_builtin(__make_integer_seq)
= __make_integer_seq<integer_sequence, _Tp, _Num>;
#else
= integer_sequence<_Tp, __integer_pack(_Num)...>;
#endif


also, some features, like structured-bindings, you have to put code inside the std namespace, even if you don't use the standard library at all. Stuff like implementing std::get and std::tuple_size/std::tuple_element, even if you never use std::tuple/don't link with the stdlib
>>
>>106821119
>that you can only access in the stdlib:

lol no, all the good stuff is always in compilers itselves and never in stdlib, __integer_pack can be used by anybody.
Also stdlib is limited by standards comittee so it's shit by default, algorithms can't fix bad performance caused by retardation.
>>
>>106819230
unrecognizable
>>
>>106821248
you can access it, but it's not portable. gcc may rename, remove, or modify the behavior of this function in the future. also it doesn't exist on clang.
>>
>>106821691
I'd like to hear the last time something like this has happened.
>>
>>106805206
>naming practices are quite clear
xbox
xbox 360
xbox one
xbox series x
>>
>>106818787
>ABI
Anyway why would you need to block "wrong sized types" just don't use the wrong type.
>>
File: 1759572844844219.png (1.8 MB, 1095x1192)
1.8 MB
1.8 MB PNG
>>106805062
Don't care
I'm programming in HolyC



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.