Skip to content

if you are a learner that is used to graphical coding, you need to have at least an idea about text-based programming

Notifications You must be signed in to change notification settings

jdevfullstack-tutorials/intro-to-text-based

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 

Repository files navigation

Intro To Text-Based Programming

The very nature of the computer was text-based. Before the advent of advanced screens, all a computer could display were characters through static pixels and even early games just relied much on that.

Remember that computers will consume purely the binary data as it is the nature of the computer but as for humans, it's really tedious. So, humans and computers must meet halfway: text that humans can easily recognize.

But text will still return to binary data through character encoding: the specific pattern for each character expressed as bits.

Graphical coding is just for beginners and this was just lately developed. Beginners back then had the option to start with the original BASIC language but still it was originally text-based.

Objectives

  1. display knowledge of the text-based programming
  2. compare text-based and graphical coding
  3. utilize the text-based using the VEX VR
  4. utilize their existing programming knowledge and skills for the text-based programming
  5. utilize the Coral Reef Cleanup Map with the aim of finishing the mission using text-based programming

Intro

Graphical coding is the trend nowadays, particularly for students. Even the Scratch program is graphical.

From Coding Kids site, reasons why beginners use graphical coding:

  1. Readability
  2. Ease Of Use
  3. Technical Knowledge
  4. Typing

But even though graphical is the first choice, you still need to transition to text-based or at least have a full understanding of text-based.

All programming languages that are being used in the actual software development world like in Facebook and Google companies, they are text-based. Your graphical coding, in structure, is very limited while the text-based is not.

Some text-based programming languages being used by these companies, such as PHP for Facebook scripting while the core is C language. For Google, they heavily use Java and the core is still C language.

Limitations of graphical coding:

  1. It will be very slow for a very big project (a typical codebase in the world of software development is composed of thousands of lines, others amounting to more than a million lines of code).
  2. The structure is limited. Programmers have coding patterns that are really impossible to be written using graphical coding.

VEX VR Text-Based Programming

VEX VR Code is based on Python while RobotC is based on C.

From w3schools site:

What can Python do?

Python can be used on a server to create web applications.

Python can be used alongside software to create workflows.

Python can connect to database systems. It can also read and modify files.

Python can be used to handle big data and perform complex mathematics.

Python can be used for rapid prototyping, or for production-ready software development.

Why Python?

Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).

Python has a simple syntax similar to the English language.

Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.

Python can be treated in a procedural way, an object-oriented way or a functional way.

Thread And Main Thread

A thread in a programming language is a separate program execution. The main thread in VEX VR (the when started block) is the main thread. Without the main thread all commands are just declarations.

Common Keywords & Symbols

import - import commands from an existing library. All commands that you are dragging from the left pane are predefined coming from the internal library of VEX. Without this, you will manually do that.

def - define commands, declarations, etc., they are just declarations

vr_thread - the thread that usually contains the main thread, without this, your program will not run

# - for Python, this is the symbol to start commenting

. - the dot, a separator to separate the object and its attribute. For example, dog is an object, it has the attribute smell, you will be writing that as dog.smell.

To Camel Case Or To Not Camel Case

What if I tell you it's just a convention?

Yes, the most important one is that you stick to one agreement. But other parts of the Python code must be written in a specific way. And any naming convention must be succinct.

Useful And Valid Links

https://www.w3schools.com/python/python_intro.asp

https://www.codingkids.com.au/for-teachers/visual-based-vs-text-based-programming-languages/

https://cs.brown.edu/~adf/programming_languages.html#:~:text=In%201957%2C%20the%20first%20of,access%20to%20the%20computers%20innards.

https://zipitclean.com/invention-news/why-was-the-computer-invented/#:~:text=Why%20was%20the%20computer%20invented,were%20previously%20completed%20by%20people.&text=Babbage%20was%20a%20mathematician%2C%20philosopher,negate%20human%20error%20in%20computation.

About

if you are a learner that is used to graphical coding, you need to have at least an idea about text-based programming

Resources

Stars

Watchers

Forks