C++ is a horrible language. It's made more horrible by the fact that a lot

C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)

- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.

Other urls found in this thread:

en.wikipedia.org/wiki/Compiled_language
twitter.com/NSFWRedditVideo

But can C generate prime numbers at compile time? I don't think so.

C fags BTFO.

Isn't it funny how things that get used the most are also hated the most?

C
Windows
Java
Your mom
Etc.

Linus is an ellitist programmer. He deserves to be so.

>C
lol what year do you think this is, grandpa?

we only a bunch of hipsters

There has not been a better compiled language that is as low level yet high level as C. If rust or even golang comes close I will accept it but they are just so far behind C

Java hatred is a meme spread by microsoft shills to promote C#

>rust
hahahahah and he keeps spouting memes

t. pajeet

epic

5 rupees have been deposited to your C# promotion campaign, rajapajeet. Thank you and keep doing the needful.

>- infinite amounts of pain when they don't work (and anybody who tells me
>that STL and especially Boost are stable and portable is just so full
>of BS that it's not even funny)

I didn't write C++ when this was written, so I don't know how true it was.
But now, it works great, it is efficient, easy to read, easy to write and gives you a good balance of control and abstraction.

>- inefficient abstracted programming models where two years down the road
>you notice that some abstraction wasn't very efficient, but now all
>your code depends on all the nice object models around it, and you
>cannot fix it without rewriting your app.

That might be true for some applications, but I don't think it is true for all.

If that's the case, I'm glad it happened because C# is comfy as fuck and I'm not looking back.

Thanks, shills. You were useful this time.

Stop samefagging

point nr two hit home.
Been working on this project for three years, and ive rewritten the whole thing a total of seven times already. Fuck this.

Rust

Why can't there be lang with stable ABI like C but that's not actually the js of the seventies.

They're figuratively literally the same language

I think C# and Java are closer to each other than either of them is to C, or C to C++

Other than the standard libraries I mean, but even those always have equivalent classes and methods.

>hating C
This is the biggest red flag for me of a terrible programmer, nay, person.

Why don't you create it?

C is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of java were to do *nothing* but keep the C programmers out,
that in itself would be a huge reason to use java.

In other words: the choice of rust is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C over literally any other language is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
C leads to really really bad design choices. You invariably start using
the "nice" language tricks like macros and pointer arithmetic and other
total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me
that macros and especially pointer arithmetic are safe and portable is just so full
of BS)

- inefficient abstracted programming models where two weeks down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice hacks around it, and you
cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and
portable C ends up to limit yourself to all the things that are
basically available in x86 ASM. And limiting your project to rust means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "pointer" crap.

So I'm sorry, but for something like ripgrep, where efficiency was a primary
objective, the "advantages" of C is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.

Just because c++ has objects doesn't mean you have to use them everywhere for every single piece of shit. I'm always using c++ simply because I don't like implementing basic things like arraylists

Rust is already lightyears ahead of C. Then again, the same was true of C++ even since its inception. C stands for Cancer. Without C, we wouldn't have had all the security flaw, leaks, buggy programs and other garbage the entire industry has forever been plagued with.

It's actually false in all cases. The whole point of objects (and they absolutely successfully complete this objective) is that you can tear them up and reuse them anytime. Exactly the opposite of C where you have to explicitly write ad-hoc checks for the exact equivalent for an object type in every single function that may or may not take that as an argument, thus in C you do in fact get to rewrite everything every 2 days.

There's a reason well-written C programs like the id engines adopt OO methodology throughout (in the id engine case they use a macro system to create objects and inheritance).

C does NOT have a stable ABI. Look it up. It's not part of the standard.

>liking C
This is the biggest red flag for me of a terrible programmer, nay, person. It means they have no clue how to do anything but fizzbuzz.

suck me dick m8

Too bad he's not an elite programmer, that would be a breath of fresh air. Maybe linux wouldn't be such a humongous piece of shit in that case.
>hurr C++ 2 years down the road durr
>what is X

Every fucking overengineered project thought in terms of objects can be implemented with a purely procedural language, given the right structures and functions that fit together perfectly. No cruft, no more stacking of loosely related objects in the name of reusability.

If your project never has any changing requirements and all abstractions are perfect and well-designed before the project starts, and finally, if the project will never be reused or refactored, and never used by anyone else, then yes. Otherwise, no.
>(((right))) structures and functions that fit together (((perfectly)))
What a meme.

