Why the fuck does all C look like witchcraft

Why the fuck does all C look like witchcraft

Attached: niggy AAAAAAAAAAAA.gif (255x255, 363K)

its not witchcraft just people making it intentionally convoluted.

C is simple. C++ however looks like dogshit.

Haha funny
This is how you separate actual programmers from the commandline calculator tutorial brainlets

Don't take github as an example of proper formatting.
There're some neat code formatting programs that can make that shit look like pixelart.

What's so hard to understand about
char O,o[];main(l){for(;~l;O||puts(o))O=(O[o]=~(l=getchar())?4

C is such a simple, elegant little language. You can learn every one of its features in a matter of days.

Attached: 1546158466500.png (1000x1400, 1.31M)

Yeah until you trying using libraries, which you need to do for any real project.

C# doesnt have this problem

Fuck off wintoddler

>Why the fuck does all C look like witchcraft

ur jus dum desu

but user, im programming with c# on linux :(

You think C IS WITCHCRAFT you should look at Perl ...

You've got to admit all the :: things scattered around in C++ code make it look like crap compared to good old C.
t. actual programmer who uses both languages.

An actual programmer have gotten used to :: by now. Nice try.

Attached: 1515765226845.png (515x300, 107K)

C: library_type_method(&instance)
C++: instance.method()

#include

int main(){
for(int i=1; i

How is that worse, you brainlet

> Trying to do OOP in C
Dumbass

>if(i%3==0 && i%5==0){
your job application is going straight into the compost heap.

RTFM

#include

int main(){
for(int i = 0; i

Attached: retroterry2.jpg (600x900, 191K)

why

your job application is going straight into the hands of the company CEO.
What's something that any positive number divisible by both 3 and 5 has in common?

So like literally every language other than what? Assembly, or languages no one seriously uses like brainfuck?

You always need to learn libraries unless you are building everything from scratch. This does not detract from the fact that C is simpler than many newer languages.

A valid argument might be: that with C you need to understand and avoid undefined or undocumented behavior. Many higher level languages tend to either fail during compilation or fail fast during execution instead of the wacky behavior C can give, or they are dynamic langs where you should be aware that anything can get garbage passed in at any point.

One of the major issues with C++ is that a given task can be done so many ways that devs tend to find their favorite approaches and use them for everything. C tends to be more readable in many cases.

Why the fuck are you a brainlet

becuase the language itself is simple and people need to perform witchcraft to make it usable for anything a bit more complicated than fizzbuzz

literally everyone does this with C, even the linux kernel does this

>::
>this
>this.this.Class.CLASS.cancer
>private void my dick
>const aids std
Yeah. C++ is just so readable and intuitive.

>char O
>O[o]
0/10, try harder

Not him, but I don't like including magic numbers like 15

Then don't.
if(i%3*5==0){[\code]

Your application will still be rejected, but they'll actually send you an email saying so instead of leaving it out in the open.

Yes. It is.

Why would they care so much about you putting 3 * 5 instead of 15? I'm genuinely interested.

yeah until you have to manage memory allocation, object, pointer, data type and shits manually
hell even printf('%s\n', 123) causes segfault

>private void
Confirmed never actually used c++

it's meant for wizards

Namespaces are actually really helpful.
The way we use them, you can instantly see library::path::to::function and you know where to look for more information.
Removing the namespaces are way worse.
The "this" keyword is rarely used in my experience. Try writing python or Java and it is everywhere.
For a lot of scenarios, you can leave keywords like const out and it will be fine. It helps your compiler to call you a moron, but that's it.
It is fine and easy to read.

The only scenario where c++ is hard to read is when someone abuses inheritance so much you need a map to figure out where the code is written.
But those are considered bad libraries.

It's probably because you have the program do unnecessary operations every time you check it.

kinda like how

string sentence;
scanf( %s, &sentence);
for(int i = 0; i!= strlen(sentence) ; ++i) do_shit() ;


is retarded while

string sentence;
scanf( %s, &sentence);
int imax = strlen(sentence);
for(int i = 0; i!=imax ; ++i) do_shit() ;


is less. but in the case of 3*5 the compiler should optimise it anyways.

As it should.

C++ "unreadable"
void Foo::bar()
{
baz++;
}

foo.bar();
C "readable"
void foo_bar(struct foo *foo)
{
foo->baz++;
}

foo_bar(&foo);

That's not what namespaces are for, dummy. Library prefixes do that just the same.

You use namespaces so you can exploit ADL and using declarations. Imagine having to do this
libfoo_foo_bar(&foo);
libfoo_foo_baz(&foo);
libfoo_foo_qux(&foo);
when you can just let ADL take care of it and do this?
bar(&foo);
baz(&foo);
qux(&foo);

C++ "unreadable"
void foo()
{
// cleanup is automatic
auto bar = ::std::make_unique();
// ...
}
C "readable"
void foo(void)
{
struct A *bar = malloc(sizeof(struct A));
memset(bar, 0, sizeof(struct A));
// initialize instance variables
A->one = 1;
A->two = 2;
A->three = 3;
A->four = 4;
// ...
// many of these things along the way
if (err)
goto cleanup;
// ...
cleanup:
free(bar);
}

You can make this significantly simpler in C, actually.
void foo(void)
{
struct A *bar = malloc(sizeof(struct A));
*bar = (struct A){.one = 1, .two = 2, .three = 3, .four = 4};
// ...
// many of these things along the way
if (err)
goto cleanup;
// ...
cleanup:
free(bar);
}
And of course there's nothing stopping you from writing an init function.

Not to mention that most of this function is fucking retarded anyway
>printf('%s\n', 123) causes segfault
>Trying to pass an integer value into a string placeholder contained within single quotes
Lmao you suck at C

error handling cases would be a better example. you need to put all function calls with return value inside an if, you risk going bald otherwise.
but then the code gets ridiculously unreadable.

>he doesn't know

A lot of preprocessing stuff in header files for compatibility purposes always confuses the shit out of me

Perfectly valid, what's the problem?

Now C, that's a real language

Attached: Screen_Shot_2018-06-15_at_1.30.36_PM.jpg (800x450, 27K)

>thinking this is OOP
poor attempt

>ur jus dum desu
Holy fuck kys stupid otaku fuck

Read some code examples in J. Now that is some witchcraft.

How is that valid in any way

You're braindead

3*5 will be compiled to 15 anyway, but they will think you think they're too retarded to know the answers to their own question.
People with such lofty applications will always be denied.

Do you really deem it hard to initialize something like this?

char * const (*(* const bar(double *, char()[2]))[5])(long long int (*[2]), unsigned int)[]

based Linus

Attached: 95c0685b68db07565fe0979915ac24e7.jpg (661x275, 56K)

If these are problems, then you don't understand the language. All of those are core parts of the language that anyone working in C needs to understand before working in it.

>Linus
>Programmer
come on, we all know he just rices all day and watches SoL anime

recommend me a SoL anime

gabriel dropout

So it segfaults. Many languages crash all the time and there are other ways to fuck up than a crash, I would rather have a crash than incorrect results.

That segfaults because you're trying to pass two integer parameters to printf.

It's response to russian btw. LINUS ARE NATIONALIST

>this many (You)s
didn't expect it, thanks
my point is that C is too low level, not that it's bad
I think OP wants it to be more like some kind of python-tier

C++ is absolute dogshit with retarded features and horrible design choices.
You actually have to be somewhat proficient in the language before you realize this.
The brainlets that cannot even make a template or manage memory are one thing. The brainlets you're working with terrorizing you by removing const tags from your code because
>lol it won't compile
are one thing. The code terrorists working """with""" you, doing indescribably macabre things when accessing std containers are one thing.

But after years of experience you will find a feature which first makes you cry cause you think that you're a brainlet since you can't figure out what is wrong with your code. You dig deeper and deeper and realize that C++ is a fucking mess under the hood, and your problems are actually caused by a fucking const function from std library editing data it shouldn't need to edit. Then you realize that C++ is fucking dogshit and you've wasted your life and time defending this heap of fucking garbage and you start contemplating just killing yourself and building a system that could mail your own severed head to your boss.

I feel this way about shell script, python and ruby.

The only difference between the two is that C++ takes care of everything because it assumes you're a literal retard banging on a keyboard, and C has the courtesy of not making assumptions of your intelligence level and lets you do whatever the fuck you want.
>C++ tards view this as a bad thing

>t. pussy

Upper management material written all over this guy.

I used to write in C in 2012 then I switched to Python and just recently came back to do something in C and holy shit it is completely unusable. Python surely made me lazy but productive. Writing in C is waste of time now for 99% of my use cases

Just combine it with Qt
Now you have C that is more beautiful than whatever kiddie script language you were using.

Attached: 1545234682154.jpg (438x428, 18K)

Qt doesn't have C bindings.

>intentionally write something stupid
>get told you're so stupid it makes people who are just stupid upset
checks out
also "auto" is a thing now. You don't even have to know C++ anymore

Maybe it's because Java also doesn't have this problem

I don't know what you mean, because anytime Ive needed C code, I have never had any difficulty including c libraries and binding them to Qt.

I mean the other way around. Using Qt from C.

>auto is a thing now
If by thing, you mean a code obfuscation tool and always a bad idea unless you are using them in templates.

Attached: 1551847231163.jpg (960x720, 101K)

It's literally python tier
No dealing with types anymore
Is it an int? Is it a string? Just fuck it

Give me an example when you would need to do that, instead of just starting with Qt from the beginning.

Yep!
Nothing better than a dynamically typed api

Attached: 1546986660862.jpg (808x500, 85K)

Oh no I think it's utter trash
You just said python tier and I gave you python tier

That wasn't me, and yes, Python is trash.
It is not even conceptually easy to use, regardless of what people say. The only claim to fame it used to have was
print "foo"
but since 2.x, that hasn't been a thing.

because its trash

this one gets the prize i think

I think the simplicity of C complicates libraries, though, because you have to call certain functions before other ones, or only call this function or this function, and so on. With C++, you can express those kinds of things, so programmers who gloss over your API docs won't fuck it up. YMMV but I like sepples despite its warts.

How does auto give you a dynamically typed API..? That would be std::any, not auto...

You can make C and C++ look either passable or trash. There's a lot of trash written in both.

Take a look at something along the lines of the Plan 9 C source to see what simple C is supposed to look like. Not endorsing Plan 9 beyond that, however.

because you don't understand it

Because C is the witchcraft and necromancer wizard language of choice.

Attached: 1545875501207.jpg (506x506, 67K)

X[Y] Is just syntactic sugar for *(X + Y). So even something like 5[X] works (same result as X[5]).