The Student Room Group

Tech in Two: What is Programming?

What is programming?

In its simplest terms, programming is giving instructions to a computer to tell it how to complete a task or tasks. Programming is also commonly referred to as coding, or sometimes development.

A computer program is made up of a series of instructions, known as code, that tells the computer how to carry out a series of tasks; a computer is anything that can run this code, such as smartphones, or laptops.

A real-life equivalent would be a detailed recipe - it outlines the exact steps you need to take, or execute, in order to complete your task, which in this case would be cooking or baking something.

How do we communicate with computers?

Computers use electrical signals that are either on, or off; from a code perspective this means they use binary code, which is made up only of 1s (on) and 0s (off). Therefore, all input and data that we want a computer to process must be converted into this format. This would be very complex for a human to communicate with, which is where programming languages come in; they are a more human readable way to write code.

Languages can be high level, or low level; the more high level they are, the further from machine language - the language computers use and understand - they are, and the easier they are for humans to read. When you run code, a translator is used to translate the code into an application that the computer understands how to run; think Google Translate, for an everyday equivalent!

What are some key programming concepts?

There are a number of key programming concepts that it’s important to understand - whilst the way you write them will differ between languages, the core ideas behind them do not. Some of the basic ideas are listed below.

1.

Variables: A variable is a way to store information that your program needs to use; it includes the variable name, the data type, and the content you’re storing. Variables are generally used to store something that you want to keep using; for example, user input, so that the program doesn’t need to keep checking what the user typed.

A day-to-day equivalent might be a dictionary - e.g. the word bamboozle is a verb and it means to fool or trick someone. The fact it’s a verb tells you how to use it, and storing the definition in the dictionary means you can use it without referring back to the meaning every time.


2.

Conditional Statements/Control Structures: These are a way to outline when a certain piece of code should be executed - for example, if/else conditions will execute if something is true, or do another thing if not. From a computer program perspective, an example could be if the user clicks the ‘yes’ button then carry out a set of actions, else carry out a different set of actions. A real world example would be if you are hungry then eat some food else wait until dinner.


3.

Loops: A loop is a way of repeating a piece of code multiple times, without having to write the same instruction over and over. For example, if you wanted to carry out an action on a list of users, such as printing their age, you could write an instruction for each user to do this, but this would be very repetitive, especially if you had many users. Instead, you would use a for loop to say for first user to last user output the users age.


Want to learn more?
Original post by Resonance234
Hi

I liked this summary, did you do any for Data science and algorithms/data structures?


Thank you, I'm glad you liked it - I haven't as yet, but I can certainly cover that next if it would be useful! :biggrin:
Reply 2
I understand the contribution, but what's the point when people could just Google it?
Original post by Resonance234
Hi, so me again, my repost derives from the fact that I am really seeking to strengthen my programming and Algo knowledge, I have basic experiences here, but not enough, summaries like yours help, but now, unfortunately and annoyingly I will have to suggest some improvements and additions, because it gives me an opportunity to think:

Wonder what you make of my suggestion:

I would have personally included a few improvement to this:
1. Object oriented programming vs functional programming paradigm.

Well, ive been told, or the general impression seems to be that one of the ways that languages can be classed are whether they are object oriented or functional programming languages.
So is this important or unimportant when introducing people to programming?

I'd say that it's a bit of a distraction and largely irrelevant to a beginner. All the popular programming languages don't fit into any neat categories like that. Languages like Python, C++, Java, C#, VB.NET, JavaScript, etc. are all very capable of being used as 'functional' languages, but they're also equally able to be used as 'object oriented' languages. So I don't think it's very useful to describe languages like that since it's usually an over-simplification.

By contrast, for those languages which can be categorised in such narrow terms, you're usually looking at the kinds of 'purist' languages which hardly anybody ever actually uses in the real world.

In my opinion, a more useful way to describe languages to a beginner would be in terms of the kinds of things that people commonly use those languages for and where those languages' strengths are, because that can give you a better idea of the kinds of things which someone learning a language might actually do with it in real terms. For example:

- JavaScript is mostly used for web development because it's the scripting language used by all the main web browsers.
- C++ is often used for systems where performance/optimisation is important (e.g. games, 3D simulations, embedded microcontrollers).
- Python is fairly general but used heavily in data science and AI for data processing and statistical/probability modelling.
- Java and C# are also fairly 'general' but often used for building large enterprise-level business systems including GUI apps and web servers.


Terms like 'object oriented' and 'functional' are paradigms. A paradigm is a "mode of thinking" or "pattern of thought" when related to programming. But more importantly, different paradigms (thought patterms) often lend themselves to different kinds of problems. For example, functional programming can be really elegant when trying to process huge sets of data, but object-oriented programming can be very elegant if you're trying to build a GUI with lots of controls/widgets on the screen.

but there are many more than just those, and most of the popular programming languages are built around lots of other different paradigms too. For example, there's procedural programming, generic programming, aspect-oriented programming, event-driven programming, etc. Again, all those different paradigms have their uses for different kinds of problems, and programmers who are building large bits of software usually prefer to mix-and match different paradigms within the same code, since those problems rarely exist in isolation from each other.


Original post by Resonance234

2. Completeness of languages; Turing completeness? And other classifications of languages..Never really understood this (we dont do formal logic and automata theory or anything like that).

'Turing complete' simply means that the language is able to solve computational problems. All programming languages are turing complete by their very definition (i.e. a programming language must be able to solve computational problems, otherwise it is not a programming language).

Of course, there are loads of computer languages which aren't programming languages. For example, HTML and CSS aren't designed for computational problems, they're designed for the content, layout and styles which appear on a webpage.
Original post by Resonance234
Informative. Would you be doing any tech in two posts?

Maybe :smile: Trying to fit a tech topic into 2 minutes might be difficult though
Original post by Async
I understand the contribution, but what's the point when people could just Google it?


Largely this is aimed at people who don't have much of a tech background, but are interested in more of a 'crash course' in the basics. Naturally you could Google it, but doing so for any tech topic gives you a wealth of resources, and it can be challenging to source out the ones with actual value if you're a beginner in the subject :smile:
Original post by Resonance234
Hi, so me again, my repost derives from the fact that I am really seeking to strengthen my programming and Algo knowledge, I have basic experiences here, but not enough, summaries like yours help, but now, unfortunately and annoyingly I will have to suggest some improvements and additions, because it gives me an opportunity to think:

Wonder what you make of my suggestion:

I would have personally included a few improvement to this:
1. Object oriented programming vs functional programming paradigm.

Well, ive been told, or the general impression seems to be that one of the ways that languages can be classed are whether they are object oriented or functional programming languages.
So is this important or unimportant when introducing people to programming?

2. Completeness of languages; Turing completeness? And other classifications of languages..Never really understood this (we dont do formal logic and automata theory or anything like that).


It looks like winterscoming has covered this quite comprehensively - in general though, these questions would come as their own 'Tech in Two' rather than within this one, as otherwise it starts to go beyond a two minute intro! :tongue:

Original post by winterscoming
Maybe :smile: Trying to fit a tech topic into 2 minutes might be difficult though


You managed it impressively well in your earlier reply to this thread! :yep:
Original post by shadowdweller
You managed it impressively well in your earlier reply to this thread! :yep:

Glad you think so :smile: Guess I could try to think of another topic to do, but 2 minutes is tough for a lot of big tech topics
Original post by winterscoming
Glad you think so :smile: Guess I could try to think of another topic to do, but 2 minutes is tough for a lot of big tech topics


If you want to have a chat about some topics, or some help with condensing a larger one, feel free to drop me a PM any time! :smile:
Original post by shadowdweller
If you want to have a chat about some topics, or some help with condensing a larger one, feel free to drop me a PM any time! :smile:

Thanks! :smile: I'm not quite sure when I'll get around to it, but I might take you up on that offer if I end up writing one to ask for a bit of a review. I'll have to wait until I've got a good chunk of time, I usually find it takes a lot more effort to write something that short :lol:

Quick Reply

Latest