Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Why is randint taught?
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic
Author Message
ericfourfour




PostPosted: Mon Jan 15, 2007 12:49 am   Post subject: Why is randint taught?

Why is randint taught?


While reading Hackmaster's tutorial on AI for beginners, I came across this statement:

Hackmaster wrote:
*disclaimer: the reason I am using randint instead of Rand.Int() is because that is what they teach in schools.


This seems to be the only valid argument in favour of randint. So the question for this topic is not, "which is better, randint or Rand.Int?", the question is, "why is randint taught in school?"

Last year, when I was introduced to programming, using Turing, my teacher taught me to use randint, not Rant.Int. Naturally, I became formidable with it and used it in pretty much every situation that required it. It was not until the end of the semester, when I started using Rand.Int. I changed because of compsci.ca.

Why are teachers1 incapable of teaching students the proper way to program? Teachers are supposed to have programming experience and are supposed to know the proper way to program. If it is that difficult to teach Rand.Int, is there not something wrong? If a student can learn the correct form within a few weeks/months, but a teacher does not know it after many years (for my teacher around 10 years), is there not something wrong?

I believe the real issue here is, the teachers just don't have much programming experience.

I would appreciate comments but I do not want anyone saying stupid stuff like, "My teacher sucks because he/she can't do this but I can". Maybe, post some insight into why teachers with a lack of experience are being hired or other reasons why teachers would not teach the proper way to program.

_____
1 Not all teachers are this way.
 
Sponsor
Sponsor
Sponsor
sponsor
Ultrahex




PostPosted: Mon Jan 15, 2007 8:06 am   Post subject: Re: Why is randint taught?

Its quite interesting actually, a lot of teachers do not have a lot of programming experience in terms of a language like turing, java, along with many others.

This may seem rather odd, but some teachers are not even specialized in the field of Computer Science also remeber, so therefore they may not actually know how to do the course. A lot of computer science teachers i believe may only have math degrees, and on some occasions just computer engineering degrees. For those with computer engineering degrees they may not understand how the computer science field ties into the computer engineering.

I know there is one teacher at my school that taught computer science, I did not have him as my teacher, but he would literatly write out of a self-teach book for java, instead of teaching the class with his own knowledge of the subject. The question is, does he know how to program, I am not quite sure if he does.

So, I would come to the conclusion that either a large amount of computer science teachers dont have much programming experience (if any) or that they do what is simplier for the students to understand in class, so they don't have to go and teach the logic to the students that are gonna ask millions of questions anyhow. Since when it comes to Turing, most teachers just care if the students are writing the code and it works, rather then it actually being done properly it would seem.

So when it comes down to just Why the procedure randint is taught over the function Rant.Int, possibly the teacher didn't notice there was two random integer methods; possibly the teacher just found the first Random Integer method in the Turing Reference and used it, the other may be he doesn't understand the subject matter or the differnce between, and possibly so he didn't have to explain how functions work to students.
 
Tony




PostPosted: Mon Jan 15, 2007 9:02 am   Post subject: RE:Why is randint taught?

