C vs C++

Why should I use C++ over C for hobbyist programming?

Other urls found in this thread:

github.com/onodera-punpun
warosu.org/g/thread/57194939#p57201247
twitter.com/NSFWRedditVideo

For hobbyist, stick with Java or C#.
Or with C, if you want 'muh memory management'.
C++ provides much, much more possibilities, but they sometimes are really complicated and need really good practice.

just use python, brainlet.

if you're hobbyist, use this. package management is really nice and you can use stuff you write on linux, windows or mac.

You shouldn't. The main problem with C++ is other C++ programmers. If you're working alone, C++ is far superior.

Because it stops you from wanting to die every single time you need to accept input from the user, do literally anything with strings, manage collections of data, etc.

So you can write template magic incomprehensible to everyone else.

This.
So he should, but not once he's a professional?

Everyone writes C++ differently. Professional C++ is a nightmare.

hobbyist programming in C++ is super fucking fun. Having such a low level language with the ability to make high level abstractions is the perfect combination.

Then again, most people write C wrong, so professional C must be a nightmare as well.

Any more of her images?

I got one other of her and I find it super hot

Does anyone have tips on design patterns in C++? I'm just a beginner but I have no clue how to structure my programs well (mostly for computer graphics related applications).

Computer graphics is a bit different than regular C++ because you're always going to be having to wrap a horrid state machine in objects (well, for OpenGL anyway, haven't tried Vulkan enough to know the proper approach). For this I usually just use a lot of heap allocated objects with constructors/destructors that interface with said state machine and be really fucking careful I don't leak any of them. (Rather than trying to build rule-of-three/rule-of-five move/copyable objects).

Because of STL and Objects. Makes life a lot easier.

How does one write C++ correctly?

Use C++ for RAII, STL, polymorphism, smart pointers. It's not like you wouldn't reinvent the exact same thing in C, only shitty.

Don't fall for her nerdy faux. She's on facebook

Yeah she's not github.com/onodera-punpun for sure

Don't fall for the meme. It's the only set where she looks somewhat good and that's several years old now. She's in her thirties now and balding, aged like milk.

Was she a moderator on lainchan? Do you know her?

doxygen comments in header files
implementation in source files
Avoid writing C

That's basically how I've always felt about C. No matter what you're trying to do, C++ will always have an optimized solution already created in either the standard library or one of the Boost libraries.

Where's the optimized hashmap?

>hot
Like said, she's indeed balding (warosu.org/g/thread/57194939#p57201247 ) She isn't on her 30s but one can be forgiven for thinking so.

"onodera" is a skinny light haired duch boy tho.

C++ for show
C for a pro

Hm ok. He lives about 50km away from me. I don't think she lives in the Netherlands though.

She's from western australia

Thanks bud, would have been cool.

Because it has stl, g++ has better error description, with a bit of OOP you can make your project cleaner, you can arrange your memory de-allocation in destructors, you can use function overloading which will make your project look even cleaner.... And there are 6 gorillion other reasons to use c++.
Also, there are other 6 gorillion reasons to avoid c++1X

She's a total bitch tho. She used to be a lainchan admin, with kalyx and his shenanigans (just look how he scammed appleman after selling him the website, then tried to "steal" the users by making the .jp domain). Then she kept attention whoring on the vola gentoomen room.
Now I think she shitposts on irc on #dprk #plez and sometime on #rice, I don't hang out with these cool kids anymore.

Rust

and she also tripfagged on /fa/ when she was underage

>So he should, but not once he's a professional?
There is no such thing as pro-c++ programmer.
C++ has no coding style and rules that apply on projects.
C, otoh, does and that's why it is much cleaner and prefered by, e.g. linux.
Every c++ project follows a completely different style on what or what is not allowed in the way you program.
In here, i've the feeling that c++ pros are the monkeys that adapt sooner the new features.
In reality a pro, is someone who can make a 40k loc project and still be able, for anyone, to use it and expand it.

If you are making windows forms, I believe C++ is better. Otherwise, use C.

Go hang yourself, pedo.

disgusting hairline indeed

I have a nude of her

Seen her irl. She's weird asf on IRC. Come to think of it, everyone from lainchan was kind of fucking weird on IRC.

also emacs is gross :^))

Use Rust. It replaced all of the languages mentioned in this thread.

This. Python is the way to go if you want to write up something quickly.

pip install

More info on computer girl?
[spoiler]years of university surrounded by sweaty males has taken its toll on me, seeing any girl with a think pad is magical to me[/spoiler]

Any reasons why OP should use Rust?

It's the future. It's objectively better than both C and C++, having the same low level power while providing high level features, safety, simplicity, and elegance. It replaces C#, Java, and Python for the same reasons. It's the best there is.

lol

Can straight white males use it?

>some marginal advantages and cosmetic features vs 20 years old codebase of probably everything

What did she mean by this?

Yeah all video games are coded it rust. Made c++, Java, and programming shaders in c obsolete. My DAW was even programmed in rust...

That 20 years worth of old crap is the problem.

I said it's the future, not the past.

It has zero elegance.
There is nothing elegant about their moronic lifetime system and .unwrap(), .Ok(), .expect() everywhere because some retard decided that literally every fucking thing should be wrapped in obligatory error handling for no reason.

Stop this bullshit about it being elegant.

Error handling with Result is a million times better than C++'s try-catch nonsense.
>hiding execution paths and return values is a good idea
Complete nonsense.

at least with try-catch YOU decide where things should throw errors and where they should be checked.

almost everything in rust's standard library requires you to check for errors for things that will NEVER happen. I wrote a toy program in rust and unwrap(), Ok() and expect() were at the end of almost every fucking function call.

function f takes x and returns y with field z
how is it reasonable that I should have to do
f(x).unwrap().get_z().unwrap() just because there is some one in one trillion chance that something might go wrong TWICE in that line?

I can tell that you write shitty code. You're the sort of person who puts one try-catch block in main and thinks he's done thinking about errors.

Errors are values. Deal with them. Exceptions hide errors and make it harder to reason about whether or not code will work or if it will invisibly fail.

it's almost like Rust is concerned with safety or something

You would be wrong to think that.

I agree that errors and exceptions are important, but if I am writing code to write to a file, why do I have to write exception catching code 4 or 5 times, once per function call, rather than put a try-catch around the block where I write to the file that will warn the user with something useful like "Failed to write to the file" rather than have to write 5 different error messages and pattern match over every result?

You sound like you haven't used Rust.

>why do I have to write exception catching code 4 or 5 times
You don't. You write one handler function and call it on or_else. Or you just return the error early if you don't care about handling it here.
Same shit as with exceptions (catch it, or let it propagate down the stack) except now you can actually see what the fuck's happening and it isn't implicit and hidden.

>emacs
bitch is dead to me

The way I autisticly write it. everyone else is wrong.

what is wrong with the try catch paradigm?
It is much safer than goto FAIL, just as easy to implement and you can easily setup a very flexible system or track down errors that isn't handled.

Most languages don't use checked exceptions, is the problem.

Why avoid c++1x?
Also I read many times that deallocation of memory in destructors leads to memory leaks.

So you think that because you can have an empty catch statement, every catch statement is empty?
If you assume the programmer is lazy, why not assume they don't catch it at all and just use it as a nicer way to print what was wrong and why the program failed?

There's syntactic sugar for error propagation in Rust. Literally add a couple of question marks and only handle errors at the appropriate level.

This is nothing to do with empty catch statements though. You can ignore an error Result in Rust too.

All I want is to be able to know what effect a function will have on my program by looking at its signature. Result types let me do that. Checked exceptions also do it to a lesser extent.

Girls in a man dominated field often turn to be huge sluts. This is especially true in engineering and computer science as they are surrounded by a lot of sweaty beta orbiters, constantly being given attention, special treatment and basically praised for using a text editor.

Personal projects = LISP + Emacs

That's a man baby.