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

Is it good or is C++ still better?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 26
Thread images: 6

File: 5430905.png (15KB, 200x200px) Image search: [Google]
5430905.png
15KB, 200x200px
Is it good or is C++ still better?
>>
>>59001503
Shut up and code.
>>
>>59002185
Yes, commander
>>
>>59001503
C++ is way better.
>>
Rust is way better.
>>
>>59002185
>code
skid
>>
>>59002185
>>59002282
Kode*
>>
File: forgetit.png (112KB, 327x222px) Image search: [Google]
forgetit.png
112KB, 327x222px
>>59001503
https://www.dice.com/jobs?q=rust&l=&searchid=8430464633690
>>
>>59001503
Wait until there's a second compiler by other people.
>>
>>59001503
It doesn't matter.

This basically >>59002185

People hang waaaaaaay too much in the specific language, and sure you shouldn't port the linux kernel to Python, but other than than just fucking use what you know that can do the job.

Rust is fine but it doesn't matter if you use Rust or C/C++.
>>
lmfao
>>
Poor man's Haskell.
>>
File: girl_coder.png (1MB, 1357x1281px) Image search: [Google]
girl_coder.png
1MB, 1357x1281px
>>59002185
>mfw I code
>>
>>59001503
since rust 1.15 with the ability to export macros through libraries and and the following stabilization of a lot of stuff has been getting a lot better

templates/generics are also heavily used what isn't always the case in c++/java codebases (but seemed to trend more int he last 10 years or so)
i like the way rust handles it and its macro approach in general since i looked into it

rust-bindgen also now has good c++ support since its used in servo to bridge with spidermonkey

if i have to start a new project or library i would probably do i in rust but i don't mind maintaing well organized c++ codebases as well. however if i were looking for a job i would stay away from any c++ job thats in microsoft land and hasn't had a complete rewrite on c++11 like unreal 4 did because i don't want to fix legacy problems anymore (did that when i started working in software, its horrible)

i would say they are.. equal?
>>
>>59004233
I don't understand, a function is supposed to = y. You would just be writing void.
>>
>>59001503
I have been programming in C++ for two decades and I honestly think Rust is probably the best language in the current timeline. I even think Linus would write his kernel in Rust if it existed back then.

No other languages can provide safety, concurrency and speed at the same time. Furthermore C++ is BROKEN for the last 20 fucking years. C++ is utter trash in comparison to Rust.

If you are lucky code like
#include <iostream>
#include <memory>

int main(void)
{
auto p = std::make_unique<int>(5);
auto q = std::move(p);

std::cout << *p << std::endl;
}

will give you segmentation fault. Or the code can crash your whole file with undefined behavior. The Rust compiler tells you exactly what's wrong

C++'s template is fucking broken
struct S {
template <class X> void f() {}
template <> void f<int>() {}
};

--> error: explicit specialization of 'f' in class scope
>okay it won't work in class but not in global scope(?)
struct S {
template <class X> struct Inner {};
template <> struct Inner<int> {};
};

--> error: explicit specialization of 'Inner' in class scope
workaround:
struct S {
template <class X, class = void> struct Inner {};
template <class bullshit> struct Inner<int, bullshit> {};
};

works. but
struct S {
template <class X, class=void> void f() {}
template <class bullshit> void f<int, bullshit>() {}
};

--> function template partial specialization is not allowed
RIP workaround

There are more examples where C++ is proven to be complete trash. C++ and Java only lives because of the amount of legacy libraries. Otherwise, as a language Rust is so much better.

wait
template <class X> void f(X x) {}
template <class X> void f(X* x) {}
works but
template <class X, class Y> void f() {}
template <class Y> void f<int, Y>() {}

BROKEN
>--> function template partial specialization is not allowed

20 years of retardation.
>>
>>59006737
I just care about three things.
Does it compile quickly?
How does it handle library dependencies accross platforms (linux, windows, etc)?
Do they have a build system that isn't a pain in the ass?
>>
>>59001503
I don't even see the point of Rust. It's mostly just trying to be a poor dialect of OCaml.
>>
>>59006777
>Does it compile quickly?
Rustc has an llvm backend. Golang compiles quicker due to it's clear instruction on packaging. However compiled binaries of Go is slower
>How does it handle library dependencies accross platforms (linux, windows, etc)?
Cargo is amazing
>Do they have a build system that isn't a pain in the ass?
Cargo is truly amazing
>>
>>59005234
It works the same way as Ruby, the function returns the value of the last command.
>>
File: 1464991894069-1.png (80KB, 329x306px) Image search: [Google]
1464991894069-1.png
80KB, 329x306px
>>59006803
Well said.
>>
>>59006737
C++ BTFO
>>
>>59001503
they are both very good, however rust has no future beyond open source projects unfortunately, it's very hard to learn and it targets mostly with systems programming which is mostly established area
>>
>>59006737
/dpt/'s C toddler are raging for some reason while C++ themselves are muted.

>/dpt/
What a fucking joke
>>
Taking out of context, Rust is way better, but if you consider available libraries, quality of compilers, IDEs, abundant workforce, etc, C++ is better from a production POV, at least for now.
So if you have a large project you pay people to work on, then use C++, but if you want to write some code for fun, use Rust.
>>
>>59006777
>Does it compile quickly?
From my experience, yes.
>How does it handle library dependencies accross platforms (linux, windows, etc)?
Very well. Like >>59006815 said, Cargo works very well at handling dependencies and makes it incredibly easy to work with. Moreover, the compiler is very keen on telling you where you might've messed up, why, and how to fix it on the spot. There are several times where I've tried to compile some Rust code, and made some kind of shitty mistake that would've likely took me several minutes to correct, but the compiler pointed it out and I corrected it in five seconds.
Thread posts: 26
Thread images: 6


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.