A scarier sounding question is - "why do some schools still use DOS based Turing 8?" (that's the original Turing, not WinOOT). Some just don't see a reason to change..

There is no way you can find a CS teacher with Turing programming experience. All of it has to be learned on the job. Possibly from old lesson plans. Those could cascade down 10 years, with old, depreciated syntax.

It might not be entirely teacher's fault too.. If half the class is having problems as it is, they might be preoccupied with figuring out how to not have a 40% class average, instead of looking up 10 years worth of new syntax... then again, maybe the older Turing style is more difficult to understand..
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
 
Shyfire




PostPosted: Mon Jan 15, 2007 11:24 am   Post subject: Re: Why is randint taught?

very valid point tony.


on another note.....
WOOT its my b-day. i just turned 18
 
Clayton




PostPosted: Mon Jan 15, 2007 11:37 am   Post subject: Re: Why is randint taught?

One reason I believe that randint() is taught, is because, from what I have heard, many classes still use some sort of book to learn from (I have never personally seen it). Perhaps that is why students think randint() is the right way, because the book does it that way. In my computer science class last year, my teacher pushed for all of the new functions and procedures (the ones in modules ie Draw.x, Rand.x) and pushed to use functions over procedures (somewhat).

Another big, huge, massive reason that many students don't understand, is because they don't care. They would rather just be able to draw pretty boxes and shapes than be able to have a class interact with another class that takes it's properties from a parent class. This also means an extremely hard push to get through all the basics of programming, and ends up hurting the student, especially in the long run when they don't understand how to keep track of someone's score, but they have their pictures working perfectly.

About the actual teacher though, some do actually take the initiative and try and learn the language properly. From what I have heard there are a couple of excellent CompSci teachers here on the forums. There are also others off line as well. Sure they may be far and few, but give credit where it's due.

Probably one of the best things that could happen for Ontario students, is for Turing to be scrapped from the curriculum, and instead start with another free language, that is used outside of a highschool setting. There's just more support out there for other languages than Turing, and some of those languages are just as easy to learn. It may also be beneficial because some languages don't have standard graphics libraries. This would help students to slow down and learn the basics first instead of in the middle, or even near the end.

Also, about randint() actually being taught, if someone on CompSci.ca is asking for help, and they use randint(), what's stopping them from learning how to use Rand.Int()? It doesn't take that long to understand the concept of functions versus procedures, and the resources here for them are staggering, so I don't see the problem, and yet more and more people get upset when someone tries to explain the difference between the two and refuse to try and learn it. Has anyone else noticed this?

In conclusion, randint() being taught is not always the teacher's fault. Schools need to update software, get new manuals, and try and teach the course from there. Or, a better alternative would be to scrap Turing entirely and work with a different language. If someone comes on the forum and refuses to try and learn something, then they can hardly blame their teacher any longer.
 
Piro24




PostPosted: Mon Jan 15, 2007 5:07 pm   Post subject: Re: Why is randint taught?

How is the Rand.Int function programmed anyways?
 
Clayton




PostPosted: Mon Jan 15, 2007 5:19 pm   Post subject: Re: Why is randint taught?

the same way the randint() procedure is, except that it returns the value that it creates instead of assigning the value to your variable internally. Seeing as it is programmed in C++ and then included via the external keyword, I would assume it looks something like:

c++:

void randint(int &num, int low, int high)
{
    num = //random number between low and high;
}

int Int(int low, int high)
{
    return //random number between low and high;
}


see the difference?
 
CodeMonkey2000




PostPosted: Mon Jan 15, 2007 6:19 pm   Post subject: RE:Why is randint taught?

In my opinion, randint should be taken out completly.
 
Sponsor
Sponsor
Sponsor
sponsor
Piro24




PostPosted: Mon Jan 15, 2007 6:32 pm   Post subject: Re: Why is randint taught?

No I meant like how could one program a function that creates a random number? What is like the actual code of the Rand.Int function.
 
Tony




PostPosted: Mon Jan 15, 2007 6:51 pm   Post subject: Re: Why is randint taught?

Piro24 @ Mon Jan 15, 2007 6:32 pm wrote:
What is like the actual code of the Rand.Int function.

Well you'd have to reverse engineer Turing to know for sure, but Freakman's example above should have given you a pretty good idea.

@spearmonkey2000 - randint will most likely remain for backwards compatibility. Holtsoft is really in quite a bit of a mess since just about every version ever released is still used out there.. somewhere.. *sigh*
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
 
md




PostPosted: Mon Jan 15, 2007 7:27 pm   Post subject: RE:Why is randint taught?

Piro24, there are many random number generators; my favourite is the Mersenne Twister. Technically it's only psudo-random but for most purposes it's more then random enough.

See http://svn.nxor.org/filedetails.php?repname=VNet&path=%2Fsource%2FcRandom.hpp and http://svn.nxor.org/filedetails.php?repname=VNet&path=%2Fsource%2FcRandom.cpp for a C++ implementation of the Mersenne Twister.
 
Piro24




PostPosted: Mon Jan 15, 2007 10:35 pm   Post subject: Re: RE:Why is randint taught?

md @ Mon Jan 15, 2007 7:27 pm wrote:
Piro24, there are many random number generators; my favourite is the Mersenne Twister. Technically it's only psudo-random but for most purposes it's more then random enough.

See http://svn.nxor.org/filedetails.php?repname=VNet&path=%2Fsource%2FcRandom.hpp and http://svn.nxor.org/filedetails.php?repname=VNet&path=%2Fsource%2FcRandom.cpp for a C++ implementation of the Mersenne Twister.


Cool, I always wondered that...I was curious to write a random function in Turing for fun, but I never knew where to start.
 
ericfourfour




PostPosted: Tue Jan 16, 2007 12:54 am   Post subject: RE:Why is randint taught?

To bring this topic back on track I would like to pose another question: Why is Ready to Program used in schools?

This IDE is the worst one I have ever seen. It costs money, even if you only want it for private use. It is out-of-date. It's auto-indent hardly follows Java indenting conventions. It comes with an extra library that no one uses unless you are a lazy teacher. It can only compile one version of Java (ie. you can't change the settings to compile earlier versions). It has no support for plug-ins. It has no debugger. The list goes on.

Who in the world would endorse such a product? The only good thing about it is that you only need to press 1 button to compile and run (although all IDEs have that). In fact the button it uses is F1, which is the standard button used to access a help menu. What did the developers not screw up on?

I honestly think students would be better off if they used Textpad and the command line. At least it would show them how to use these tools.
 
md




PostPosted: Tue Jan 16, 2007 1:30 am   Post subject: Re: RE:Why is randint taught?

ericfourfour @ Tuesday 2007-01-16 12:54 am wrote:
To bring this topic back on track I would like to pose another question: Why is Ready to Program used in schools?

This IDE is the worst one I have ever seen. It costs money, even if you only want it for private use. It is out-of-date. It's auto-indent hardly follows Java indenting conventions. It comes with an extra library that no one uses unless you are a lazy teacher. It can only compile one version of Java (ie. you can't change the settings to compile earlier versions). It has no support for plug-ins. It has no debugger. The list goes on.

Who in the world would endorse such a product? The only good thing about it is that you only need to press 1 button to compile and run (although all IDEs have that). In fact the button it uses is F1, which is the standard button used to access a help menu. What did the developers not screw up on?

I honestly think students would be better off if they used Textpad and the command line. At least it would show them how to use these tools.


Erm, this thread IS about random numbers. I think maybe you replied to the wrong thread Wink
 
mish




PostPosted: Wed Jan 17, 2007 7:13 pm   Post subject: RE:Why is randint taught?

what's the difference between randint and Rand.Int anyways? >_>
 
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: