Introduction to programming

Programming Languages

Microsoft’s office suite is much written in the programming language C++. Anyone who has used Excel, from that suite, knows it has computational abilities; knows it can sum and average columns, do %age calculations, add to dates, etc. But manipulating the data in excel is limited to that provided by its program. If you want to manipulate data, in ways of your choosing then you should learn a programming language and write programs that do what you want them to do.

There are numerous computational programming languages. Popular are Python, Java, Javascript, C including C++ and C# , Perl and Ruby. Once you learn one, it is easier to learn another, because the ways of data manipulation are much the same. However the language syntax that gets you the desired result can be entirely different as illustrated. Both C++ and Java require a compiler to convert the written syntax into code that machines understand.

The syntax in C++ and in Java to produce the same hello world! output is different

You will note that I haven’t included html or css in the above list. They are programming languages, but declarative not computational. When we write something inside the paragraph tags of an hyper text mark up language file we expect that something to appear on the page just as we declared it. If we have a cascading style sheet that has declared font styling for html paragraph tags we expect that something to appear so styled. Many a downloaded html file will include a reference to a javascript file that can modify html on user input or say according to location.

No matter what programming syntax we use it has to be converted into the voltage pulses and binary language that digital machines understand .

From a user point of view pressing a key or combination of keys on a keyboard whilst in say a word application or when sending a message using a phone, tablet or computer will result in either some action or the display of a visible character on a screen.

From the machine’s point of view the keyboard input becomes electronically a rapid sequence of high and low voltages. A high voltage we say equates to a binary 1 and a low voltage to a binary 0. For an explanation of binary and its compressed hexadecimal form read my blog on numbers.

How the machine deals with the input is determined by the program loaded into the machines random access memory from its hard drive storage. The keyboard electronics converts keyboard presses into binary related voltage pulses. The screen electronics convert the binary related voltage pulses into screen pixel data, thereby displaying character shapes that correspond to the keyboard inputs. We measure digital data in bytes. Any 8 bits of 1’s and 0’s is a byte. All of the symbols in the above table use 1 byte of digital data.

Our machines processor has a built in instruction set that recognises and responds to specific binary pulsed voltage code sequences. Opcodes link to the instruction set and tell the processor what to do. Operands lead to binary addresses where further binary instructions or binary data may be found and processed.

The 1’s of software program in memory are electrostatic charged bits whilst 0’s have no charge. Memory charges are maintained by regularly refreshment. The program may access the hard drive for further instructions or for data such as images or text . Older hard drive platters comprise of billions of sectors that are either magnetised (1) or not magnetised (0) whilst a more modern SSD’s (solid state drive) with say a terabyte of storage has upwards of eight trillion toggle type transistors on it whose state does not need refreshing., 

It is essential to understand that all operating software, programs, images, texts and other data are stored as voltage associated 1’s and 0’s. Digital machines do not store pictures or text.