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

Username:   Password: 
 RegisterRegister   
 [Tutorial] picture guide on how to use a command line to run programs
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tony




PostPosted: Sun Oct 23, 2011 9:25 pm   Post subject: [Tutorial] picture guide on how to use a command line to run programs

as a followup to High Level vs Low Level in education. @mirhagk, see if you can follow along.

1. Open up your favourite code editor. Mine is TextMate.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

2. Type up your program.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

3. Save it where-ever you want.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

4. Open up your favourite shell. Mine is bash via Terminal.app
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

5. Type the name of your favourite interpreter/compiler. Mine is Ruby.
5.1 Followed by this magic (drag-and-drop source into terminal).
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

6. Hit Enter. BAM, you're done!
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Mon Oct 24, 2011 8:14 am   Post subject: RE:[Tutorial] picture guide on how to use a command line to run programs

Or the no GUI at all version:

Open file for editing in your favorit command line editor:
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Type in code and hit save key:
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Run using your favorit complier (noramly: <complier command> <source file>):
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Receive output or executable (depending on if code was interpreted or compiled):
Posted Image, might have been reduced in size. Click Image to view fullscreen.



Also for ruby you can forget about the file all together and just type "ruby", put some code in and hit "ctrl-d" when done and it will run it. Or even better use the interactive shell tony mentioned in the other topic Wink
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
mirhagk




PostPosted: Mon Oct 24, 2011 10:37 am   Post subject: RE:[Tutorial] picture guide on how to use a command line to run programs

Well there ya go, now I may steal these, and give students the option of choosing between them. So I assume both of you think that ruby should be the language taught?
Tony




PostPosted: Mon Oct 24, 2011 10:49 am   Post subject: Re: [Tutorial] picture guide on how to use a command line to run programs

Tony @ Sun Oct 23, 2011 9:25 pm wrote:
Type the name of your favourite interpreter/compiler.

You may pick any other language.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Dan




PostPosted: Mon Oct 24, 2011 10:50 am   Post subject: Re: RE:[Tutorial] picture guide on how to use a command line to run programs

mirhagk @ 24th October 2011, 10:37 am wrote:
Well there ya go, now I may steal these, and give students the option of choosing between them. So I assume both of you think that ruby should be the language taught?


Depends on what you are trying to teach. I recomend basing the language on what best demonstrates the concepts.

Python and Ruby both have good potential for teaching the basics up to object oriented programming, but i would probably go with somthing like C for data structures. More domain specific topics offten have less popular langues targeting them and what langue maybe used for a class is offten limited by the libraries and tools the instructor wishes to use.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
mirhagk




PostPosted: Mon Oct 24, 2011 11:11 am   Post subject: RE:[Tutorial] picture guide on how to use a command line to run programs

Well grade 10 goes over if statements, looping, variables, arrays and functions/procedures. It never really gets into classes and stuff (right now). Basically the class is to give students an introduction on how to program, not necessarily teach them anything useful about programming, other than what it is and basic concepts.

Since grade 11 has no pre-req there's not a lot that we can teach in grade 10, since it needs to be retaught next year anyways.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: