Sourabh
Well guys, I am not telling that universal language to be as easy like if I instruct to create a calculator it will create a calculator. I mean it should be simple in granular level like operations etc...
Aquib
JIT
Just in time what??
BinaryByter
Any examples
too lazy, just google "java faster than C++"
BinaryByter
BinaryByter
Thats what python does
BinaryByter
POSH too, iirc
Aquib
Just in time will be slightly slower almost always
Aquib
It depends on prediction
BinaryByter
Once that barrier is passed, you have normal speed
BinaryByter
JIT can have benefits
Aquib
Java virtual machine is good after the warm up
Aquib
Once it's running fairly long enough to do branch predictions
Aquib
This argument can run all day without conclusion
BinaryByter
Lol no, you are not getting my point
BinaryByter
java doesnt outperform cpp "all day"
BinaryByter
It will be as fast as C++ in normal situations
Aquib
https://stackoverflow.com/questions/36198278/why-does-the-jvm-require-warmup
Aquib
It will be as fast as C++ in normal situations
I just meant c++ will have an edge
Aquib
Because java compromises on being run on a VM
BinaryByter
but not always
BinaryByter
there are times where a naively compiled cpp is söower than java
BinaryByter
Compiling for the current cpu should fix that
Aquib
there are times where a naively compiled cpp is söower than java
Naive c++ code has potential of becoming disaster
BinaryByter
I said "naively compiled"
BinaryByter
Meaning that its compiled for any CPU of that arch
Aquib
Example c++ allows copy of large objects if not passed by reference
Aquib
Java handles it will
Aquib
Well*
BinaryByter
Example c++ allows copy of large objects if not passed by reference
Every object will be copied if not passed by reference
BinaryByter
Depending on what you need, thats good
Aquib
Not if you delete copy construction ;)
BinaryByter
what happens then?
Anonymous
what is the best username fo C++ dve's?😐
Aquib
Then you can't pass by copy
BinaryByter
Then you can't pass by copy
I had expected something worse 🤔
Aquib
I had expected something worse 🤔
Copy construction of deleted in a lot of places
Aquib
Like io stream classes
Aquib
You should not be able to make copy of streams
BinaryByter
but i neber had the need to because im not a pleb
Anonymous
Please always try to make program easily readable... don't make complex program to confuse others
Aquib
Could have used using namespace
Anonymous
vehlwn is a showoff ^^
Yeah...you are right.. Bcoz program problem is so simple..he make program look complex
BinaryByter
using using namespace is a bsd example for beginners
Aquib
using using namespace is a bsd example for beginners
You can use using declarations individually
Aquib
Code clarity matters
BinaryByter
Code clarity matters
std::cout is clearer than cout, IMHO
BinaryByter
Bsd?
bad
BinaryByter
std::cout is clearer than cout, IMHO
imagine another lib having a cout... you know the drill ;)
Anonymous
Write a program that receives N numbers from the input and the largest number among the numbers received Print😐🤦‍♂️
1 solution is Input size from user Make array of that size Input elemnts in array Sort them in ascending order Print [size-1] index element
BinaryByter
BinaryByter
but not using namespace std;
BinaryByter
+ IMHO thouse 5 chars are not that big of a deal
BinaryByter
+ they add clarity
BinaryByter
in the end, ill addhere to the coding style of the team I work with
olli
one thing to keep in mind when one uses using statements is ADL
Xavi
Will u help solving a problem?
Pavel
Will u help solving a problem?
it depends on a problem
Xavi
Xavi
Xavi
Question 1
Xavi
Its logical error
Anonymous
Yes
Xavi
Maybe in sort function
Anonymous
You are mca student
Xavi
Btw i m new to programming. I will appropriate if u people help me out
Xavi
How do u know?