Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
It’s deprecated and not recommended for exactly the reason you described. Trying to read, understand and debug code that has been written randomly and jumps all over the place is a nightmare
-
Voxera113977yGoto was necessary and in assembly the only option but it makes it harder to read in large projects
-
@Nawap Do you know the game TIS-100? There it 's perfectly fine (and fun) to use GOTO.
-
zazapeta547yImagine a book wrote randomly and each paragraph is pointing to another... is it more readable than a classical book ?
Do not forget that : 'code' is a language to simplify communication between humans, HUMANS, not machines. The main 'job' of a developper is 'code for humans, code for readability' not code for machines. Remember, machines are just binary code.
What do you think about that ? -
Nawap13727y@IllSlapU @practiseSafeHex
I know the disadvantage of it.
But it should be kept for fun.
See Java does not have GOTO.
Python I Do not think so.
My point was just keep it in all languages,so ppl can have the fun of crappy coding -
@Nawap If you want to have fun with GOTO you can always download some MIPS assembly simulator and go nuts.
Putting it into modern languages just for fun only gives the wrong people the wrong ideas. -
Nawap13727y@zazapeta
As I have clearly mentioned ,
It's like for fun.
Iam not promoting to write code with GOTO.
See,
it would be fun reading one the book which exactly like u described , in a break .
Its frustrating if u have all books like that -
somebody7317ygoto is perfectly valid construction and makes sense if used wisely - see how kernel uses it. There are people claiming that it is bad practice to use goto and that it is drprecated. Those are either aware that most people are stupid and will hang themselves with it (same goes for malloc, casts, free) and would use it in many stupid ways so they nan it altogether, or they are full of bullshit as they heard it from the first group, never thought about it and spread it around.
-
zazapeta547y@Nawap @irene So, GOTO are like 'Quest code' x) . For the sake of fun, why not :D . The game is not what the code does, but the code itself.
I guess it can be incredibly instructive and funny -
LLAMS36647yWell the textbook answer would be its deprecated because of Edgar Dijkstra’s paper “goto considered harmful”.
Goto allows unrestricted direct transfer of control, which isnt so bad if the scope of it is tiny. But as soon as the scope exceeds a few lines you are introducing potentially serious side effects. Edgar goes into a lot more detail of course. If you want a good summary, read Clean Architecture by Bob Martin -
1. GOTO sucks in big code. Never use GOTO more than two times in a row. plz
2. GOTO is needed when you want to hop off a loop immediately. Only use when you need that kind of feature in your code.
3. Using GOTO goodly, goodly, goodly will make your code easier. -
Wack61957y@deadlyRants I love MIPS assembly! We've implemented a 32bit MIPS processor on a FPGA, for a class at university. We then wrote assembly and tested it with a debugger and later flashed it to the board.
It was mostly simple stuff, like a snake moving arround on the FPGA display and such things, but it was the most fun I had studing! -
Voxera113977y@Nawap C# has goto and i know t is used within the yield interator implementation.
And I have used it sometimes in Linqpad scripts where I just needed some quick and dirty one of code that I just could not bother to refactor when I found myself in a dead end.
But never in production code, not even the switch fall through option (c# does not have implicit fall through, you have to explicitly goto another case)
Related Rants
Why is GOTO deprecated and not recommend!?
It was fun in school days programming, I used to write code randomly then use GOTO to sequence it.
Did anyone had fun with GOTO!?
rant
c
programming
algo