C++ is an incredibly powerful language. All languages that aren't C or C++ is implemented in some way in C or C++

C++ is an incredibly powerful language. All languages that aren't C or C++ is implemented in some way in C or C++.

Brainlets are just scared of the natural selection process that is C and C++.

Attached: 1403220299266.gif (474x584, 835K)

Other urls found in this thread:

github.com/cretonne/cretonne
github.com/redox-os/relibc
github.com/rust-lang/rust
github.com/redox-os/redox
erlerobotics.gitbooks.io/erle-robotics-cpp-gitbook/content/
twitter.com/NSFWRedditImage

Functional programming maths phd 300k

Does it still need prototypes and header files despite the fact the compiler should be able to make them for you?
That, the reliance on C libraries (needing to always convert strings to char* to get anything basic done) and the fact arrays don't keep track of their length made me drop the
Probably a few more reasons I'm forgetting, it's been a while.

*drop the language.

Pypy is implemented in python you faggot
Fucking state of Jow Forums

>Does it still need prototypes and header files
yes it's a feature
>That, the reliance on C libraries (needing to always convert strings to char* to get anything basic done)
or do you want something that takes 50 lines of boilerplate code to call a shared library
>and the fact arrays don't keep track of their length
std::vector::size what are you talking about

>All languages that aren't C or C++ is implemented in some way in C or C++.

github.com/cretonne/cretonne
github.com/redox-os/relibc
github.com/rust-lang/rust
github.com/redox-os/redox

A full rust system

oh the horror

non-existing support.

Attached: lol.png (1905x962, 42K)

>>and the fact arrays don't keep track of their length
>std::vector::size what are you talking about
That's not an array that's a vector.
int arr[] = {1, 2, 3, 4};

How do you track the size? In other languages it's as simple as arr.length.

>yes it's a feature
How is it a feature? It's utterly redundant as you have to write many things twice.
>or do you want something that takes 50 lines of boilerplate code to call a shared library
explain
>std::vector::size what are you talking about
that's not an array

Jow Forums is now a place for people that understand shit about programming...

anywhere better to go? I like to lurk so I promise to not shit it up

sizeof(arr) / sizeof(int)

Checking this get

that's a C array you fucking mongoloid.

>yes it's a feature
How is that a feature?
It's completely motherfucking useless, you have to recompile the whole thing every time you change a data structure.

this is bait.