I pretty much just code C-style C++. Only C++-y things I do is use vectors/etc and so I don't have to fuck with coding a resizing array or linked list. And fuck classes, they do more bad then they do good.

typedef void (*function_name)(int x);
wow beautiful syntax

it's not hard to learn it

BAN ALL PHONE POSTER

If this is hard for you, how many times did/will you retake intro to cs?

Isn't the"rewriting your code because of wrong abstractions" bit literally the same for every language?

yep, C# is the new vb6 for me

Nah, it only applies to C and BASIC.

I bet you don't even know what this means.
>ctards

It's not hard to learn, it could just be done in a better way (see std::function)

but it actually kind of is, though

>C++ needs a runtime to do this.
lol.

>
>C stands for Cancer. Without C, we wouldn't have had all the security flaw, leaks, buggy programs and other garbage the entire industry has forever been plagued with.
yoy also wouldn't have wangblows or any os for that matter
>security flaws, .emory leaks and bugs are the language's fault not the shit programmers
lmao

>what is X
if you mean the display server protocol, then it's neither a Torvalds project nor part of the kernel

Go isn't a replacement for C though.

There is no reason to subject programmers to unnecessary pitfalls. It is much easier to improve the technology than it is to improve millions of people.

>

>giving you complete control is bad because retards will fuck it up
if someone knows they're too autistic to handle basic memory management they can just not use C

linus wrote Linux and git

all your faggot opinions about anything he says are hence automatically invalidated

OOP as a whole is cancer.

I wonder how he sleeps at night when he has to live with the fact that all C compilers today are written in C++.
Even more, they hit a wall some years ago thar they could only climb by switching to C++.
Look at GCC back when it was written in C...

>all C compilers today are written in C++
tcc is in C and there's probably more that are written in C.

Yeah OK I meant GCC, clang and MSVC aka "the ones everybody uses"

>Features that are in C++ but not in C

# God tier
* Templates

# High tier
* Operator overloading
* References

# Mid tier
* Classes
* Exceptions
* Inheritance
* Polymorphism

# Shit tier
* Friendship
* Lambdas
* Namespaces
* STL

>operator overloading
>not in shit tier
give your head a wobble mate

As long as it's not used in ambiguous ways (e.g. + for arrays or * for vectors) there is nothing misleading, useless or overcomplicated about it. I prefer u + v over vector_add(u, v); not u * v over dot_product(u, v).

># Shit tier
>* Lambdas
>* Namespaces
>* STL

What?

ah yes...the "if it's not abused and only used in a specific set of circumstances" routine....

must be great to have only ever had to work wih the top 5% of software devs

You forgot function overloading.

It's simple, if you see some C++ dev abuse operator overloading, you kill it. The problem will solve itself.

ah yes...I'll hack into his webcam over the internet and see his face and find his location then dial in a drone strike (which will miss because some fuck mixed up the dot and cross products when overloading *)....very good....

>Lambdas
Would have made sense if C++ was dynamically typed, but here the notation is just too convoluted. Being able to define functions inside functions was more than enough.

>Namespaces
It's just a more confusing way of adding CuckLib_ at the beginning of all of your function names.

>STL
Annihilator of RAM, most of it is easy to make yourself in a more optimal way and cout, making a fucking Hello World over a meg on Windows, is fucking stupid.

iostreams aren't a part of STL

But it shares the exact same spirit.

> bitches about substandard programmers
> leaves Dirty COW in for a decade

Shove it, you tubby man-child

>there are people in this thread who shill for languages other than C
Sad!

>two years down the road you notice that some abstraction wasn't very efficient

Or, more commonly, you realize that the abstraction didn't take something into consideration that wasn't important back then, but is important now.

> C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it.

That's true for every language. Let's try it out with JavaScript:

"JavaScript is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it."

See?

How many substandard programmers use C and assembly?

I can't speak about assembly, but I've worked with a whole bunch of substandard C programmers in my career.

When a programmer sucks, he always sucks no matter what the language is.

That language is determined by the particular project. For 10 years I did work in embedded systems and firmware, and it was all 100% C, because that was always the compiler that the chip-makers gave us to use. So in that environment, when we hired sucky programmers, we got the chance to see them suck in C. But I'm sure they would have sucked no matter what language we used.

You're an idiot.

Just because writing a complex program in C is too hard for you doesn't mean there aren't people who can do it.

I've programmed for 10 years--6 with C# and C++, and 4 with C. I can safely say that switching to C was the best choice of my life. C# is still useful but C++ is certainly not now that I can use C. The OO model just *doesn't* work as well as pajeet #1024 would have you think.

