2 Synthesis‎ > ‎Computing‎ > ‎

Programming

This is really just my wanderings into computer languages and since I haven't done a lot in the last ten years and only restarted recently its a bit sparse and messy. Back in the 1980s I did a huge amount of C and 6502 Assembler. Plus some 68000 and 6809 assembler, Fortran 77 and C++. In the late 1970s I even got to use punched cards and paper tape to write programs on!

Which Language?

As I have dipped into languages and started serious programming again I time and time again ask which language? There are many factors.

C

Well the Linux Kernel is still C based and the official language of Linux is C.

My C and C++

C++

"In particular, I do not try to enforce a single style of design through a narrowly defined programming language.  People's ways of thinking and working are so diverse that an attempt to force a single style would no more harm than good.  Thus, C++ is deliberately designed to support a variety of styles rather than a would-be 'one true way'." Stroustrup-Design and Evolution of C++ (Addison Wesley, 1994) pp. 24.

Now personally I think of this as a bad point of C++. If you have a team of six programmers, unless you impose style rules you get six different styles and nobody can read anybody else's code.

I fake interview circulated the internet which really makes fun of C++. My personal experience of it is was trying to figure out why what took me days in C took other people weeks in C++. I thought I must be a great programmer but now I think its probably that C++ although in theory hugely powerful, in practice its power that isn't needed.

My C and C++

Java

At first it looked like what C++ could have been if it hadn't had to be compatible with C.

Python

Python's philosophy rejects the Perl "there is more than one way to do it" approach to language design in favour of "there should be one—and preferably only one—obvious way to do it". I like this idea but I have yet to explore it.

What's interesting about it is that there is a version of it called MyHDL which is a Hardware Description Language. i.e. they use it to design logic circuits in. That tells me this is a pretty exciting language.

My Python

Ada 

Ada, the language they use for military software. Very safe right! So I tried it and even a simple "Hello World" proved unsafe, also I hate writing "integer" instead of "int". Programs were twice the characters of C. Here are my exploits in Ada and how you can do the same. 

For programming;

My Ada

Hardware Description Languages 

These are interesting because using a language to represent a circuit is an interesting concept in its self. I am not daft enough to think these are standard programming languages!

My HDLs

Language Speed?

Well it looks like C and C++ are neck and neck with Java and C# taking about 2 or three times longer and using more memory then after that and taking 30 or more times longer are all the script languages like Python, Perl, Ruby etc.

Conclusion

OK now I feel better having programmed in one of the fastest languages C. By the way for those wondering about Assembler programming I would say, from experience, that if you write your code with proper consideration for the processor i.e. don't declare a 32 bit integer when you want to count from 0 to 10 on an 8 bit processor, then C is as probably as good as assembler.

My decision at the end of this little review is that I still love C because its simple and easy to write easy to follow code if you know what your doing, C++ because it gives you the freedom to be really elegant or ugly to suit your day and Java because its simpler than C++ with some of the same potential beauty. All the rest are too slow for my comfort though I will look at Python one day because I like the philosophy.

P.S. I would say to be fair I didn't see Ada in any of these benchmarks. I still like Ada a bit even though it spat at me in my "Hello World" program.

Which Operating System?

Linux

Ubuntu was great until after 11.04 then unity ruined it. However thank God Linux is more than Ubuntu. In fact what ever you learn in Linux is likely to be around for a long time to come. Unix has been with us for so long and its based on the best of computing.

The Linux file structure;
Code Samples in all languages:

Active State Community

Windows

Too many changes between versions. I haven't used it since Windows 2000. I keep a hard disk with it installed to run a few old games on. Soon Steam will be supporting Linux and then it might be goodbye.