Thursday, June 20, 2024

Coding tutorials-1

 

Coding tutorials

Coding can be acquired by :

1 Take Online courses 2 Watch Videos and Youtube episods, 3 Read books and study materials as ebooks, 4 Use tools available in the market to learn coding, 5 Consider enrolling in online coding boot camp, 6 Join Internership available in the market for a coding projects, 7 Join free coding classes.


1.      What does it mean to “compile”?

1.      What you wrote is a text file

3.      Computer doesn’t speak English (it is made by aliens)

4.      Compile = convert your text file (English) into a computer’s language (byte)

5.      Use a “Compiler” to compile your program

6.      Made by those awesome dudes who speak alien’s language

7.      It translates various programming language into byte code.

8.      C++ compiler: “g++” and “clang++” as most typical choice.

 The ability to write computer programs is an important skill that is needed within numerous disciplines, and an understanding of the fundamentals of a computer language is essential. This writings will provide a list of online resources that cover the basics of the following programs and languages: C++, Python, JavaScript, Java, and MATLAB. You can navigate to specific sections of this handout by clicking the links below. C++: pg. 1Python: pg. 3JavaScript & Java: pg. 4 MATLAB: pg. 6 C++C++ is a foundational computer program in the industry. It is used in a variety of disciplines, such as  engineering, computer science, and information technology. Becoming comfortable with C++ will enable users to program in a variety of other languages built upon the language, such as C# and Java.

C++ Coding :

Documentation - Some programming languages provide a website or built-in resources which are typically called the program’s documentation. For students with questions about C++, they should first reference the documentation. Published C++ tutorials can be found on the official C++ website under the “Resources” and “Tutorial” tabs on the left-hand side of the homepage.  Compiler - C++’s debugging phase can be tedious. To make debugging easier, users should write and run their program using an application called a compiler. A compiler will allow the user to identify lines of a program that are causing problems to the code. A well-known compiler is Code::Blocks. The Code::Blocks installation instructions can be found on the official C++ website using the “Code::Blocks” link under the Compiler tab.  YouTube - Students seeking additional assistance with writing C++ programs may find YouTube to be a valuable resource. One YouTube playlist, published by the channel Programming Knowledge and entitled C++ Programming Tutorial for Beginners (For Absolute Beginners), begins with the basics of installing Code::Blocks, discusses basic C++ functions, such as ‘for loops’ and ‘while loops,’ and then proceeds into more advanced topics, such as classes and data structures.

Python :

Python is an object oriented program used across many disciplines. It has a unique syntax that is designed to be easy to read. While this requires less effort for new students to learn, it can produce confusion for students who have previously learned another language such as C++ or Java. Because of its readability and use in a variety of applications, Python is perhaps one of the most commonly used computer languages. Python References• W3schools - W3schools is a helpful site with resources for a variety of computer languages. The site’s Python portion includes tutorials and examples that allow users to practice writing programs. Many of its tutorials cover specific topics that help the user learn the material in smaller pieces. After each example, there are sections entitled “Test Yourself with Exercises”; these allow users to practice their skills and have their work checked automatically by the website.

JavaScript & Java :

Although JavaScript and Java have similar names and are based on the C language, their functions are quite different. JavaScript uses basic programming to develop webpages and make them more interactive. Java, on the other hand, is an object-oriented programming system similar to C++. It can be used to write many different types of programs. JavaScript Resources• W3schools - In addition to Python resources, W3schools also offers many of the same  tools to help students learn JavaScript coding, such as helpful, interactive examples and practice questions. W3schools is a better option for novice users looking for practice with JavaScript. Using the link entitled “Learn JavaScript” under the website’s Tutorial stab, students can find basic instructions for foundational JavaScript concepts.

MATLAB :

MATLAB is a programing language that is commonly used in engineering courses and is often utilized to calculate and graph data. MATLAB has similar commands and functions to C++, but the syntax is slightly different. MATLAB Resources • Documentation - Like C++, MATLAB has built-in documentation and a help function that will search its online database for relevant information. The documentation site entitled Math Works is the best place to find answers on MATLAB. Using the support tab located at the top of the site’s menu, users can click on the documentation link and choose MATLAB as the program they wish to explore. 


A computer program is also called a computer software, which can range from two lines to millions of lines of instructions. Computer program instructions are also called program source code and computer programming is also called program coding. A computer without a computer program is just a dump box; it is programs that make computers active. As we have developed so many languages to communicate among ourselves, computer scientists have developed several computer-programming languages to provide instructions to the computer (i.e., to write computer programs). We will see several computer programming languages in the subsequent chapters. If you understood what a computer program is, then we will say: the act of writing computer programs is called computer programming. As we mentioned earlier, there are hundreds of programming languages, which can be used to write computer programs and following are a few of them:

  1. Java
  2. C
  3. C++
  4. Python
  5. PHP
  6. Perl
  7. Ruby

Today computer programs are being used in almost every field, household, agriculture, medical, entertainment, defense, communication, etc. Listed below area few applications of computer programs:

  1. ·        MS Word, MS Excel, Adobe Photoshop, Internet Explorer, Chrome, etc., are examples of computer programs.
  2. ·        Computer programs are being used to develop graphics and special effects in movie making.
  3. ·        Computer programs are being used to perform Ultrasounds, X-Rays, and other medical examinations.

