There are two free programming environments/languages called Small Basic. One is Microsoft Small Basic. Here is a website where you can download a free copy of Microsoft Small Basic. They offer a free tutorial in PDF, free example programs, and a Wiki for support. Here is a list of programs made with Microsoft Small Basic.
Another Small Basic version is called SmallBASIC. This version was intended to run on minimal hardware. This is not a toy language. It was intended for the Palm OS. The Wikipedia article says, "SmallBASIC runs even on Palm OS wristwatches made by Fossil, Inc." You can get SmallBASIC for free from the SmallBASIC webpage on Sourceforge. There are no tutorials for Basic at this website. However, you can download free applications as examples written in SmallBASIC from their code library. Basic is a simple language, so you do not need much to get going.
Generic books on Basic are hard to find, but copies are still available from Amazon for Schaum's Outline of Theory and Problems of Programming With Basic by Byron S. Gottfried, and his other book, Schaum's Outline of Programming with Structured BASIC. The difference between the two is that structured programming does not use GOTO statements.
There are a lot of free sources for Basic compilers.
Robert
Saturday, December 22, 2012
Power Basic and Liberty Basic
If you are considering making Basic your first programming language, you should wonder if the Basic language is a dead end. Can you actually use it after you have finished learning it? Besides the Microsoft offerings (1) Visual Basic .NET, (2) Visual Basic for Applications (VBA) and (3) VBScript, there are other professional releases of Basic.
Power Basic is a professional release of Basic that is well thought of. There is also Liberty Basic.
Basic is not a dead end language. It has a lot of commercial support. It has a natural syntax that makes it easier to learn. Furthermore, the natural syntax of Basic can be adapted into pseudocode for use in software design documents.
Robert
Power Basic is a professional release of Basic that is well thought of. There is also Liberty Basic.
Basic is not a dead end language. It has a lot of commercial support. It has a natural syntax that makes it easier to learn. Furthermore, the natural syntax of Basic can be adapted into pseudocode for use in software design documents.
Robert
Sunday, November 4, 2012
Structure and Interpretation of Computer Programs
If you are learning about computer programming, you should hear about the book, Structure and Interpretation of Computer Programs by Harold Abelson, et al (1996). This book (SICP) has made a positive impression on some people. Here is a Wikipedia article on the book. The point of this book is to influence the thinking process, to stretch the mind. But it is not going to teach you how to write useful code. It uses a form of Lisp, called Scheme, which is available for free download from MIT. I can report that the Windows installer works and the Scheme interpreter launches successfully on Windows 7. If you want to work through this book, there is free support material available at this website: http://www.mitpress.mit.edu/sicp/.
Eventually, the Structure and Interpretation of Computer Programs was replaced by How to Design Programs (HtDP) by Matthias Felleisen, et al (2001). This book continues the MIT tradition of using the Scheme language. Here is a Wikipedia article on this book. Again, the emphasis is on stretching the mind rather than teaching a useful programming language. Theoretically, the student is taught by this book to design software. This is a very important point.
Not every programmer can design software. There are programmers, paid to write code for a living, who are incapable of designing software. Here is one definition of a software hack: software that is not designed. There is a synonym for a software hack: a kludge. To be fair, some people can hack-out decent code. Also, some programmers can carry a complex design in their heads so that they do not feel the need to document the design.
Returning to the topic of teaching computer science at MIT, I found evidence that MIT does have a programming course for students that have no experience writing software. This particular class uses the Python programming language. However, I find it hard to believe that a student majoring in computer science at MIT would be taking this particular course. I have seen no evidence in the internet of MIT continuing to use How to Design Programs, but I have discovered that the authors have a 2nd edition in progress (2012): http://www.ccs.neu.edu/home/matthias/HtDP2e/
How to Design Programs by Matthias Felleisen is a current book that is worthy of your consideration if you want to be a good programmer. But you need to learn languages for producing software products (Java, e.g.) from another source. Scheme and Lisp are not production languages, i.e., languages used to create significant products.
In closing, The Structure and Interpretation of Computer Programs (2nd Ed.), might be out of print, but it has left a lasting influence. It is an engaging book to read. You can also purchase the Instructor's Manual if you are going through the book on your own.
Robert
Here is a blog post by a high school student that briefly mentions SICP. People are still studying this book.
Eventually, the Structure and Interpretation of Computer Programs was replaced by How to Design Programs (HtDP) by Matthias Felleisen, et al (2001). This book continues the MIT tradition of using the Scheme language. Here is a Wikipedia article on this book. Again, the emphasis is on stretching the mind rather than teaching a useful programming language. Theoretically, the student is taught by this book to design software. This is a very important point.
Not every programmer can design software. There are programmers, paid to write code for a living, who are incapable of designing software. Here is one definition of a software hack: software that is not designed. There is a synonym for a software hack: a kludge. To be fair, some people can hack-out decent code. Also, some programmers can carry a complex design in their heads so that they do not feel the need to document the design.
Returning to the topic of teaching computer science at MIT, I found evidence that MIT does have a programming course for students that have no experience writing software. This particular class uses the Python programming language. However, I find it hard to believe that a student majoring in computer science at MIT would be taking this particular course. I have seen no evidence in the internet of MIT continuing to use How to Design Programs, but I have discovered that the authors have a 2nd edition in progress (2012): http://www.ccs.neu.edu/home/matthias/HtDP2e/
How to Design Programs by Matthias Felleisen is a current book that is worthy of your consideration if you want to be a good programmer. But you need to learn languages for producing software products (Java, e.g.) from another source. Scheme and Lisp are not production languages, i.e., languages used to create significant products.
In closing, The Structure and Interpretation of Computer Programs (2nd Ed.), might be out of print, but it has left a lasting influence. It is an engaging book to read. You can also purchase the Instructor's Manual if you are going through the book on your own.
Robert
Here is a blog post by a high school student that briefly mentions SICP. People are still studying this book.
Monday, October 22, 2012
Logic for Programming and Comments on C Programming
On two occasions I have handed a copy of The C Programming Language by Kernighan and Ritchie (K&R) to a bright young person. I had a chance to speak with one of these young people later on and found that he had been stopped in his tracks when he got to Boolean algebra. He totally ground to a halt when he hit bit-wise operators.
I wrote a hand-out on the logical operators, AND and OR to help young people who are studying programming. I have included the bit-wise operators used in C and I have posted this hand-written set of truth tables on the internet. There are a lot of bright young people who are capable of teaching themselves how to program, but they have to really want to learn how to do it in order to overcome obstacles.
Then again, young people should not have too many obstacles. The K&R book is brilliant, but it is terse and might not be a good fit for everyone. C Programming, A Modern Approach by K.N. King has more explanation and might be a better match for some people. On the other hand, The C Programming Language has a companion book that is a valuable complement: The C Answer Book: Solutions to the Exercises in 'The C Programming Language' by Tondo and Gimpel. Scott Gimpel is the creator of FlexeLint, a useful static analysis tool.
Overall, I believe a young person learning to program will benefit from some coaching, especially when learning to program in C.
Robert
A previous article on C programming is:
"A Fix for K & R Chapter 1", July 2, 2012, Monday
I wrote a hand-out on the logical operators, AND and OR to help young people who are studying programming. I have included the bit-wise operators used in C and I have posted this hand-written set of truth tables on the internet. There are a lot of bright young people who are capable of teaching themselves how to program, but they have to really want to learn how to do it in order to overcome obstacles.
Then again, young people should not have too many obstacles. The K&R book is brilliant, but it is terse and might not be a good fit for everyone. C Programming, A Modern Approach by K.N. King has more explanation and might be a better match for some people. On the other hand, The C Programming Language has a companion book that is a valuable complement: The C Answer Book: Solutions to the Exercises in 'The C Programming Language' by Tondo and Gimpel. Scott Gimpel is the creator of FlexeLint, a useful static analysis tool.
Overall, I believe a young person learning to program will benefit from some coaching, especially when learning to program in C.
Robert
A previous article on C programming is:
"A Fix for K & R Chapter 1", July 2, 2012, Monday
Saturday, October 13, 2012
Notepad++ and Python
Python is very sensitive to white space because it interprets code blocks by indentation level instead of curly braces. It is vital to use uniform spacing. I agree with those programmers who use 4 spaces for Python indentation and avoid use of tabs. You can setup Notepad++ to help maintain this standard. Here is how:
Open Notepad++. Select Settings > Preferences > Language Menu/Tab Settings
Leave Tab Size at 4, but check the box that says "Replace by space".
Then go back to the main menu and select View > Show Symbol > Show White Space and Tab.
If you look closely you will see faint dots for the spaces.
If you open a file that has tabs you will see them displayed with arrows so you know you have them.
You can do a Control-f to open the find window. It has a radio button in search mode that has "extended" and allows you to search for the \t character, which is a tab. You can use the "replace" tab in the find window to replace all tabs (\t) with 4 spaces. This is a convenient way to clean up files with tabs.
If you work on projects with multiple people you will see all manner of tabbing and spacing, which can break Python code. Python code is sensitive to indentation errors. It is important to be consistent. This sensitivity to indentation errors makes Python code brittle in a large programming environment.
James Coplien had this to say: "Back in my days working in the Bell Labs Software Production Research organization ... we had some back-of-the-envelope findings that suggested that consistent indentation style was one of the most statistically significant indicators of low bug density."[1]
Robert
[1] Forward by James Coplien, p. xxii, in Clean Code, A Handbook of Agile Software Craftsmanship by Robert C. Martin
Open Notepad++. Select Settings > Preferences > Language Menu/Tab Settings
Leave Tab Size at 4, but check the box that says "Replace by space".
Then go back to the main menu and select View > Show Symbol > Show White Space and Tab.
If you look closely you will see faint dots for the spaces.
If you open a file that has tabs you will see them displayed with arrows so you know you have them.
You can do a Control-f to open the find window. It has a radio button in search mode that has "extended" and allows you to search for the \t character, which is a tab. You can use the "replace" tab in the find window to replace all tabs (\t) with 4 spaces. This is a convenient way to clean up files with tabs.
If you work on projects with multiple people you will see all manner of tabbing and spacing, which can break Python code. Python code is sensitive to indentation errors. It is important to be consistent. This sensitivity to indentation errors makes Python code brittle in a large programming environment.
James Coplien had this to say: "Back in my days working in the Bell Labs Software Production Research organization ... we had some back-of-the-envelope findings that suggested that consistent indentation style was one of the most statistically significant indicators of low bug density."[1]
Robert
[1] Forward by James Coplien, p. xxii, in Clean Code, A Handbook of Agile Software Craftsmanship by Robert C. Martin
Installing Python
Here is a tip for when you install Python. After you have googled python, gone to their website, downloaded the version you want, and launched the installer, you will get to a box that has a list of features to install. At the bottom of the list it says "Add python.exe to path" and there is a red X in the box next to that choice. Right-click on that choice, read the options on the drop-down box that appears, and check the box that says "install all features." You do not want to leave that red X in that box.
You do want the installer to add python to your path variable. If you do not have the installer add python to your path, you will have to do it yourself. Here is how you test to see that your path does have python in it: Open a Windows command window and type PATH and hit a carriage return. The OS will print the path and you can read it and look for "C:\Python33" or whatever version is latest. Or, you can just test to see if the path variable is set properly by entering "python --version" and see if the command works. The output will by "Python 3.3.0" or something similar if you get another version.
If you already know how to program, The Quick Python Book is a good introduction to the language. My preference is to edit Python code with Notepad++ and use a command window for running code. The Quick Python book acts like you will do all your work with the IDLE Python GUI. I just use the IDLE tool to test small commands.
Python is a nice language. I went back to look at PERL and I can see why people prefer Python to PERL. PERL forces you to put funny symbols called sigils in front of variables. I forgot about that.
Robert
You do want the installer to add python to your path variable. If you do not have the installer add python to your path, you will have to do it yourself. Here is how you test to see that your path does have python in it: Open a Windows command window and type PATH and hit a carriage return. The OS will print the path and you can read it and look for "C:\Python33" or whatever version is latest. Or, you can just test to see if the path variable is set properly by entering "python --version" and see if the command works. The output will by "Python 3.3.0" or something similar if you get another version.
If you already know how to program, The Quick Python Book is a good introduction to the language. My preference is to edit Python code with Notepad++ and use a command window for running code. The Quick Python book acts like you will do all your work with the IDLE Python GUI. I just use the IDLE tool to test small commands.
Python is a nice language. I went back to look at PERL and I can see why people prefer Python to PERL. PERL forces you to put funny symbols called sigils in front of variables. I forgot about that.
Robert
Saturday, October 6, 2012
Install Tkdiff on Linux
If you want a visual comparison between two files on Linux, then vimdiff is available for you, but the visual presentation is very ugly. Vimdiff comes with vim. Fortunately Tkdiff is available for Linux and it is easy to install if you know how.
Here are directions for installing Tkdiff on Linux. My primary machine is a Windows box, so I download using my Windows box and then move files over to my Linux box. If you download from the internet using your Linux box, the directions might be very similar, but a little different.
Use this link to download Tkdiff for Linux:
http://sourceforge.net/projects/tkdiff/files/tkdiff/4.2/tkdiff-4.2.tar.gz/download
Use WinZip extract once to get from tkdiff-4.2.tar.gz to tkdiff-4.2.tar
Use WinZip extract again to get from tkdiff-4.2.tar to folder called tkdiff-unix which has these files:
CHANGELOG.txt
LICENSE.txt
README.txt
tkdiff
Move the entire folder to your linux box, although you really only need the tkdiff file. When you place licensed software on your linux box, I think it is appropriate to have the license on the machine.
Change tkdiff to Unix format, and put it in the bin directory. Here are the commands to do this. Of course, when you execute su to become root, you must know the root password.
dos2unix tkdiff
su
cp tkdiff /usr/local/bin/
Now you can go to some directory and execute
tkdiff file another_file
and see the difference.
You will be please to see the visual improvement over vimdiff. If you downloaded directly onto the Linux box, the tkdiff file might not be in DOS format. The program dos2unix fixes the carriage return differences between Unix and Windows.
I will also mention that there is a Windows version available here.
http://sourceforge.net/projects/tkdiff/
The Windows version has an installer called TkDiff-4.2-Setup.exe
I prefer Kdiff3 for comparing files on Windows. I installed Tkdiff instead of Kdiff3 on Linux because Tkdiff is generally much easier to install on Linux.
Robert
May 2017: Tkdiff is nice because you can put it on media and install it on a computer that does not have a decent visual tool for diff'ing files. However, if you are on a Linux computer, look and see if the kompare (on KDE systems) or meld (on Gnome systems) tools are available. Then you won't need Tkdiff.
Here are directions for installing Tkdiff on Linux. My primary machine is a Windows box, so I download using my Windows box and then move files over to my Linux box. If you download from the internet using your Linux box, the directions might be very similar, but a little different.
Use this link to download Tkdiff for Linux:
http://sourceforge.net/projects/tkdiff/files/tkdiff/4.2/tkdiff-4.2.tar.gz/download
Use WinZip extract once to get from tkdiff-4.2.tar.gz to tkdiff-4.2.tar
Use WinZip extract again to get from tkdiff-4.2.tar to folder called tkdiff-unix which has these files:
CHANGELOG.txt
LICENSE.txt
README.txt
tkdiff
Move the entire folder to your linux box, although you really only need the tkdiff file. When you place licensed software on your linux box, I think it is appropriate to have the license on the machine.
Change tkdiff to Unix format, and put it in the bin directory. Here are the commands to do this. Of course, when you execute su to become root, you must know the root password.
dos2unix tkdiff
su
cp tkdiff /usr/local/bin/
Now you can go to some directory and execute
tkdiff file another_file
and see the difference.
You will be please to see the visual improvement over vimdiff. If you downloaded directly onto the Linux box, the tkdiff file might not be in DOS format. The program dos2unix fixes the carriage return differences between Unix and Windows.
I will also mention that there is a Windows version available here.
http://sourceforge.net/projects/tkdiff/
The Windows version has an installer called TkDiff-4.2-Setup.exe
I prefer Kdiff3 for comparing files on Windows. I installed Tkdiff instead of Kdiff3 on Linux because Tkdiff is generally much easier to install on Linux.
Robert
May 2017: Tkdiff is nice because you can put it on media and install it on a computer that does not have a decent visual tool for diff'ing files. However, if you are on a Linux computer, look and see if the kompare (on KDE systems) or meld (on Gnome systems) tools are available. Then you won't need Tkdiff.
Subscribe to:
Posts (Atom)