[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]

What is better than C++? Otherwise I'm going to keep using

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: 75
Thread images: 3

File: 4fb.jpg (66KB, 680x680px) Image search: [Google]
4fb.jpg
66KB, 680x680px
What is better than C++? Otherwise I'm going to keep using C++ because it just works, it's faster/better, and when C++17 comes it will be ten times better than Rust. C++ is already better than "lol scripting, developer productivity, dyanmic" meme languages so don't suggest those.
>>
No languages are all around better than C++. Nothing even comes close.
>>
C#
>>
I found Free Pascal/Lazarus far better for crossplatform. The unit stuff is more organized than header files.

But for serious stuff, C++ is necessary.
>>
C
>>
>>61762572
>when C++17 comes it will be ten times better than Rust
Did you forget to update your copypasta? It's already here.
>>
>>61762572
>lol developer productivity
t. NEET
>>
>>61762572
Stop posting, Bjarne.
>>
>>61763090
I feel for this meme once. It was around the time I was having to manually allocate and deallocate variable length <anything> and perform vector operations with add(a, b) instead of proper operator overloads that I realized I'd been had.
>>
>>61762572
is there anything in 17 that is relevant to developers?
>>
>>61763174
That's part of the fun for me I guess, I get off on writing socket traffic though
>>
>>61763200
Structured bindings are a really nice simplification of a couple situations involving tuples and iterators. std::variant, std::any and std::optional are all nice too, nothing that couldn't be done with a custom class before, but now you have a standard form for it that other C++ developers can be expected to understand.

Think they added some new stuff for variadic templates but I haven't looked into that, never used variadic stuff much anyway.
>>
>>61763200
compile-time static if with the form if constexpr(expression)

UTF-8 character literals

Nested namespace definitions, e.g., namespace X::Y { … } instead of namespace X { namespace Y { … }}

Template deduction of constructors, allowing std::pair(5.0, false) instead of std::pair<double,bool>(5.0, false)


std::string_view, a read-only non-owning reference to a character sequence or string-slice

New insertion functions try_emplace and insert_or_assign for std::map and std::unordered_map

A file system library based on boost::filesystem
^^^ probably the most useful change ^^^

Parallel versions of STL algorithms

std::byte

Logical operator traits: std::conjunction, std::disjunction and std::negation
>>
Lemme give you guys some advice, from sepples fanboy to sepples fanboy:

If you want to help ensure that C++ survives while Rust dies the same slow death that D is undergoing, program in C++.

If your employer is using C++, continue using C++. When contributing to open source projects, use C++. If a project is using D or Rust, suggest switching to C++ (this has worked in the past -- see OpenMW). If someone suggests not using C++, use C++ anyway. Alternatively: sell them on updating the codebase to a more modern version of C++.

If a project you're working on is using C, throw a healthy layer of C++ on top of it. Or, just keep using C. Anything to keep the shitters out.

This will only become easier over time. C and C++ are so mired in the industry that fully displacing them would take a herculean effort. And I'm not even talking about legacy systems like the ones still supporting Pascal. Just look at Fortran -- 60+ years strong and going. I think C and C++ can surpass even that.
>>
>>61763311
Don't worry, I'm working on it.
>>
>>61763311
>>61763126
>>
>>61762600
really? why?
>>
>>61762818
The less compatible Java. Real garbage
>>
>>61763265
>namespace X::Y
oh shit.
People should not throw on a ton of namespaces.
>file system
finally
>>
>>61762572
Are there any books that teach modern c++? Like c++14 and soon C++17?
>>
>>61763474
Why do you think you need more than the documentation?
>>
>>61763368
Every other major language is useless in some area.

Many modern languages simply can't run fast enough for high performance applications.
Even when they can, the garbage collectors can pose a problem for real time applications.
A great number of them can't take advantage of multi-core hardware.
Although things are improving for other languages, C++ still holds the remarkable honor of running on all mobile and desktop operating systems, the web and a significant chunk of embedded devices.
C is simply too obtuse for rapid development of large scale applications.

And then we have C++. The fastest thing around, easy to use, interoperable with C out of the box, runs on damn near anything, you can even plug in a garbage collector if you feel like it.

There are certainly situations where using other languages is better, as much as I like C++ I don't use it for everything. But there is no other language that can be used to club every single problem you will ever encounter to death if you so choose.
>>
>>61763491
I like hand holding.
>>
>>61762572
C++ is NOT faster

C++ that's fast looks suspiciously like C
>>
>>61763491
Not OP but the C++ documentation is the worst documentation of all programming languages.
>>
File: image.jpg (41KB, 329x194px) Image search: [Google]
image.jpg
41KB, 329x194px
>>61763115
It's not fully standard yet, you stupid retarded nigger. Go back to rebbit, small brain.
>>
>>61763661
Strostrup's "Programming Principles and Practice using C++" uses C++14 in the latest edition.

However, if you already know C++ 11, it isn't difficult to get up-to-date by reading the documentation.
>>
>>61763491
I do better with books just personally
It's easier for me to find what I'm looking for and understand what i need to do
>>
>>61763702
I only know the very basics.
>>
>>61762572
Nothing, unfortunately. C++ is a hideous, overengineered, directionless and mangled piece of shit.
It's also unrivaled in its power, and it's sad that nothing has yet replaced C++. D had a chance but then had to go full retard with its GC.
>>
>>61763717
Read the book I mentioned along with articles on http://www.cplusplus.com/whenever you need more clarification.

Here's the book btw https://archive.org/details/2014ProgrammingPrinciplesAndPracticeUsingCPlusPlus
>>
>>61763670
>C++ that's fast looks suspiciously like C
It also has templates and lambdas, which can be better optimized than void* and function pointers.
Faster code can be written in C++ than is possible in C.
>>
>>61763670
First of all, as long as you avoid doing stupid things like abusing shared pointers/virtual functions and not passing by const ref, you're basically going to produce the same assembly that would come out of C.