># Mid tier
>* Inheritance
Inheritance was a mistake. If I could remove it from C++ and just have Concepts I'd do it in a heartbeat.

yea, security flaws, memory leaks, and bugs disappeared the day managed code run times came on the scene.

I'm not one of those people that are advocating beating two stones together to write a subroutine but shitty, uncaring, non-detailed, untesting programmers will find a way to fuck anything up.

Linus is just saying that in his smug fat fuck way. Think of low level languages as amateur or simpleton filters. Its a "if you can't handled this basic, powerful language with limited features than i don't trust you to write code with me". It's a shitty attitude and a lot of good programmers have it.

OOP fan are always stupid.

can in the preprocessor as it's a turing-complete language

Enjoy your buffer overflows, faggot.

That is why we have documentation.

You should try to use something like eigen. It is a great library that uses operator overloading a lot.
You will quickly see that it works great and the code is easy to read.

>It's a shitty attitude and a lot of good programmers have it.
And you don't understand why?

>X
>Linux
How is your first week in Sup Forums going?

>this is what underageb& believe
lol

>
It's written in C, retard.

>professional fizzbuzz programmer with 10 years of experience
Wow, I thought the expert fizzbuzz programmer meme was just a meme!

Reminder that X uses a cuck license.

Show me a memory leak not caused by a VM in any managed language of your choice. Protip: you can't. Not to mention managed languages are older than C.

Ah yes, Pascal. How I missed you.

C++ is too many languages at once. However, the worst part of it is C.
C is antiquated and ugly, and anyone pretending it is an intrinsically great language which magically manages to be eternally unsurpassed is delusional.
What both of these languages have in common is their prime reason to still exist: they are USEFUL. What a lot of people seem to fail to understand that you can't write something large/relevant in a language that won't be antiquated or conceptually/syntactically inferior to more modern languages. Not because it's harder, but because by the time enough code has been accumulated to even begin forming a monster project (let alone many) the language is already old.

C is not antiquated or ugly. Don't be a retarded webdev.

Often times it is absolutely necessary to compile to machine code. You NEED to deal with pointers. you NEED to be able to do what ever you want with said pointers. it NEEDS to be extremely fast.

here's your options: en.wikipedia.org/wiki/Compiled_language

If you take every language in that list and filter out all the interpreted/bytecode languages and the ones that don't let you deal with memory like C does, what do you have?

nothing. That's why it's still modern. also C is a specification. The language does not get old because it's just a description of a language. Certain parts of C will never change, the specifications can evolve, and implementations will vary. Why should you write a new front end every 40 years?

>this is what ctards believe

you are an idiot and should kill yourself jamal

>not writing a new front end every two weeks
webdev XD

Got that backwards champ. C++ is garbage, written by an idiot(Bjarne Stroustrup). C is small and concise and contains everything you need to write good software, written by a legend(Dennis Ritchie). Keep sucking that dick though m8, looks good on ya.

Lol

I got a question for you guys. I've programmed in a variety of languages with the main ones being C#, C++, Java, and Python. I've dabbled in C for fun but haven't committed since I hadn't really had a reason to. Right now I'm developing a program with DirectX and Qt in C++. Would it be a good idea to take a break from that and learn C through? I thought it was fun when I first tried it. Also, I like to use Qt for a GUI. What do C programmers like to use?

>I'm developing a program with DirectX
KYS

Okay... I'm developing a program with OpenGL then.

ok dude

it gets worse
int (*foo())[8]

function returning a pointer to an array of 8 ints

int (*foo[8])(float f)

array of 8 function pointers that each take a float and return an int

int (*foo[8])(float f)[16]

array of 8 function pointers that each take a float and return an array of 16 ints

There's not really a "learn C" for anyone who knows C++. You already know it.

C is only really useful in three situations:

- You want to write a cross-platform, cross-language library, like libpng or SQLite.
- You're programming for an embedded, resource-constrained environment.
- You're writing a kernel or something similar where there aren't many abstractions between you and the metal.

C++ is only useful in one situation:

- You doing serious game programming. And by serious I mean "out of the scope of something like Unity", which nobody on this board is realistically at.

This is horseshit. C++ is a near superset of C, but C is missing so many features, and proper C++ practice keeps you away from many of the darker corners of the inherited C language and C standard library that no, you don;t _really_ know C just because you know C++.

Granted, if you're at all experienced with C++, C will be a relatively quick study. But saying you "know C" because you know C++ is foolish.