Programming Blog

Programming 

I am writing a blog about two coding programs which I have started learning the basics. 

One of the program is called Python. Python is an open source. Python is an easy program to start learning how to code online. Once you have opened up IDLE, you have to go 'File' and then click 'New File' to start coding with Python. When you are using Python you will always type 'print' at the very start of the 'New File' after you have opened up IDLE.

High-Level Program:

Class Triangle {

    …

    float surface ()

    return b*h/2;

  }

Code Quality

By using naming conventions, the code becomes more readable and understandable to different people who look at the code.

Camel case is often used as a naming convention in computer programming, capitalization of the first letter of the second word and any other subsequent words.

Good Examples:

  • areaLength
  • numberOfStudents 
  • costPrices
  • count 
Bad Examples:
  • Arealenght
  • AreaLength 
  • Count
Checking the Code

Variable and constant names should be meaningful.

Good Examples:
  • countOfTyres
  • bookPrice
Bad Examples:
  • x
  • y
  • c
  • qwerty
Improve Code Quality

By adding comments, the developer reminds others of the meaning of the code. This helps to maintain the code.

The type of comments developers add:
  • Developer name.
  • Purpose of the program, function or object.
  • Complex calculations.
  • Date of changes.


                             
Another program is called C#. C# is proprietary. C# takes more time to learn but it if you want to challenge yourself then you should try C#. C# variables are declared and there are different data types used on this program. C# is used on Visual Studio to create some coding. Once you have opened up Visual Studio, you have to sign in if you have an account or you can create one for yourself. After you have either logged on to your account or created one you will automatically be signed in and then Visual Studio will open up.  

Imperative Programming:

Define - A program based on this paradigm is made up of a clearly-defined sequence of instructions to a computer. 
HIL – High Level – Imperative.  

Procedural Programming:

Define - Procedures (a type of routine or subroutine) simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself.

Event Driven Programming:

Define - An event-driven program is one that largely responds to user events or other similar input. The system listens for events and runs code when an event occurs.     

Programming Languages:
  • Imperative Programming – instructions sequence.
  • Procedural Programming – instructions subroutines.
Object Orientated Programming:
  • Class signifies object orientated programming.   
  • Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. 
  • OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. 
                    

Both Python and C# are high level languages. These languages become machine code with an application called a compiler. It's easy to read for humans. Computer programs only understand machine code that are written in binary. It's close to our human language, enabling the programmer to just focus on the problem being solved. No particular knowledge of the hardware is needed as high-level languages create programs that are portable and not tied to a particular computer or microchip.   

Wire Loop – You don’t how many times it will appear.

For Loop – You do know how many times it will appear. You know the condition.   
 

On Python and C# you can use a variety of data types and variables. 
The data types and variables are: 
  • String (Str)
  • Integer (Int)
  • Float 
  • Boolean (Bool)
  • Dictionary (Dict)
  • Tuple 
  • List
  • Range 
  • Set
  • Frozenset
  • Bytes
  • Bytearray
  • Memoryview
Flowcharts are used by starting the process with an input and this ends by an output which will reach you to your result by answering your equation. 
By creating a flowchart you will be able to draft the Algorithm so that you can understood the structure of the flowchart you have created. 
A hash ensures the input is restricted to a Yes or No on Python.  
  
Subroutines and Functions 

Subroutines are small blocks of code in a modular program designed to perform a particular task.

Since a subroutine is in itself a small program, it can contain any of the sequence, selection and iteration constructs. 

Subroutines are a way of structuring code into reusable blocks: 


Commenting on code quality checklist:
  • Imported but unused modules 
  • Missing arguments in function calls 
  • Unnecessary use of comprehensions
  • Lack of proper indentation
  • Lack of whitespace around parentheses, brackets, or braces  

Comments