[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Help me to choose between C and C++ senpai.
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 35
Thread images: 4
File: 1459089221808.jpg (48 KB, 767x720) Image search: [Google]
1459089221808.jpg
48 KB, 767x720
Help me to choose between C and C++ senpai.
>>
File: 1451304952267.png (28 KB, 158x158) Image search: [Google]
1451304952267.png
28 KB, 158x158
go suck a dick
>>
C++, now fuck off...
>>
>>54340671
Rust
>>
Isn't rust just a meme?
>>
first C then C++
>>
>>54340781
Why?
>>
>>54340671
learn C++ first, using some good book that treats C++ like it's own language (I liked Accelerated C++, but it's outdated now), then C. otherwise your C++ will most look like C with classes
>>
>>54340915
*its
>>
>>54340758
Kind of. It's c++ from a functional programming perspective.
>>
>>54340915
What are the main differences between c++ and "c with classes"? Should you not use structs in c++ for example?
>>
>>54340955
e.g reinventing stl features and using low level or unsafe constructs when there's no good reason to, managing memory the C way, etc.
>>
>>54340671
C++ then C.
>>
C
>>
>>54340758
It's faster than C++, forces your memery management to be safe mostly, and is FP-inspired.
>>
>>54340758
no matter if it's a meme or not, it's really nice to use.

You can't segfault in Rust. You can't get race conditions in Rust. Or you can choose C/C++ where these are something you get every second.
>>
>>54341636
anon, while I share your sentiments regarding Rust, don't oversell it, or you're opening yourself up to horrible ridicule.

It __is__ possible to segfault, have race conditions, etc. in Rust. It's just very hard, and you'll probably have to have some unsafe blocks to make that happen.

That being said, it is significantly simpler to write fast, multi-threaded, and correct applications in Rust than it is in C(++). The "rust is a meme" meme is very unproductive and needs to die.

OP, learn C, then C++, then Rust. It's good to go in order.
>>
>>54341704
>It's just very hard, and you'll probably have to have some unsafe blocks to make that happen.

That's what I meant, you're safe unless you opt-out of it.
>>
>>54341757
This is true, but bear in mind that when using a C/C++ API, you're only as safe as the creators of the API are good.

The Rust stdlib is pretty well done though, so I don't know how often you'd need an external API. Hopefully any major project using a C/C++ API in Rust ships with its own version of the API that passes custom QA and integration tests :>)
>>
File: poop.png (239 KB, 375x549) Image search: [Google]
poop.png
239 KB, 375x549
>>54341636
>You can't get race conditions in Rust.
>race
triggered
>>
What makes C so good programming language?
>>
>>54342959
segfaults
>>
>>54341636
>gets race conditions and segfaults every single second in C++
>thinks he has enough experience to recommend anything to anybody
>>
File: 1462007961051.jpg (25 KB, 399x382) Image search: [Google]
1462007961051.jpg
25 KB, 399x382
>std::cout << "Hello World" << std::endl;
vs.
>printf("Hello World");
>>
>>54343118
You forgot your "\n" :^)
>>
>>54340874
C++ is C
He is joking
>>
>>54340671
>anime
well since you're already a NEET go with C, will suit you well
>>
>>54343118
That doesn't tell wich one would be better
>>
>>54343088
You've obviously never worked on a c++ or c project with hundreds of engineers involved, with greater than a million LoC. YOU can be a great engineer -- that doesn't mean everyone else is. Even the best engineers occasionally make mistakes. The bigger the project, the more mistakes.

>>54343118
>doesn't appreciate polymorphic operators
>>
>>54340671
Learn c++, switching to C should be a breeze while reverse might be more difficult.
>>
>>54343311
>pajeets hired to work on rust project
>every file begins with
 unsafe 


We need an option to disable unsafe code in order to make rust pajeet-friendly
>>
>>54343367
Honestly, I wouldn't be surprised if something similar to this happened.

I guess that target audience of Rust is mainly engineering firms based in good countries.
>>
Are you a software engineer? C++
Are you an electronics engineer? C
>>
>>54340671

c# or c++?
>>
how low level stuff can you do with C++?
Thread replies: 35
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.