Jon Wong

Programming

Popular programming

The 2018 Top Programming Languages of ieee - Link versus TIOBE Index for 2019 - Link

Do you C?

My journey begins here with LEARN TO CODE WITH C – FREE RASPBERRY PI BOOK. A raspberry pi is not required. You could easily go through the book with a text editor and a C compiler, which is how I am doing it. I am using a Pi Zero in OTG setup because I like dedicated hardware. However Virtual Box with any variant of Linux running in a virtual machine would work. Below I've linked some compilers to compile your C code.

The book

So far, LEARN TO CODE WITH C – FREE RASPBERRY PI BOOK has been a relatively easy read. The concepts are introduced at a seeming shallow learning curve, going through you garden variety data structures, logic control, and data flow. However for the uninitiated, pointers might take some additional pondering.

I'll post my code later as well as a few bash scripts I use to make compiling faster and easier. After all, typing out "gcc -o file file.c" then having to type "./file" to run it, can be a bit tedious, especially when debugging.

As promised I have completed the book and here is my completed code and some miscellanious notes. I was using gcc in a linux enviroment so the cc.sh file is for compiling in that enviroment.

cksum: 3547599228
4796 bytes (5K)
essential_c.tar.gz

To compile with the cc.sh file use the following syntax:

./cc.sh file1.c file2.c(optional)

This will in effect run the following line:

gcc -o file1 file1.c file2.c

./file1

Since the book limited it to two input files, more can be added by modifying the script and adding additional parameters, as in this case for an additional file ${3}.

Here is where my next set of C lessons begin:
learn-c

Here is a link to some open source C books Link


Java

I installed Java on my Pi and by mistake install OpenJDK as opposed to the Oracle variant. The Orcale variant runs slightly faster since it is optimized for the Pi, on a Pi Zero this can make things a bit more zippy.

If you did as I did and installed OpenJDK, you can get Oracle on there by doing the following:

  1. sudo apt-get purge openjdk-\*
  2. sudo apt-get install oracle-java8-jdk