Anonymous
or least surprising
Ludovic 'Archivist'
Ибраги́м
your code is not simple
Yes, if you learn C++ as C with Classes
Anonymous
simple =/= easy
simple to read means simple to parse
Ludovic 'Archivist'
Anonymous
if it is simple to parse it is also simple to optimize
Anonymous
completely false
name one instance this is false
BinaryByter
BinaryByter
Anonymous
look at gerlang 3.0
from a C++ point of view
Ludovic 'Archivist'
TCL_new(8) this typical code from the TCL interpreter is a good example
BinaryByter
BinaryByter
besides, easy to parse != good
Anonymous
Still nope
i want an instance of this from C++ point of view because a big issue here is that these compilers do not have good optimization techniques
BinaryByter
any compiler will do stuff differently
Alignant
Why nobody suggested it? No C# guys over here? void Write(const std::string& str) { std::cout << str; } void WriteLine(const std::string& str) { std::cout << str << "\n"; }
Anonymous
C++ has compile time evaluation of arbitrary code, unlike C
C does it is called definitions and macros
Anonymous
however the thing is the thing you are evaluating is literally a const string
Ludovic 'Archivist'
C does it is called definitions and macros
C++ has those, but more importantly compile time evaluation, real one
Ludovic 'Archivist'
BinaryByter
C does it is called definitions and macros
"Sorry we only sell right foot shoes, but i'm sure that you can cut your left foot in shape to fit into our shoe"
Anonymous
it is easier and simpler from both perspectives to just USE THAT
Anonymous
C++ has those, but more importantly compile time evaluation, real one
these are harder for the compiler as they have to interpret that code
BinaryByter
Ludovic 'Archivist'
these are harder for the compiler as they have to interpret that code
no, because ways to interpret that code do not imply guesswork of what can be done
Alignant
So, guys... is C++ faster than C if we didn't use things like exceptions a lot?
BinaryByter
btw: exceptions are good
olli
no
Anonymous
interpreting code is harder then parsing and adding a single AST entry
olli
there are equally fast
Ludovic 'Archivist'
So, guys... is C++ faster than C if we didn't use things like exceptions a lot?
remove exceptions and virtual inheritance and C++ beats C any day
olli
in runtime
Anonymous
BinaryByter
no
C++ encourages a faster programming, so I count that as a yes
BinaryByter
Ludovic 'Archivist'
however this still takes time to interpret that code
Time on compile time, not at runtime
Anonymous
Time on compile time, not at runtime
BUT IT IS HARDER FOR THE COMPILER
BinaryByter
Time on compile time, not at runtime
runtime happens many times, runtime once
BinaryByter
BUT IT IS HARDER FOR THE COMPILER
LEAVE YOUR JOB AND GO TO UNI
BinaryByter
where?
std::string::size() <-> strlen
Mdex Community
Anonymous
which is why the simplest solution static const nl= '\n'; is better
olli
std::string::size() <-> strlen
that's no fair comparison
olli
you can build a struct as well
Anonymous
from BOTH PERSPECTIVES
BinaryByter
that's no fair comparison
You can, but it's not encouraged by the mindset
Ludovic 'Archivist'
BUT IT IS HARDER FOR THE COMPILER
man, go back to school or i don't know, you are in the tenth decile of C and C++ developers, you should just go back study CS
Anonymous
LEAVE YOUR JOB AND GO TO UNI
i actually get over 90% in most uni courses and it is one of the top 10 ones in my province here
Alignant
BUT IT IS HARDER FOR THE COMPILER
Compiler doesn't mind doing hard work :D
Anonymous
C++ is better option
Anonymous
olli
You can, but it's not encouraged by the mindset
that's not even the same problem. Look at the definition of strlen and std::string::size()
Anonymous
it is not versatile at all
it is more then enough
Ludovic 'Archivist'
Compiler doesn't mind doing hard work :D
Exactly, moreover when it is well specified work
Anonymous
simple is better here
BinaryByter
but okay
BinaryByter
I get your point
BinaryByter
but in practice, you will tend to write faster code in C++
Ludovic 'Archivist'
IT TAKES LONGER TO COMPILE
If compilation time matter to you, you belong in a school
BinaryByter
Anonymous
If compilation time matter to you, you belong in a school
have you never had projects where the compilation reached over 10 minutes?
Anonymous
because i have
olli
but in practice, you will tend to write faster code in C++
no, by looking at your code of course not. You would never memcpy an array. you copy a vector
BinaryByter
because i have
what a crackpot are you?
Ludovic 'Archivist'
simple is better here
your "simple" imply eventual type convertions between locale faucets
Anonymous
opencv literally takes 30 minutes minimum
Ludovic 'Archivist'
Which is why i name it "easy"
Anonymous
PCL is a shitshow
Anonymous
when it comes to compile time
Anonymous
we literally would leave that compiling over night