Code: Select all
0 for i=0 to 1
1 print chr$(205.4+rnd(.));
2 i=0: next
Regards,
Shaun.
Code: Select all
0 for i=0 to 1
1 print chr$(205.4+rnd(.));
2 i=0: next
Or, if you like:e5frog wrote:Sure, but why?
0 printchr$(205.4+rnd(.));:run
Code: Select all
0 ?chr$(205.4+rnd(.));:goto
You have many ways of solving the same problem in all problem-orientated programming languages, using GOTO is considered bad practise nowadays (and has been since the 1970s actually because it leads to 'spaghetti code'), and does not exist as a keyword in some languages (or at least I can't find a reference to it).e5frog wrote:We saw some examples of that in the "No GOTO"-competition on REMOVED, but what's the point of it, is there a gain compared to using a goto? Shorter code, I think not. Is it faster? Possibly??
No, because at the lowest level, unconditional jumps are sometimes unavoidable. High level languages are for humans, so the Spaghetti code argument prevails. I'm not saying I agree one way or another, but it's what my professors have told me over my studies since 2009. Who's to argue with a computer scientist, eh?e5frog wrote:Seems like you'd find one way to achieve the same result and you'd just use that everywhere you would have used goto - if it's needed.
I guess JMP in assembler is also bad then - as it's basically the same thing.
It's also still available in C, C++ and, last October, someone on my MSc used it in C# - I didn't realise that you could? Unless they were prototyping their code in C when the lecturer looked over their shoulder.Is GOTO considered bad practice, in retro computing, by whom? I've heard it before, who said it and why is that? Isn't all available commands in the programming language you're using allowed?
It's also a consensus amongst all of the developers that I know (I work as a developer and have met a lot of developers through my work with Micro Mart and other magazines), and all of the programming lecturers that I've studied with. Which is why ActionScript isn't considered a nice language and no full-time developer likes using it.EDIT: Seems it's a personal opinion of Edgar Dijkstra - why should we care? It also applies to modern object oriented languages.
Users browsing this forum: No registered users and 10 guests