Programming by Wavetrex
Introduction
I have started to learn programming very early in my age, at only 10 years. And I started with the hardest language of all: Assembly, on a computer with Intel 8080 CPU (8bit, 64kbytes memory)
Since then, I went through several languages, improving my skills and learning new tricks.
The Intel 8080 Assembly
First, an example on how this language looks:
LXI H,0 ADE1 LDAX B ORA A RZ MOV D,H MOV E,L DAD H DAD H DAD D DAD H SUI 30H CPI 10 CMC RC MOV E,A MVI D,0 DAD D INX B JMP ADE1
Looks totally un-human, and it is. Assembler represents the most intimate way to communicate with a computer, by representing the precise instructions that the computer understands
These assembly instructions are translated directly into machine-code, which is run at the fastest possible speed. Even modern programs use lots of assembly to code parts of them that need to be executed at the highest possible speed, instead of using high-level programming, like Pascal or C
I have learned this language from examples, but never wrote big programs with it, was simply too hard for a young child. However, Assembly helped me understand how a computer really works, and how it does what it does. All computer operations can be summarized in a few lines:
- Reading and Writing data from/to memory
- Arithmetic and logic operations on this data
- Comparing, copying and moving data
- Inputing and Outputing data from/to outside the computer's processor and memory
That is it. Everything a computer does, as complicated as it might appear ( like 3D graphics for example ), is done by thousands or millions of these elementary operations
ZX80 Basic
My next computer, the HC91 had a totally different kind of programming language. While itself could run machine-code, compatible with Zilog Z-80 CPU, the lack of a built-in assembler discouraged me into trying to program that way. Instead, I learned BASIC
The ZX-BASIC (Beginner's All-purpose Symbolic Instruction Code) is a high-level interpeted language, which on a slow machine with only 1.5Mhz CPU run extremely slow. However, it allowed me to learn the principles of programming. I have created hundreds of tiny programs in Basic, starting with the most simple ones which added a few numbers or displayed a text on the screen, to games and complex mathematical formulas
Here's an example on how a program in ZX-BASIC looks:
5 REM union flag (from the ZX Spectrum Manual) 10 LET r=2: LET w=7: LET b=1 20 BORDER 0: PAPER b: INK w: CLS 30 REM black in bottom of screen 40 INVERSE 1 50 FOR n=40 TO 0 STEP -8 60 PLOT PAPER 0;7,n: DRAW PAPER 0;241,0 70 NEXT n: INVERSE 0 100 REM draw in white parts 105 REM St. George 110 FOR n=0 TO 7 120 PLOT 104+n,175: DRAW 0,-35 130 PLOT 151-n,175: DRAW 0,-35 140 PLOT 151-n,48: DRAW 0,35 150 PLOT 104+n,48: DRAW 0,35 160 NEXT n 200 FOR n=0 TO 11 210 PLOT 0,139-n: DRAW 111,0 220 PLOT 255,139-n: DRAW -111,0 230 PLOT 255,84+n: DRAW -111,0 240 PLOT 0,84+n: DRAW 111,0 250 NEXT n 300 REM St. Andrew 310 FOR n=0 TO 35 320 PLOT 1+2*n,175-n: DRAW 32,0 330 PLOT 224-2*n,175-n: DRAW 16,0 340 PLOT 254-2*n,48+n: DRAW-32,0 350 PLOT 17+2*n,48+n: DRAW 16,0 360 NEXT n 370 FOR n=0 TO 19 380 PLOT 185+2*n,140+n: DRAW 32,0 390 PLOT 200+2*n,83-n: DRAW 16,0 400 PLOT 39-2*n,83-n: DRAW 32,0 410 PLOT 54-2*n,140+n: DRAW -16,0 420 NEXT n 425 REM fill in extra bits 430 FOR n=0 TO 15 440 PLOT 255,160+n: DRAW 2*n-30,0 450 PLOT 0,63-n: DRAW 31-2*n,0 460 NEXT n 470 FOR n=0 TO 7 480 PLOT 0,160+n: DRAW 14-2*n,0 485 PLOT 255,63-n: DRAW 2*n-15,0 490 NEXT n 500 REM red stripes 510 INVERSE 1 520 REM St George 530 FOR n=96 TO 120 STEP 8 540 PLOT PAPER r;7,n: DRAW PAPER r;241,0 550 NEXT n 560 FOR n=112 TO 136 STEP 8 570 PLOT PAPER r;n,168: DRAW PAPER r;0,-113 580 NEXT n 600 REM St Patrick 610 PLOT PAPER r;170,140: DRAW PAPER r;70,35 620 PLOT PAPER r;179,140: DRAW PAPER r;70,35 630 PLOT PAPER r;199,83: DRAW PAPER r;56,-28 640 PLOT PAPER r;184,83: DRAW PAPER r;70,-35 650 PLOT PAPER r;86,83: DRAW PAPER r;-70,-35 660 PLOT PAPER r;72,83: DRAW PAPER r;-70,-35 670 PLOT PAPER r;56,140: DRAW PAPER r;-56,28 680 PLOT PAPER r;71,140: DRAW PAPER r;-70,35 690 INVERSE 0: PAPER 0: INK 7
This program actually draws the the US flag on a ZX-Spectrum compatible computer !
ZX-BASIC had line number, and wasn't really structured. To jump from point to point you used GOTO instructions, which are discouraged in any modern language. Typing one of these programs was hard, because it was not possible to write the keywords directly, instead they were layed out on the keyboard, and each instruction was typed with key combinations
I participated in national competitions for children, with my programs, and even won some prizes. At this point, I was already addicted to programming :)
Borland's Turbo Pascal
Later, during first year of high-school I got my first PC. With it, I begun programming first in QBasic, which wasn't very interesting and run horribly slow for a PC, then quickly moved to Pascal. Specifically, Borland's Turbo Pascal.
Those were DOS programs, and Turbo Pascal ( known as TP ) produced executables (.exe), which run on DOS and often mistakes caused computer freeze or crash, followed by the mandatory restart. It was quite difficult in the beginning, until I learned how to safeguard my programs against infinite loops (which caused freezes) and memory corruption errors, and MANY MANY restarts. Fortunately my PC had a harddisk, and started quickly
While Turbo Pascal supported object-oriented programming, at that time I had nowhere to learn such advanced topics so my programs were mostly procedural. TP also had an user interface library named Turbo Vision, which allowed writing programs which had windows, buttons and stuff that today we're very used to in Windows operating system (and similar). However, those windows and buttons were in text mode only! Here's some Turbo Pascal example code:
Program Calculation; Uses Crt; Var Number1, Number2: Integer; Procedure Calculate (Num1, Num2: Integer); Begin WriteLn ('The result when you add the two numbers too each other is ' , Num1 + Num2, '!'); End; Procedure User_Input; Begin WriteLn ('Type in the first number and press Enter: '); ReadLn (Number1); WriteLn ('Type in the second number and press Enter: '); ReadLn (Number2); Calculate (Number1, Number2); End; begin ClrScr; User_Input; end.
In school, 9th and 10th grades, I participated to national programming competitions, at that moment I was probably the best programmer of my age in my entire city. Writing in Pascal I learned complex algorithms, data structures, and many other concepts which I still use today in web-development programming.
Borland's Turbo C++ (Object Oriented)
While Pascal was fun, serious high-quality programming started only when I switched to C and C++. I found three wonderful books back then ( this was around 1995 ), which I still have today. They thought me how to write in the most powerful programming language ever invented: C++
My early days of C++ programming were also done in a DOS environment, using Borland's Turbo C++ version 3.0, which also included the Turbo Vision library ( C version ). With it I started exploring advanced topics like 3D graphics calculations, animation, signal processing ( I made back then a simple sound synthetizer ), and started experimenting with network programming ( initially IPX, because TCP/IP did not exist in DOS at the time )
Unfortunately, I have no surviving programs from back than, due to a catastrophical hard-drive failure and lack of backups, which wiped out all my work in Pascal, C++ and everything I created so far. I learned the hard way that it's important to have multiple copies of important data, because electronics don't last forever !
HTML
During my last year of high-school a very-slow internet was introduced (using a dial-up line, for the entire school!). I have learned then of a technology that is used for web pages, named HTML. It's not a programming language, rather a way to write text in order to be displayed on the internet. I was curious of this, but never got to experiment with it due to impossibly slow and sporadic connection to internet.
Only two years later, when I got a network administrator job at a private company, I had access to my own dial-up, which wasn't faster then the one in school, but it was only for me ! There, I started to learn more about the wonderful thing called Internet, and begun studying how it works, what are webpages and what is that code that makes them look the way they do. Next job was also as network administrator, this time of a permanent "rented-line" connection ( also a dial-up, but which worked 24/7 ), and my knowledge of the internet expanded
Around year 2000-2001 I created my first web pages, which were static ones, just text and pictures. In all this time I kept programming in C++, moving from DOS version of Borland C++ to windows version of the same program, and I discovered the technology called TCP/IP, which is the basis of almost all internet communications.
I attempted to write programs which communicated with TCP/IP, and trying to access web pages using C++ network code, but it was very hard, with little information available on how to do it the right way. Nevertheless, I had some successes in the area and created a few client-server applications (just experiments, nothing big
It was during this time that I created my first website, which you can see HERE (no idea who the nice lady is, but at that time she seemed very preety!).
PHP, PHP5
With the explosions of internet access in Romania in the late 2001 (using Connex's free Dial-Up service - which initially was wonderful, but lately became so overcrowded that it was almost impossible to get a connection), I managed to get internet at home. I have learned so many things during that time, with access to so many sources of information!
Then I discovered PHP ( which just introduced version 4.1 ). It miraculously solved all my network-communication experiments with a C-like language... no longer necessary to write complicated code to open a port, connect to an IP address, send and receive packets, code/decode data... PHP simply worked ! With a few instructions I was able to send data from a computer to another and make programs that displayed something in a browser screen (I think I used Internet Exporer 4 in Windows 98)
The simplicity of PHP and it's close relation to C++ got me totally addicted to it, I almost immediatly ceased all my experiments with Borland C++ (for Windows) and moved to learn PHP. Soon after I created first dynamic websites and continously experimented with what PHP has to offer
During a job I had at a company named Cosidor Computers, around year 2002, I was assigned the task to create a website for them. I worked hard and managed to create something interesting, however they weren't please very much and that website never saw the light of day. It was however the start of my web-development career, which continues today!
As time passed, I learned more and more about PHP, then discovered the idea of SQL database systems, specifically MySQL, which really kick-started my web development. Before that, there was only FoxPro, which was clumsy and difficult to use and program (unfortunately is still in use today in some business environments).
Windows Visual C++/DirectX
I never really abandoned C++, so much later ( already using Windows XP ) I started to learn about DirectX and fast, hardware accelerated computer graphics. Microsoft DirectX's API is relatively easy to learn (which is the reason there are SO many games today which use it, compared for example with OpenGL which is much harder). I created a few game experiments with DirectDraw ( in 2D ) and even very simple 3D graphics.
While today I don't write anything in C anymore, there might be a time when I get back to this kind of programming, if time and resources permit. I find it very interesting and enlightening
Integrated Web development (PHP, HTML, CSS, MySQL, JavaScript)
During year 2004 I already new a lot about web development, so I created a micro-company called a "PFA" (which had my name: Alin Voiculescu PFA). With this, my web production business officially started, and managed to get some clients. Some of these websites can be visible on the Portfolio page. Some of them are still online today ! Not long after, I renamed my PFA into Hyperdreams Studios, which then became a real company named Hyperdreams Ltd. I was empoyed on this self-owned company for several years.
I have improved the quality of my creations during the years, with successes and setbacks, and perfected my PHP skills, also learned a bit of JavaScript ( which at that time wasn't ready for prime-time ). It is unfortunate that I didn't like javascript much back then, it would have been very useful if I learned it earlier !. I wrote A LOT of code in PHP, hundreds of thousands of lines, and in time discovered that a lot of code is repeated in all projects. This lead to the creation of "libraries" of code, which I used repeatedly in different projects... which then evolved into a framework.
Today, there are many PHP frameworks and libraries, and I have learned to use some of them: PEAR, Zend Framework, Symfony (which I didn't really like), and also created my own: Initially named WAMIS, then renamed into Hydra and finally today named DonReY, which has became an Open-Source project. Today I use Zend or DonReY for all my web projects.
Advanced JavaScript/jQuery
Very late in my career I started learning JavaScript the right way. It was during winter 2008 that I discovered that no modern website can exist without JavaScript, and most jobs require knowledge of it. I'd like to thank Douglas Crockford, a real JavaScript GURU, for his wonderful tutoral videos and presentations. By studying those I finally understood how JavaScript really works and begun writing serious code in JS. Today I can say that I know JS almost as well as I know PHP, however there's always some new trick to learn :)
There are several JS frameworks out there, and while I studied many of them, I chose JQuery because it's the most fun to use. Not the most powerful, not the most complete, but definitely the one that really helps you get going with minimal coding!
PHP
- DonReY Framework - Active project
- Wavetrex.eu Website - Active project
JavaScript
- Unnamed HTML5 canvas game - Active project, very early in development