Lessons on programming

Here is going be some links to posts that I have done regarding different aspects of programming in different languages so that it brings it all together as such. For example, what is a class and how does it work etc. anyway here are some basic tutorials and links to different languages and kinder to show how they are kinder all linked :) . The different headings will have different languages links underneath ;) ..

Introduction to

Hello world

The classic hello world program examples for some programming languages.

  1. Flex – Hello world (flash swf)
  2. Javascript – Hello world
  3. PHP – Hello world.
  4. Ruby – hello world.
  5. C++ – Hello world
  6. C# – hello world.
  7. Java – hello world.

Variable types

  1. Java – local variables

Casting of variables

  1. Reinterpret_cast – c++
  2. const_cast – c++
  3. dynamic_cast – c++
  4. static_cast – c++

Flow control (loops) – while / for / foreach etc.

Arrays

  1. Java

Methods

  1. Java – add two numbers
  2. Ruby – add two numbers
  3. PHP – add two numbers
  4. C# – add two numbers
  5. Javascript – add two numbers
  6. C++ – add two numbers

Classes

  1. Java

Comparison of classes

  1. Java – Equals / Compare
  2. C# – Equals

Delegates / Events

  1. C# – Delegates
  2. C# – Events

Interfaces

    Java

Overloading

Overloading is when you overload a methods/functions within a class, when you overload a method you can define a function with the same function name but have either different return values and passing parameters.

  1. C#

Overriding

Overriding functions allow for derived classes to override virtual functions from the base class.

  1. C#

Polymorphism

Polymorphism allows for a base class to be inherited to create a new class that implements/add’s new functions. Here are some examples in different languages

  1. C++
  2. PHP

Templates and Generics

Templates and Generics allow for the same class to be initialized with different data types. Here are some examples in different langauges

  1. C++ (Templates)
  2. C# (Generics)
  3. Java (Generics)

Constants, properties, fields, methods.

const in c++ ( and also within functions definitions) can be found here

Shall add more when doing the tutorials links

Files

  1. Java – read/write