Literally every language is as powerful as literally any language, because they all are Turing-complete.
What languages compete in is verbosity, how easy it is to change shit and how sane it is to write it, the amount of alien symbols like [({& !value

Or:
std::find_if(v.begin(), v.end(), [](const auto& val){ return val.name == "Bob"; })
To:
_.find(v, val => val.name == 'Bob')

In which language would you rather spend 8 hours a day 5 days a week?

Can you not see how that would be more annoying than just adding a length?

>>In which language would you rather spend 8 hours a day 5 days a week?
the one that i get paid to do because you can actually do systems programming with it

Oh, you're one of... those guys. I hope you at least use C++11.

I dare you to try to avoid using the shit I write in your everyday life

Attached: total.png (334x252, 162K)

*SNAP*

>All languages that aren't C or C++ is implemented in some way in C or C++.

C is basically the whore of programming langauges. Many high language uses it at some point for their compiler needs, because it's more comfy than doing it yourself and C is always "ready to go" and does all the dirty SysCalls that turn developers on without any discussion. But they are also kinda embarassed, because we all know C is old and not exactly what you would call a "beauty" by any standards. So while you could argue that they all had C, nobody is really proud of it.


Funfact: C itself couldn't originally be bootstrapped (stupid language that it is), instead they had to use the B language to mkae it work.

Also there were many languages before C: Smalltalk, Forth, Pascal, Fortran, Lisp, Algol, Cobol.. just to name a few.

Not an argument.

// A2DD.h
#ifndef A2DD_H
#define A2DD_H

class A2DD
{
int gx;
int gy;

public:
A2DD(int x,int y);
int getSum();

};

#endif


// A2DD.cpp
#include "A2DD.h"

A2DD::A2DD(int x,int y)
{
gx = x;
gy = y;
}

int A2DD::getSum()
{
return gx + gy;
}


That's like 6 redundant lines of code in such a short example when it would completely suffice to write something like

class A2DD
{
int gx;
int gy;

public:
A2DD(int x,int y)
{
gx = x;
gy = y;
}
int getSum()
{
return gx + gy;
}
}

>thinks the compiler deals with prototypes and header files

Oh, I just realized you wrote:
>or C++

Mwhahahaha..
>sepples

U for real, mang?

other than the missing semicolon the last example works so you've handily proved yourself false.

t. brainlet that has no idea how arrays work

>you even have to use a precompiler

Not sure if this helps your point, m8ey

yknow you can do that right

Review not passed, changes requested: move function definitions to .cpp file
Reason: I don't want to jump around between files like a retard, gathering bits of information here and there
Headers are headers, they state things, not define it. Anything that doesn't belong to a header should be a compilation error.

that is the length user

Lmao these brainlets dude

Literally just make a macro of that so you can call it like: arrlength(int, arr)

...

No shit but it's more than twice as long as just having the ability to use arr.length.

>just add a macro to add a missing feature

Can you, though? It is ok to put ALL code in header files? If you can I'll do that from now on.
.
Not sure what you're saying. Seperating code in .h and .cpp in the first place makes you jump around.

>they're still arguing about c arrays in a c++ thread
holy fucking shit Jow Forums is dead

The whole point to C is it being as barebones as you can get. Thats why people think themselves so hardcore when they program in it. Its like Arch/Gentoo of the programming languages.

yeah you can do that. of course if you put your entrypoint in a .h file you can't really call it a header anymore. But I think you realize that the concept of header and source files aren't intrinsic to c or c++ and you're just trolling at this point.

do you not use autocomplete?

Attached: 6gtkl.jpg (480x480, 68K)

Of course I do, ar[autocomplete] .l[autocomplete is still a lot smaller.

I want to start learning C++. Can anybody recommend me good .pdf book to read? Preferably with many exercises.

Attached: 51KEqIsBa4L._SX370_BO1,204,203,200_.jpg (372x499, 43K)

sizeof(arr) will return the size of array pointer, not the whole array. This doesn't work in standard C
>state of Jow Forums in 2018

std::array arr(1, 2, 3, 4);
arr.size();

stackoverflow or anything else inb4 I'm not trolling, this board is done...

put the c_arr_size into your util.h
#include

template
constexpr std::size_t c_arr_size(const T (&)[N]) {
return N;
}

#include

int main() {
int arr[] = {1, 2, 3, 4};
std::cout

>All languages that aren't C or C++ is implemented in some way in C or C++.
Patently false.
I want /prog/ back.

Attached: g is dead.png (590x108, 5K)

There was such a board? Why was it deleted?

See, this illustrates the problem with Jow Forums today. Lurk moar. Duck this shit.

>be proficient in C++
>love the language, feel like I can express myself clearly
>feel lost when using shit like python
Am I a reverse brainlet or something?
My intellect is too great for these puny high level languages.

C is great, C++ is gay.

No, you area basically a code monkey:
You can use low level data structures, but you can't use higher abstractions.
You should work on this.

I prefer building the abstractions myself so they aren't black magic to me. I have a hard time working with high level shit (or rather accepting it) when I don't know exactly what's going on under the hood.
It is sort of a weakness, I admit.

What was your first language? I'm guessing you have baby duck syndrome.

C (sort of, got my feet wet with it), then C# properly, used Haskell quite extensively for university and later I learned C++ which is my favourite since I like high performance computing and vidya dev. Had some courses on low level optimization and that was fun as fuck.

>need prototypes
It doesn't

#define(arr) (sizeof(arr) / sizeof(arr[0]))

Don't fucking ever do this, it can and will blow up in your face.
If you use C++, you should use std::array or std::vector and forget about all the legacy shit left over from C. The amount of shitty "C++" programmers writing in what is pretty much C is just sad.

It does if you have cyclical dependencies. And if you don't, you still need to declare functions in a certain order.

$ cat g.c
#include

int main()
{
int arr[] = { 1, 2, 3, 4, 5 };
printf("size %lu len %lu\n", sizeof(arr), sizeof(arr) / sizeof(arr[0]));
return 0;
}
$ gcc g.c
$ ./a.out
size 20 len 5

Knowing array decaying to pointer doesn't make you expert on C, fucking retard.

the only reason c and c++ exist is because plebs can't into lisp

Attached: 1530991491910.gif (260x320, 1.97M)

arrays are not equivalent to pointers
sizeof is not a function
sizeof treats arrays as arrays and does not decay them to pointers as ordinary function calls

cool

and python is implemented in...

>$300k
>by flashing some gay LEDs on Steelseries devices

Attached: 1510599512209.jpg (960x792, 201K)

Rust is implemented in C++ you moron

it's not

It is

Call me crazy but I actually like header files.
It gives a nice overview of the API and a place to find constants, enums, defines with a clean separation between declaration and implementation.
If it's well written with some comments it can serve as documentation as well.

it's not, only part of llvm

LLVM is C++
What would Rust be without LLVM?
Nothing, that's what

Yes.
I am so far removed from brainlets I don't even understand high level brainlet languages.

And I literally showed replacements for the rust stack that are implemented in rust instead of C or C++. Like the cretonne code generator as a replacement for LLVM and relibc since rust the rust standard library depends on the libc of the platform it targets.

>C
Go on
>Or C++
>Implying C++ is in the same league as C
What did he mean by this?

...

All major C compilers use C++ these days

But is the reference implementation built with these "replacements?" No, it is not, because they don't even work yet and the language isn't even out of beta

do this first if you are a new programmer: erlerobotics.gitbooks.io/erle-robotics-cpp-gitbook/content/

if you are coming from another language you can probably jump right in to stroustrup's book. however, he uses templates and the standard library in examples early in the book that you will have to parse slowly or just skip until you can go back after the relevant chapter has been covered.

Go is now implemented in assembly

Why must C+++ make simple things so convoluted?

>can't handle c++
go back to python you pussy, you are not fit to be programmer. Bjarne was right, only 1% of people like me are fit to program and we prefer c++ naturally.

>>can't handle c++
Never stated that. C+++ is is undeniably convoluted

>MOOOM I can't handle C++

Pypy is Python so... It's also implemented in python
And I know what you're going to say next, it's python all the way down

It does not. You can write idiomatic modern C++ using STL collections that does not look terribly different (on a semantic level) from Python.

But C++ allows you to do really advanced stuff. You can use floating point literals in binary if you need. Maybe 10 people in the world need that, but they write software that millions of people will use.

C++ is a big language. It's a complicated language. It has quite a lot of warts. But it's by far the most powerful language there is. All the top competitors in programming competitions like Google Code Jam use it. It is beating functional programming languages like Haskell and OCaml at their own game in the ICFP functional programming contest. It's used to write anything from the Witcher 3 to software on the F-35.

Attached: cpepe.jpg (609x304, 110K)

>be me
>love C#, Java EE
>learn the Node + React stack
>learn that you can write native modules in c++
>discover the godly combination of native modules for speed, Node.js for scalability, and React for SPA
My life as a developer has never been better.