In this tech savvy world, it's hard not to encounter a computer in your daily lives, and indeed if you are reading this blog... Well, you are using a computer right now (obviously!). Many of us go about using 'applications' without even a thought to the work that goes into producing them for our enjoyment. Programming may seem like a daunting task, but really it's very fun and simple to get into!
If you've read this far then I'm going to assume that you'd like to know more about programming, maybe you might want to give it a go yourself? If you do, then you're in the right place because with the miracle of the internet you can give programming a try without even needing to download anything to your computer.
http://ideone.com
IDEOne is a wonderful website that allows you to program online without needing to download any software onto your computer's hard drive. It is an online 'Integrated Development Environment', all this means is that it's somewhere you can write code and it will produce an output from what you typed into it.
Once this has been clicked on, the JAVA code that we witnessed earlier will have been replaced with sample code from the programming language 'Visual Basic.NET' commonly abbreviated to 'VB.NET'.
Let's break this code down:
Imports System - This is a short piece of code that will import a 'library' into the IDE. The 'System' part of this code is telling IDEone that you want to import the 'System' library, which is the core library of VB.NET. Libraries are sets of preset instructions that you can write which are then expanded ~behind the scenes so to speak~ into larger pieces of code.
Public Class Test - Without getting into to much detail, VB.NET is an 'Object Oriented Programming Language', this means that it works with blocks of codes called objects. Objects contain two main components: The code and the data. A class is the top dog, defining the parameters, variables and events of an object. Once a class is defined, as many objects relating to that class as you want can be created. 'Public' means that the program in its entirety can access this class, and the 'Test' part is simply the classes name.
Public Shared Sub Main() - 'Sub' unfortunately doesn't refer to the sandwich, but rather a shorthand way of saying 'subroutine'. This is where any code that you want executing should go, inside of a subroutine. Subroutines perform the operations that produce outputs but shouldn't be confused with 'functions' which actually produce the outputs. A subroutine can be as long or as short as you want, containing mathematical code or simply text for output. The parenthesis are there for something called 'arguments', but don't go writing swear words in the brackets, I will leave explaining arguments for another time.
End Sub/End Class - 'End' statements are simply to mark the end of some code, simply book ends!
EXCITING PART! - Now to actually write some code of your own!
Imports System
Public Class MyFirstProgram
Public Shared Sub Main()
Console.Writeline("PUT ANYTHING YOU WANT HERE!")
End Sub
End Class
Once you have copied and pasted that, you may click on the 'RUN' button:
Or... You could personalize this code. Where I have written 'PUT ANYTHING YOU WANT HERE', change that text to anything you want, but leaving the 'Console.Writeline("") intact, only changing the text inside of the speech marks. Once you click run you should see the screen change and your text output!
Now you have written your first program and taken your first steps into the wonderful world of computer programming. Well done. I will do another lesson next time on doing simple maths within VB.NET.
Thank you for reading,
Joseph Wright: SCOTech.
IDEONE suggested by Harrison Taylor. Thanks!