Ewan's Programming Tutorial - Basic Programming Knowledge

Hey gamers programmers, first tutorial on here and I’m planning to do more. In this tutorial I will discuss basic programming terminology and tutorials later on. This series of tutorials is meant to be a crash course and will progressively get more advanced as I move through these tutorials.

I hope this tutorial is well explained and accessible, thanks for taking interest in this.


Terminology

Well, programming is supposed to be universal and so is it’s terminology. Don’t worry, these aren’t hard to learn and (hopefully) will easily be remembered.

  • Globals – Globals are a blanket term for functions/variables which can be called from any type of script (modulescript, localscript or script).
    • Global Functions can be called from any script and can be used anywhere! (take require for example)
    • Global Variables are variables which can be called anywhere! Like the workspace constant (it’s a constant because it’ll always exist no matter what) or math.pi (which is also a constant because there will never be a day where pi doesn’t exist, cherry pie don’t leave me please :pie: ) .
  • Functions, basically something which performs a specific task (even if it’s creating a black hole!).
  • Variables, little snippets of information within code. From text “Ewan is a Noob” to numbers like 1337.
  • Serialization, turning an instance into a piece of information which can be used later. Like packing SFOTH into a table and using it later (see this epic article for more info).
  • Deserialization, turning a piece of serialized data into something physical. Like a brick for example!
  • Libraries, basically a blanket term for specialized functions. Like mathematical based operations like math.tan. This is what you plug your code into rather than framework which is the opposite.
  • Replication, essentially sharing a piece of data (like an instance or string) between multiple clients/systems. See Starmaq’s reply.

Okay that should be a good starter!


Events

What are Events?

I’m glad you asked, events are something which fire (start) when a certain action is performed. Like me washing my car for example. These can be used to make killer bricks >:) or similar. This should go above but I like readability :heart:.

Tables

What are tables?

Tables are a form of representing large quantities of data within code, like how many pies Bob, Jerry and Toby has.

local array= {20, 20, 500} --this is an array

local dictionary = {bob = 20, jerry = 20, toby = 500} --this is a dictionary

local dictionary2 = {
["bob"] = 20;
["jerry"] = 20;
["toby"] = 500;
}

Frameworks

What are they?

Frameworks are just a big fancy word for a group of modules which are specialised to do a certain task, like a FPS system.

API

What is this?

It’s an abbreviation for Application programming interface. It’s a bit like a framework accept it’s on a much grander scale. It is just a big term for what a set of functions go under, like calling wait would be under the Roblox Lua API.


Okay okay, that should be enough info. (I promise)

Well done for making it this far and making it through my rambling, I now gift you with this:

Gift

image


My best practises for trying to code.

When I was in my first few months of programming, I would just copy and paste code from the tutorial. If you want to learn, DO NOT do what I did. Instead, experiment with the code and think: “Hmm, what would happen if I changed this to this?”.

Another good practise for writing long scripts is to write a small plan down on a bit of paper. A flow chart is what you are looking for here. I find that no human can write long pieces of code just from their head. It’s a lot of hassle and sometimes you’ll forget what you are even supposed to do! If you don’t like writing on paper, use this website for making one yourself. Heck, even reply with ones you personally like!


Okay awesome, hopefully you have more information in your noggin than about 10 minutes ago!

In the next tutorial, we’ll be looking at CFrames and the more mathematical side of programming in Roblox! Also, all feedback is welcome. Just don’t make it destructive :heart:

19 Likes

Actually, arrays are like this:

local tab = {100,500,1000} -- ordered list of items

And dictionaries are like this:

local tab = {First = 100, Second = 500, Third = 1000} -- key-value pairs
1 Like

Sorry for the mistake lol.

I started writing it at 1am so excuse me for the weird grammar and me calling arrays dictionaries. I just corrected my mistake, thanks for pointing it out :heart:

1 Like

Manly tutorial, covered terminology pretty well in a short descriptive way.

Please do make it clear that a Framework is what you plug your code into and a Library is what you plug into your code. Frameworks and Libraries are usually confused with one and other to be that they’re the same thing, however that is not the case.

3 Likes

Nice tutorial! The definition of Replication needs to be re-worded in my opinion.

Replication, essentially sharing a piece of data (like an instance or string) between multiple clients/systems.

sharing will give the sense of a single piece of info being used in both the client and server, while actually, a copy of the server’s piece of info is made and transferred to the client.

A simple way to think about it is, if a change is applied in the client to that piece of info, only the piece of info in the client will change,the server’s original piece of info is untouched, it’s still the same. They’re different pieces of info.

Another way to phrase that last paragraph, changes in the client do not replicate to the server (in Roblox at least, when Filtering Enabled is true, and it always is)

1 Like

Good practise for total beginners: Use a styleguide, it helps so much with standardisation and reading.

The styleguide I personally use it Roblox Lua Style guide, but there are a limitness number of styleguides out there.

3 Likes