Javi
I have
Francisco
And I guess you have pretty solid arguments to disagree with him
Javi
I have been giving them
Francisco
And yet none of them was convincing enough
Javi
For you
Javi
You still didn't tell me what you get from: auto v=myfunction(); auto var=v[i]/v[i+1];
Ilya
OK people, if someone don't like auto, at last this is his / her own problems and matter of style, his/her strange style which can be not acceptable in some companies by their coding conventions etc. But arguing here about this is fruitless thing, one will not convince another and each will stay on his own ground. So stop and consider more technical problems
Anonymous
/warn
Anonymous
If you think that they mean the same, it doesn't mean that they really do the same thing
Anonymous
You need to learn what operator precedence is
Anonymous
Can anyone suggest that which library is good to create curl get request in c++
Anonymous
Man, just google what operator precedence in C++ is, and think a little bit
Anonymous
Well, curl?
Thank you
Anonymous
curl
Thank you
Javi
What is the difference between both codes?
Ilya
curl
No, not libcurl. CPR
Javi
They don't, that's the problem
Anonymous
No, not libcurl. CPR
Can you please send me any link for cpr
Ilya
Can you please send me any link for cpr
https://whoshuu.github.io/cpr/introduction.html
Pavel
Is C++ used to make games?
Mostly C++ is used now for making games (but there are lots of engines that allows to write gameplay-specific code on other languages)
Anonymous
Rules of the group??
Artöm
Is the iterator random access?
Explicit type doesnt say it either
Artöm
Sorry: auto v=myfunction();
Auto is acceptable only with clear function name
Artöm
That's an opinion by a pretty popular developer (and a commitee member) in the C++ comunity.
It doenst mean though that he is 100% correct and it is the only way of auto amount
Ludovic 'Archivist'
Debatable
Well, it at least ensures everything is initialized
Artöm
Like we still dont have size_t literal
Pavel
Like we still dont have size_t literal
Yeah, we need a stronger system of typedefs, like in golang, to fix that. But this will probably happen not earlier than in 10 years.
Pavel
Also there are often mistakes with auto when programmers expect a different type from one that is deduced (that lead to logical errors and performance degradation)
Javi
Explicit type doesnt say it either
If you have explicitly said it is a vector, you know what iterator it returns
Javi
auto var=myNumber();
Artöm
auto var=myTime();
Come on. You know how to work with TimeType but dont know what myTime returns?
Javi
Does it return a time in seconds, a struct with hours, minutes and seconds?
András
It's just an example
So it's just a compile time error in the next line, for example
András
You still didn't tell me what you get from: auto v=myfunction(); auto var=v[i]/v[i+1];
First it's unreadable name Second is unsafe and unreadable
Pavel
So it's just a compile time error in the next line, for example
There can be two structs that have identical functions that produce slightly different results
András
Or one thousand lines away
Hmm, cannot call method ... In class ... . Interesting error
András
It's unsafe. Exactly my point
If v is int, then auto is int. And in your example, you try to make auto non int
András
András
Javi
If v is int, then auto is int. And in your example, you try to make auto non int
If v is double and you change the function to something that returns int, v becomes int. And somewhere else, where you where doing other_var=v/33;, you get something different of what you expect. But no errors.
Pavel
get_seconds get_minutes The same struct with different mining
If you write everything in your program yourself, you can be sure (can you still?) that you designed all you types in a way that every function is expresses the meaning and gives a clear knowledge of what type it is returning without knowing the exact type this function was called on. But in reality you will work with lots of programmers that have different opinions of what good naming is, and use lots of 3rd party libraries with different (not always consistent) naming conventions.
Javi
And you remember what you wrote months ago
Javi
Do you name your functions thisFunctionReturnsAnInt()?
Artöm
It is compatibility breakage
Javi
So, you created safe code, modified it to unsafe(becouse u don't do any cast), and tell me, that your code is unsafe? Interesting
You created safe code, months later, requirements make you change something, and you forgot one use of the function. Or even you are using somebody else's code
Artöm
> forgot This is your problem. Even if you had double before, maybe it is reasonable to refactor that usage
Javi
If refactoring went that hard, you need to track all usages of this function in this very moment
Yes, you do. But you are human, and may forget something. And if you get a compiler error, instead of compiling without trouble, that's a lot of trouble you save
Javi
Then this someone is blamed
"You see, boss. I made this change that made the program start to act funny and cost the company several clients, but it isn't my fault"
Artöm
Finally thats what tests exist for
Artöm
Javi
Work for 4 year, and didn't found it yet, so I think clear name and safe code is a key
So, are all your functions named thisFunctionReturnsDouble()? I'd like to see your code :p
Javi
Finally thats what tests exist for
Yes, and we all know that all the code is 100% covered by tests.
Pavel
Finally thats what tests exist for
Tests don't cover everything, nor automatic/unittests nor manual
András
You created safe code, months later, requirements make you change something, and you forgot one use of the function. Or even you are using somebody else's code
Hmm, you created memory safe code, months later modified it to code with memory leaks, and you say, that it's not your fault, that vode does not work
Artöm
Well I didnt call them silver bullet
Anonymous
A query, how could I reset the default CodeBlocks settings?
Anonymous
🙏🏻🙏🏻
Ilya
If v is double and you change the function to something that returns int, v becomes int. And somewhere else, where you where doing other_var=v/33;, you get something different of what you expect. But no errors.
Why did you have var = v / 33; here, but not var = v / 33.0; if like so much too take precisions? Why don't you write var = double(v) / 33.0;
Pavel
A query, how could I reset the default CodeBlocks settings?
This? http://blog.johnmuellerbooks.com/2013/04/12/resetting-your-codeblocks-configuration/