BinaryByter
because there is no return to the function
Jussi
Why not?
BinaryByter
because thats how goto works
BinaryByter
Jussi
Can you even jump to another scope with goto?
Jussi
I understand now what you mean
BinaryByter
BinaryByter
Jussi
But imo goto is not that bad inside the same scope, that's how I've seen it been used anyway
BinaryByter
BinaryByter
Well it is predictible
BinaryByter
but its hard to keep track of
Jussi
It can be yes
Jussi
Mm
BinaryByter
It adds complexity which your coworkers might have trouble with
BinaryByter
additionally, goto is nothing but a very very thing wrapper around assembler
BinaryByter
meaning that you are made to do the compilers job at not leaking
Mat
BinaryByter
Jussi
BinaryByter
BinaryByter
Goto is like calling another function
Jussi
I mean I never use it but sometimes I come across in someone else's code
Mat
Jussi
Depends on the taste I guess
BinaryByter
No
BinaryByter
it does not
BinaryByter
if your taste is "I put 20 functions into a single one", you have a shitty taste
Jussi
:D
Liam
The only reasonable use of goto is to jump out of deeply nested loops. However, Deeply nested loops themselves are not recommended. So..., preventing using goto is almost always right.
Liam
Something like:
for(...) {
for(...) {
while(...) {
if(...) goto stop;
.
.
.
}
}
}
stop:
std::cout << "Error in program.\n";
BinaryByter
BinaryByter
+ break and continue are enough
Liam
Liam
Anyway, preventing using goto is political correct in C/C++ world.
Aquib
Java has some civilized form of goto but otherwise you cannot use them
Aquib
Vitaliy ◀️TriΔng3l▶️
If it solves a problem, it's a valid solution
Anonymous
Can we make gui applications using C/C++?
Liam
Yes.
Liam
Most games on PC are built by C++.
Anonymous
What tools are use in making gui applications?
Anonymous
I mean the ide?
Anonymous
Best recommended ide?
Anonymous
Thanks.
Jussi
Qt/Windows forms api whatever/GTK+
Vitaliy ◀️TriΔng3l▶️
Francisco
Vitaliy ◀️TriΔng3l▶️
Like additional conditions on outer loops in the most common example of goto with exiting an inner loop
Vitaliy ◀️TriΔng3l▶️
goto clearly describes the intention in this case, and is self-sufficient, doesn't require additional checks in every outer loop
Vitaliy ◀️TriΔng3l▶️
if you don't need it anymore at some point in the future, you just remove the goto and the label, removing exactly what you wanted to remove
Vitaliy ◀️TriΔng3l▶️
What I'm saying is when they let you express control flow in a richer and more descriptive way, why not
Francisco
MᏫᎻᎯᎷᎷᎬᎠ
This whole conv all about goto
Vitaliy ◀️TriΔng3l▶️
for some elements {
for some elements for this element {
if condition met, we found something, stop searching
}
}
Vitaliy ◀️TriΔng3l▶️
Or error handling in C
Vitaliy ◀️TriΔng3l▶️
Vitaliy ◀️TriΔng3l▶️
Or error handling in C
Exceptions are exceptional situations, not something that should increase the indentation level of your normal control flow
Anonymous
Watan:
The is the last option i got. To ask strangers on telegram who know how to code. I know this will sound boring but, i have an idea. Trust me, its not related to game, or some messaging or some social app. Its very simple if anyone know the basics of app development they can do it because i dont think im in that feild and also i don't have time.If anyone one is a bit interested in knowing and helping pls text me back.
Francisco
Dima
Mat
Anonymous
👍
Vitaliy ◀️TriΔng3l▶️
The other option is putting lots of `return`s with all the cleanup
Vitaliy ◀️TriΔng3l▶️
But then you get code duplication, and for everything you create all of the handlers below become bigger
Mat
Vitaliy ◀️TriΔng3l▶️
Or you mean instances of nested loops?
Mat
Mat
Do you require gotos to exit them?