·        Computer programs are being used in our mobile phones for SMS, Chat, and voice communication.

 Someone who can write computer programs or in other words, someone who can do computer programming is called a Computer Programmer. Based on computer programming language expertise, we can name a computer programmers as follows: C Programmer C++ Programmer Java Programmer Python Programmer PHP Programmer Perl Programmer Ruby Programmer We assume you are well aware of English Language, which is a well-known Human Interface Language. English has a predefined grammar, which needs to be followed to write English statements in a correct way. Likewise, most of the Human Interface Languages (Hindi, English, Spanish, French, etc.) are made of several elements like verbs, nouns, adjectives, adverbs, propositions, and conjunctions, etc. Similar to Human Interface Languages, Computer Programming Languages are also made of several elements. We will take you through the basics of those elements and make you comfortable to use them in various programming languages. These basic elements include: Programming Environment Basic Syntax Data Types Variables Keywords Basic Operators Decision Making Loops Numbers Characters Arrays Strings Functions We will explain all these elements in subsequent chapters with examples using different programming languages. First, we will try to understand the meaning of all these terms in general and then, we will see how these terms can be used in different programming languages. This tutorial has been designed to give you an idea about the following most popular programming languages: C Programming Java Programming Python Programming A major part of the tutorial has been explained by taking C as programming language and then we have shown how similar concepts work in Java and Python. So after completion of this tutorial, you will be quite familiar with these popular programming languages.

A text editor is a software that is used to write computer programs. Your Windows machine must have a Notepad, which can be used to type programs. You can launch it by following these steps:

You write your computer program using your favorite programming language and save it in a text file called the program file. Now let us try to get a little more detail on how the computer understands a program written by you using a programming language. Actually, the computer cannot understand your program directly given in the text format, so we need to convert this program in a binary format, which can be understood by the computer. The conversion from text program to binary file is done by another software called Compiler and this process of conversion from text formatted program to binary format file is called program compilation. Finally, you can execute binary file to perform the programmed task. We are not going into the details of a compiler and the different phases of compilation. The following flow diagram gives an illustration of the process:





The primary classifications of programming languages are: 

Machine Languages. Assembly Languages. High level Languages. Machine Language Machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. Machine level language is a language that supports the machine side of the programming or does not provide human side of the programming. It consists of (binary) zeros and ones. Each instruction in a program is represented by a numeric code, and numerical addresses are used throughout the program to refer to memory locations in the computer’s memory. Microcode allows for the expression of some of the more powerful machine level instructions in terms of a set of basic machine instructions. Assembly language Assembly language is easier to use than machine language. An assembler is useful for detecting programming errors. Programmers do not have the absolute address of data items. Assembly language encourage modular programming High level language High level language is a language that supports the human and the application sides of the programming. A language is a machine independent way to specify the sequence of operations necessary to accomplish a task. A line in a high level language can execute powerful operations, and correspond to tens, or hundreds, of instructions at the machine level. Consequently more programming is now done in high level languages. Examples of high level languages are BASIC,FORTRAN etc Compilation.

The compiler program translates the instructions of a high level language to a machine level language. A separate compiler is required for every high level language. High level language is simply a programmer’s convenience and cannot be executed in their source. The actual high -level program is called a source program. It is compiled (translated) to machine level language program called object program for that machine by the compiler. Such compilers are called self resident compilers. Compiler compiles the full program and reports the errors at the end Compilation Process The compilation and execution process of C can be divided in to multiple steps:

  •  Pre-processing Using a Pre-processor program to convert C source code in expanded source code. "#include" and "#define" statements will be processed and replaced actually source codes in this step.
  •  Compilation Using a Compiler program to convert C expanded source to assembly source code. Assembly Using a Assembler program to convert assembly source code to object code.
  •  Linking Using a Linker program to convert object code to executable code. Multiple units of object codes are linked to together in this step.
  •  Loading Using a Loader program to load the executable code into CPU for execution. Compilation Linking After all of the files are compiled, they must be "merged together" to produce a single executable file that the user use to run the program.
  •  In C, most compiled programs produce results only with the help of some standard programs, known as library files that reside in the computer. This process is called linking. The result obtained after linking is called the executable file.
  •  The linker′s primary function is to bind symbolic names to memory addresses.
  •  To do this, it first scans the files and concatenates the related file sections to form one large file. Then, it makes a second pass on the resulting file to bind symbol names to real memory addresses.
  •  Loading is loading the executable into memory prior to execution.  There are two types of linking: Static linking. Dynamic linking. Static linking occurs at compilation time; hence it occurs prior to loading a program. With static linking the external symbols that are used by the program (e.g. function names) are resolved at compile time.
  •  Dynamic linking occurs at run time, so it occurs after or at the time of the loading of program. With dynamic linking the symbols are resolved either at loading time, or at runtime when the symbol is accessed (lazy binding).Loading
  •  After the files are compiled and linked the executable file is loaded in the computer’s memory for executing by the loader. This process is called Loading.
  •  Program loading is basically copying a program from secondary storage into main memory so it ′s ready to run. In some cases, loading us just not copying the data from disk to memory, but also setting protection bits, or arranging for virtual memory map virtual addresses to disk pages.


Small coding languages

  Yes, Hack is a programming language developed by Facebook (now Meta) as a dialect of PHP. It was designed to address some of the limitatio...