But more importantly, who cares? The language lets you choose between writing the fastest code available and having an easier time writing it. That's still better than not giving you the choice at all. (And I'd rather write C-style code in a language with modern features any day over using the real thing).
>>
RICHARD STALLMAN
>>
>>61763785
The big problem with C++ is that it's so big and difficult to learn. The majority of C++ programmers only know how to write C++ one way and will stick to it dogmatically, so the choice that you speak of does not exist for them.
>>
>>61763844
That I'll give you. I encounter people who have programmed in C++ and say they "know" it all the time. I almost never encounter people who actually know all of the paradigms the language makes available to them.
>>
>>61763888
>>61763844
>>61763777
trips+dubs of truth
>>
>>61763777
wrong you can write the fastest possible code in c
get a load of this
UINT8 buf[] = { 0x33, 0xc0, 0xc3 };
typedef void(*wew)();
int main()
{
wew w = (wew) VirtualAlloc(0, sizeof(buf), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
memcpy(w, buf, sizeof(buf));
w();
}


name 1 code faster than that
unbelievable speed
>>
>>61763980
What part of this doesn't compile as C++?
>>
>>61763980
...Does this actually work?
>>
>>61764004
U N D E N I A B L E S P E E D
>>61764010
of course, it's x86 though
>>
>>61764010
No, it only works on 1 toy operation systems for children
>VirtualAlloc
>>
>>61764031
>>61764046
Is there a Linux equivalent?
>>
>>61764046
winapi > whatever meme shit linux has, and thats a fact
on linux you could probs just alloca the byte buffer and execute it from the stack, does linux even have NX?
>>
>>61763372
The real garbage here is JVM.
Java is dying of because of Oracle
>>
>>61763265
cool, so now preprocessors may be 3x times slower
>>
>>61764102
What's so bad about JVM?
>>
>>61764052
yeah, mmap
here's another fun meme for you

int main()
{
return __rdtsc() % 255;
}

absolutely the world's fastest psuedo-rng
>>
>>61764031
>of course, it's x86 though

And Windows only.
>>
>>61764281
__rdtsc is an intrinsic, it's 1 to 1 with the cpu instruction, rdtsc, which exists on x86 and x86-64
the original byte buffer was only x86 because i was too lazy to look up the bytes in an x86-64 process
i'd hope that linux can use it
>>
>>61763265
is this a joke?
>compile-time static if with the form if constexpr(expression)
rust already has this
>UTF-8 character literals
rust already has this
>Nested namespace definitions, e.g., namespace X::Y { … } instead of namespace X { namespace Y { … }}
rust already has this
>Template deduction of constructors, allowing std::pair(5.0, false) instead of std::pair<double,bool>(5.0, false)
rust already has this
>std::string_view, a read-only non-owning reference to a character sequence or string-slice
this is just a blatant copy of
&str
, so of course rust already has this
>>61763265
>New insertion functions try_emplace and insert_or_assign for std::map and std::unordered_map
rust already has this...
>std::byte
rust already has this

they are really grasping at straws copying features they're still lacking after decades that rust (a brand new language) has already had working since the start by default.

I mean, just look at >>61763311
Rust is better than C++ for a hell of a lot of applications (obviously not everything since C++ is much bigger) but people refuse to use it for political reasons.

Use the best tool for the job.
>>
>>61765637
bumping so all you idiots see this
>>
File: 1496449737459.jpg (127KB, 600x467px) Image search: [Google]
1496449737459.jpg
127KB, 600x467px
>>61762572
>>61762600
Ada
dont even try and dispute this, it is literally impossible
>>
>>61766208
you're not going to trick people into using shitty language of the month #300
>>
>>61766282
>rust is a shitty language of the month
>*covers ears and closes eyes* blaa bla bla it doesn't matter that one of the biggest players in the software industry is pouring tons of time and money into it and using it in one of the most uses piece of software in the world waaaaa

baka
>>
>>61766324
barely anyone uses firefox anymore lol
>>
>>61766324
>mozilla
>biggest players
who cares lmao
it's just like go, who ha(s/d) another big company behind it
but it's useless
>>
>>61766424
not even Google is using Go for anything relevant.
Servo is the future of web browsing.
>>
>>61762572
depends on what you are doing

language selection is just about picking the right tool for the job
>>
The best:

C

Perfectly acceptable:

C++ avoiding all the fucking stupid convoluted OO bullshit whenever possible

>BUT MAH INSECURE HORRIBLE BAWWW POINTERS NO STRINGS C
Learn to code, noob.
>>
>>61762572
Common Lisp. You get scripting, compiling, interactive, dynamic, typed, objects, metaobjects, macros and procedural and functional programming all in one package.
>>
>>61763717
isn't meyer's effective series the go to
https://edisciplinas.usp.br/mod/resource/view.php?id=1009587
>>
>>61766654
too bad the syntax is dogshit
Ruby + Crystal is what you meant.
>>
>>61763980
>PAGE_EXECUTE_READWRITE
what could possibly go wrong
this is why everyone hates ctards
>>
>>61766969
because you can choose the page permissions?
you do know that you need page permissions to execute code regardless of language, right?
>>
>>61767013
setting a writable executable page is just asking for an arbitrary code execution exploit
>>
>>61766324
> mozilla one of the biggest players in the software industry
ha ha ha.
ha ha
ha

are people really this myopic?
>>
>>61766654
embed lisp in C++ and you can do interactive C++
>>
>>61762572
D is better than C++ --top to bottom.
C was created by Electronic Engineers
D was created by Compiler Engineers
C++ was created by a literal uneducated faggot because C was too hard for him
>>
>>61771106
And D creators are the people who first implemented C++ because Bjarne is not a smart programmer himself. D creators knew, from the very beginning, what's wrong with C++
>>
>>61771069
>hurr if I use words I learned in grade 5 people will think my opinion is worth more than everyone else's

grow up shitlord. mozilla is a major player in the software industry whether you like it or not.
>>
>>61771187
did you freak out on the word "myopic" ? are you american, for the record ?
>>
>>61771187
sure, just keep living in your hn/reddit bubble.
>>
>>61766771
What's so fucking hard about
(function arg arg ... arg)
really?
Think of it as more flexible dot notation.
>>
>>61763474
Why only c++14 and 17? What about 15 and 16?
Thread posts: 75
Thread images: 3


[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.