Goto

 
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding
View previous topic :: View next topic  
Author Message
Schmendrick



Joined: 02 Oct 2005
Posts: 7

PostPosted: Thu Dec 07, 2006 8:38 pm    Post subject: Goto Reply with quote

(To avoid hijacking.)

bullseye wrote:
I don't feel strongly enough about it to engage in battle. The only steadfast opinion I do have is that it should be one of those concepts that gets taught last.

Really? I'm kind of the opinion that it should be taught toward the beginning... but, then, I think every programmer beyond the level of casual hobbyist/script kiddie should be run through at least a basic course in assembly/machine language. Because, ultimately, you need to have a decent comprehension of what's going on at low levels.

As I like to say, every programmer worth his salt should know that, at the basic level, a computer is just a long list of numbers and a calculator that can read and write to them. Moreover, he should have a rough idea of what his [high level] code "looks" like after it's been through the compiler.

bullseye wrote:
I'm not an assembly coder, but it's probably not possible to write a functional assembly program without jumps. Which, of course, was your point. Smile

Not if it's much beyond "Hello World," anyway.

I guess my feeling on the issue is that higher level programming languages should serve as "leverage" on what I could already [theoretically] do with assembly. And in assembly JMP is all you've got. All the looping/control structures (or, heck, subroutines) provided by a language are just [very] convenient wrappers for goto anyway, as I see it.

Then again, I'm kind of old-school (if you couldn't tell Smile).

Kaz wrote:
The moral: use the most appropriate tool for the job (although, while the most appropriate tool might be a goto, it's highly unlikely).

Amen.
Back to top
View user's profile Send private message
Author Message
bullseye



Joined: 19 Jul 2005
Posts: 10
Location: Kansas

PostPosted: Fri Dec 08, 2006 5:54 pm    Post subject: Re: Goto Reply with quote

Schmendrick wrote:
Really? I'm kind of the opinion that it should be taught toward the beginning... but, then, I think every programmer beyond the level of casual hobbyist/script kiddie should be run through at least a basic course in assembly/machine language. Because, ultimately, you need to have a decent comprehension of what's going on at low levels.


I suppose it depends on the delivery. I actually did get exposed to assembly early, and in my case anyway, learning it then was a waste. It wasn't until about 6-7 years later that I re-visited it of my own volition. Now, one of my favorite books is Hyde's Write Great Code (Vol 1), but it took knowing my high level languages well enough before I could see the value in understanding what happens at the lower level.

Quote:
As I like to say, every programmer worth his salt should know that, at the basic level, a computer is just a long list of numbers and a calculator that can read and write to them. Moreover, he should have a rough idea of what his [high level] code "looks" like after it's been through the compiler.


I think it is important that the programmer have a solid grasp of what they are doing at the high level. Understanding the low level impact is wonderful, but you can do some serious damage at the high level, which all the low level knowledge in the world won't prevent. I'm not sure I'm contradicting anything you've said there, just adding to it a little.

Quote:
I guess my feeling on the issue is that higher level programming languages should serve as "leverage" on what I could already [theoretically] do with assembly.


To a point. Too much consideration of the underlying machine language can be counter productive since modern compilers are far better at optimizing than we are. I also think you'll start to get a headache if you think too deeply about the underlying assembly in runtime oriented languages like Java or .NET.
Back to top
View user's profile Send private message
Author Message
Schmendrick



Joined: 02 Oct 2005
Posts: 7

PostPosted: Mon Dec 11, 2006 5:07 pm    Post subject: Re: Goto Reply with quote

bullseye wrote:
I suppose it depends on the delivery. I actually did get exposed to assembly early, and in my case anyway, learning it then was a waste. It wasn't until about 6-7 years later that I re-visited it of my own volition. Now, one of my favorite books is Hyde's Write Great Code (Vol 1), but it took knowing my high level languages well enough before I could see the value in understanding what happens at the lower level.

Really? I was kind of the opposite. I learned in BASIC (man, I still remember the ecstasy when I learned about GOSUB; GOTO NEXTLINE wasn't working out, and my weird reference tables were just clunky), and then had a smattering of Pascal (records types? pointers? Oh joy!) before I started playing with assembly. But that was before I learned C, and I think assembly primed me pretty well for it.

bullseye wrote:
I think it is important that the programmer have a solid grasp of what they are doing at the high level. Understanding the low level impact is wonderful, but you can do some serious damage at the high level, which all the low level knowledge in the world won't prevent. I'm not sure I'm contradicting anything you've said there, just adding to it a little.

Well, sure. The point I suppose both of us are trying to make is that "voodoo programming" is never a good thing. (Sometimes it's "not so bad," but it's never "good.") And it seems to me that the sort of programmer who truly has an intimate understanding of his code is the kind of programmer who doesn't abuse the oh-so-easily-abused goto statement.

bullseye wrote:
Quote:
I guess my feeling on the issue is that higher level programming languages should serve as "leverage" on what I could already [theoretically] do with assembly.


To a point. Too much consideration of the underlying machine language can be counter productive since modern compilers are far better at optimizing than we are. I also think you'll start to get a headache if you think too deeply about the underlying assembly in runtime oriented languages like Java or .NET.

Heh. I didn't say I consider it all the time. Smile But I do have the capacity to do so, so when something goes wrong (especially after I can't find it in the high level stuff) I can check there for problems. But you're right; some languages do an incredible job of hiding the bottom level from you -- and/or do a good enough job of insulating your code from it that you never need to consider it. Like, you know, anything on a virtual machine. So long as the VM is robust, your "high level" code IS at the bottom level. (And I'm not going to even TRY to debug someone else's VM.) Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign