*** | Top | Next Post |
TOC
This was originally written and created around 2013 and may require to be updated. (2021)
This “Fun to Program” was originally created around 2013 when I was learning programming on Debian system and was published to http://people.debian.org/~osamu/fun2prog.html .
Since this has been neglected and I thought it is good idea to go through this content again. I moved this content to the currently maintained site https://osamuaoki.github.io/ in 2021.
Script examples were created in 2013. So they may not be applicable for current system.
In order to make it easy to trace, I am tagging all related pages under fun2prog.
Initial publish dates of fun2prog are approximate ones in correct order.
All contents are licensed as
- GPL2 or later and
- CC BY-SA 3.0 or later, and
- modified BSD.
(Pick any one of the licenses as you need if you take any parts of this. This is intended to be used for any purposes with least conflicts.)
Please note that the quoted part from the ioputs.c
source remains in just LGPL (GNU Lesser General Public License).
What this is
Please consider this as a note of a self-study student.
This is not mean to be a tutorial document to explain how to program nor authoritative document by an expert.
I recorded how I tried to learn programing basics of the modern large software packages written in mixed languages using various complicated libraries. I provide the followings:
- Learning records of my programing and building binaries.
- URL links to the essential technical information for learning.
- Minimal explanation and many simple examples.
- Some summary list of things to remember.
- Priority on POSIX shell, Python, and C. (on Debian system)
I hope this information is useful to others.
If the tailing parts of terminal example lines are dropped to fit within 80
character/line, they are indicated by ...
at the end of the line. (Or, I
forced them to fit using fold
command.)
My local user name on this machine is osamu
. You may need to replace it with
your user name.
Please be careful about the publication date of reference documents since the software infrastructure is a moving target and such documentations may be obsoleted when you read this document.
TIP: If you find any questionable contents in this document, doubt them. If you find errors, let me know.
Background
To be a Debian developer, I encounter situations to deal with large software
packages written in a combination of languages such as C, C++, Vala, Python,
Perl, Shell, LaTex, DocBook, … with specialty cross platform build script
generators such as autotools and cmake. Their build tools invoke commands such
as ./configure
, make
, gcc
, and g++
. These software packages tend to be
linked to many libraries which make them even more complex.
For example:
- GNOME:
gcc
+ Glib + GTK+ + D-bus + Autoconf + Automake + Autopoint + … - KDE: MOC (Metaobject compiler) +
g++
+ Qt (QtCore, QtGui, …) + D-bus + Cmake + …
Even with all these complexities, using these software package just for backporting is not usually out-of-reach for me as a novice programmer with the help of well designed packaging tools such as debhelper. The package build script can be deceptively simple as the following.
%:
dh $@
But when I need to tweak something, I get overwhelmed with the complexity. I felt I have to practice program building and packaging with simpler case to understand its fundamentals and to become a better Debian developer.
Also, being a maintainer, it is essential to know how debugger works to use it effectively.
There are new major technical challenges such as multitarch and fortify of binary packages which I did not deal in “Debian New Maintainers’ Guide”. These needed to be addressed for newer packages, too.
Prerequisites
I expect readers of this to read the followings first.
- Debian system: Debian Reference
- Debian packaging: Debian New Maintainers’ Guide
I have browsed through tutorial contents of these documents … so I expect you to do the same.
- Unix system: The Unix Programming Environment (Brian W. Kernighan and Rob Pike. Prentice Hall, Inc., 1984. )
- POSIX shell: Advanced Bash-Scripting Guide
- C Language:
** The C Programming Language (2nd ed., Brian W. Kernighan, Dennis M. Ritchie Prentice Hall.)
** Gccintro package containing “Introduction to GCC by Brian J. Gough”:
apt-get install gccintro
(non-free GFDL package) - Python: ** [The Python Tutorial](http://www.python.org/ and http://docs.python.org/tutorial/)
- Vala: Vala and Vala Tutorial
- Lua: [Programming in Lua](http://www.lua.org/ and http://www.lua.org/pil/)
- Perl: [Perl Tutorials](http://www.perl.org/ and http://perldoc.perl.org/index-tutorials.html)
- Devhelp package:
apt-get install devhelp
with recommended packages. ** libglib2.0-doc: Documentation files for the GLib library ** libgtk2.0-doc: Documentation for the GTK+2 graphical user interface library (tutorial included) ** libgtk-3-doc: Documentation for the GTK+3 graphical user interface library ** libpango1.0-doc: Documentation files for the Pango ** …
Also, I recently found on-line textbooks from Green Tea Press. They are very informative.
- Think Python: How to Think Like a Computer Scientist by Allen B. Downey
- Think Java: How to Think Like a Computer Scientist by Allen B. Downey
- How to Think Like a Computer Scientist - ‘C++-Version’ (PDF) by Allen B. Downey
- How to Think Like a Computer Scientist - ‘C-Version’ (PDF) by Allen B. Downey (C-Version by Thomas Scheffler)
Here are extra sources of information …
- Wikipedia: C (programming language)
- Wikibook: C Programming
- Slightly outdated: C Programming Tutorial (K&R version 4)
- Wikipedia: Bourne shell
- Wikipedia: Python
- Wikipedia: Vala
- Wikipedia: Lua
- Wikipedia: Perl
TIP: Install all dependency packages of devscripts, vim, lua, python, python3, perl, vala, swig, git, manpages-dev, devhelp, …
*** | Top | Next Post |