Subscribe For Free Updates!

We'll not spam mate! We promise.

Showing posts with label Programming Languages. Show all posts
Showing posts with label Programming Languages. Show all posts

Tuesday, February 25, 2014

How to Write “Hello World” Program for Top 10 Programming Languages

Before learning any Programming Language, you must know how important and popular the programming language you want to learn is. Because, learning itself is never a bad idea, we always motivate you to learn new things every day. If your learning plan is in a managed and well planned way then you’ll never eat mud in the mid way.

Most of the programming language have the same methodology and almost similar to each other. If you learn PHP you can easily understand C and vice versa and the same goes with others, because they are totally related to each other.
"Hello World" Programs for top 10 Programming Language
One of the first programs that is usually written when learning the first programming language is "Hello World". Today, you will get to know the top ten Programming Languages you must learn in your life to get never ending career in Computer Programming. You will also know the first program "Hello World" to begin with.

PHP
<?php
// Hello World in PHP
echo 'Hello World!';
?>
C#
//Hello World in C#
class HelloWorld
{
static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
JavaScript
<html>
<body>
<script language="JavaScript" type="text/javascript">
// Hello World in JavaScript
document.write('Hello World');
</script>
</body>
</html>
Perl
# Hello world in perl
print "Hello World!\n";
C
/* Hello World in C */
#include <stdio.h>
main()
{
printf ("Hello World!\n");
}
Ruby
# Hello World in Ruby
puts "Hello World!"
Java
// Hello World in Java
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}
Python
# Hello World in Python
print "Hello World"
VisualBasic.NET
'Hello World in Visual Basic .NET (VB.NET)
Imports System.Console
Class HelloWorld
Public Shared Sub Main()
WriteLine("Hello, world!")
End Sub
End Class

These were just the introduction and as you can see, they are common to each other just to print "hello World" in your program window. 

Saturday, February 8, 2014

Information on Computer Programming

Good day readers, in this article, I have provided some Computer Programming Information along with programming career information. Read on, to know more about this...

There won’t be any need to start mentioning that computer programming is one of the most demanded jobs in the information technology sector. There are large multinational companies, working in this field and they are in constant requirement of software professionals to solve their computer programming functions. Thus, computer programming information is one of the details that any person who wants to make a career in computer programming, looks for. It is also true, that without proper information on computer programming, no one can just enter the industry. Computer programming demands, good analytical and logical skills. Let us deal with the various aspects of computer programming information, one after the other.

What is a Computer Program?
A computer program is nothing but a set of instructions that has been written in a particular computer language to meet the end results. The target of the programmer may be as simple as multiplying two matrix to as complicated as automating an entire office setup. There are different methods of computer programming and different computer languages. By different methods of programming, I mean you may have to simply write programs that deal with an organization's database and process the information, or design complicated software that will be able to handle and operate machines.

What are the Different Types of Computer Languages?
The different types of computer languages can be broadly classified into two types: Assembly Level Language and High Level Language. While some people may contradict this and say that there is one more type of programming language, the Low Level Programming Language. But the low level programming language can be more precisely defined as the machine level language and designing a program using it will definitely become a tiresome task. You cannot name any variable and you have to find out the machine code, for each and every instruction that you write and use. Besides, when you look back at the code, you will not be in a position to distinguish which instruction is performing which operation.

Assembly Level Language
Assembly level language allows you to name variables and it is ofcourse easier to write commands in this language. But it is not as flexible and explanatory if compared to the high level language. It does not allow for flexibilities like re-usability of the same code. Assemblers are required to convert assembly level languages to machine level languages. The process in which the assembler works is a very complicated procedure and it is better that we just understand that its basic purpose is to convert the assembly level language to machine level language.

High Level Language
The high level languages are the solution to all the computer programming problems, and allow a lot of ease. Previously, assembly level languages were mainly used for writing programs that need to be burned on a micro controller or micro processor. But with the advent of certain software, now, high level languages like C and C++ can also be used for programming in embedded technology. The high level languages can also be broadly classified into two types; procedure oriented languages and object oriented languages. Let me try to explain to you, these two types of programming languages in brief.

In the Procedure Oriented Languages, the instructions are executed one after the other and the process is given more importance. There is one main function or process that includes all the other functions. Every time a new set of data is created, the functions need to be redesigned. The BASIC programming language and C language are the two most common examples of high level language.


In the object oriented programming language, the main emphasis is given to the data. The process of programming becomes simpler as the code remains re-usable, under all cases. Even if the data changes, there is no impact on the remaining code. Java and C++ are the most commonly used object oriented programming languages.


Computer Programming Career Information
Now, let us look at the Computer Programming Career Information. When deciding a career in Computer Programming, you have to firstly decide the type of programming you want to do. If you want to go for Web Programming, then you will need to have a proper command over one of the Web Programming Languages, like PHP, HTML and Javascript. If you want to go for Application Development, then you will need a command over one of the application development languages, like Java, C, C++, etc. But with advancement of Programming Languages features, they can now solve a lot more functions. For example, by using the Java 'hibernate' feature, you can deal with databases using Java. However, it is always wise that you have some idea about the basic features, like database handling, when you want to make a career in programming languages. MySQL, Oracle, etc. are some of the DBMS (Database Management Systems) and whichever Programming Language you learn, it is always advisable to learn one of these database management systems, at least their basic operations.

Aside all this, you need to have good reasoning capability and of course, as mentioned before, good analytical and logical skills. You need to apply logic for designing or writing every program. Without good logical reasoning, you might have difficulties designing an application and hence you need to strengthen the same. It is also better that you have a degree in Computer Engineering or Masters Degree in Computer Application or Computer Management, for pursuing a career in Programming.

With all being said, I end up this article. I hope the Computer Programming information, that I have presented in this article, will be of some benefit to you.


Types of Programming Language Errors

There are different types of programming errors that can appear suddenly during the development aspect of a software program and every programmer needs to be aware of them. In this article, you will find a description of the most common programming "bugs" that every developer may surely encounter.

Programming errors, commonly known as 'Bugs' in computing, are the main scourge of any software developer. Since the machines are increasingly being used in automated mode, with onboard embedded systems or computers controlling their functioning, a programming error can have drastic consequences. There have been cases of space shuttles and planes crashing due to software bugs in embedded computing equipment. A single loophole left in operating system code can provide an entry point to hackers who can exploit the vulnerability, putting computer security at risk. Errors need to be taken very seriously as we increasingly rely on computers.

Prime Types of Programming Errors

Computer programming is a huge field with hundreds of languages to be mastered and millions of applications. From core operating system programming, application programming, embedded system coding, web development, mobile platform apps, development of software programs deployed online to scientific computing, the extent of the field is simply huge. So is the scope for making programming errors of various kinds.

Programming Error Types and Description

Logic Error 
This is possibly the most serious of all errors. When a written program in any kind of computer language compiles and runs properly only to provide incorrect output, the fault lies in the underlying programming logic. It's an error which has been inherited from a fault in the base algorithm. The very logic on which the entire program is based is flawed, in such a case. These types of errors need a fundamental change in your approach to proffer a solution. You need to start digging at the algorithmic level to narrow down to the cause of such an error.

Syntax Error 
Every computer language such as C, Java, Perl and Python has a specific syntax in which code needs to be composed/written. The point when a programmer doesn't adhere to the 'grammar' specifications of a computer language, a syntax error occurs. These kinds of errors are easily rectified during the compilation phase.


Compilation Error 
Compilation is the process where a program written in a high level language is converted to machine readable language. Numerous types of errors can occur during this phase, including syntax errors. Sometimes, the syntax of a source code might be flawless, but a compilation error might still occur. This may be due to a problem in the compiler itself. These errors could be rectified in the development phase.

Run Time Error 
The program code has compiled successfully and an executable file has been created. You breathe a sigh of relief and run the program to test if its working, only to find an error. This is a 'Run Time Error'. These may result from the failure on part of the developer to anticipate/foresee actual program deployment conditions. These can be fixed by going back to the coding phase.

Arithmetic Error 
Many programs use numerical variables and the algorithm may involve several mathematical calculations. Arithmetic errors crop up when the computer cannot handle problems like 'Division By Zero' leading to an infinite result. This is another logical error which can only be corrected by changing the algorithm.

Resource Errors 
When the value of a variable overflows its maximum allowed value, a resource error may occur. Buffer overflow, usage of an uninitialized variable, access violations and stack overflows are all examples of some common errors.

Interfacing Error 
These may occur due to mismatch/conflict of a software program with the hardware interface or application programming interface used. In case of web applications, an interface error may occur from incorrect use of a web protocol.

An intensive testing and debugging phase is an essential part of the software development cycle which can help remove these errors in the bud, before full scale deployment of the software program. A lot of errors can be avoided through pre-planning and care during the coding phase. Through practice and discipline and following strict debugging procedures, most of the errors can be rectified during software development. Making mistakes is a part of learning and they can never be entirely avoided. However, I would suggest that you focus on making new mistakes and avoid repeating the ones you made before..

Tuesday, February 4, 2014

Basics of Computer Programming

Irrespective of the programming language you want or wish to learn, first you need to be familiar with the basics of programming. Read further to learn the foundational details of computer programming.

A computer program is nothing but a set of instructions, which when executed, give outcome to a certain operation. These set of instructions need to be written logically, like they should be in a flow, and before writing the program, you need to decide the flow of the program. Remember, the computer is a very intelligent machine, but it can do only what you ask it to do. So the program that you are writing will go wrong, only if there is something wrong with its set of instructions. Problems arise in computer programs due to manual errors. Before going into further detail, let us try to understand the different levels of programming languages.

Machine-Level Language
At root level, a computer works in bits and bytes. It only understands binary language, which consists of digits 0 and 1. You may write a program in whichever language you want, but for the computer to understand and execute it, it must be converted into the language of 0s and 1s. Writing a program in machine language, is definitely difficult. It is not possible to memorize a long string of 0s and 1s for every instruction that needs to be executed.

Assembly Language
An assembly language is just one level above low-level machine language. No doubt, designing a program in assembly language is no easy task, but still the programming code used is quite understandable. Till date, many embedded technology programs are designed in assembly language. A computer program known as the assembler, is used for converting the assembly program into the corresponding machine-level program.

High-Level Language
High-level languages are far simpler to understand than assembly language or machine-level language. There are clear statements for writing each and every instruction. But the computer will not understand code written in a high-level language. So a compiler or interpreter program is run by the computer itself, that converts the programming code into its equivalent machine language form. However, whatever language you learn, you need to have a proper understanding of the basics of that language. Without knowing the basics of a particular language, you cannot write a program in that language. There are a variety of languages for different purposes. Some are meant for web programming, some are meant to design simple desktop applications, while some can do both.

Basic Steps to Write a Computer Program
Some of the basic factors you need to consider when writing a computer program are mentioned below.

Plan and Design the Logic of the Program: Logic is the backbone of your computer program. What operation needs to be performed, what are the resources required for the operation, what data needs to be accepted from the user etc. such questions need to be asked and listed down before starting with the actual coding process. As a beginner, writing an algorithm and preparing a flow chart for the program, is a must.

Divide your Programs into Functions: Almost all computer languages allow you to write programs such that, the programs are divided into small blocks or functions. You need to design the functions such that they are written in the minimum number of instructions and can be reused again and again.

Use the Correct Syntax of Commands and Statements: Syntax is to a computer language as grammar is to a spoken language. Using the wrong grammar can completely change the meaning of a spoken sentence. Likewise the wrong syntax will result in programming errors or improper code being executed. Learn the syntax of each command that you will be using.

Optimize your Code: This is very important. The less number of instructions in a program, the faster it executes. Usually we use complicated logic and statements to get a task done, which ironically, can be performed easily by using one of the programming language's inbuilt functions. Or a lot of steps are written, forming long tedious code, when the operation can be performed in a few steps. Such issues occur mainly because we were not aware that such functions existed or the program's logic was ill-planned. Get yourself well-acquainted with the programming language, to prevent writing redundant code.

Correctly Name Variables and Functions: The variable names and functions should be logical. The process of coding becomes simpler, if you use proper names for the variables and functions that you use in your programming code. Using absurd or vague variable names won't hamper the functionality of your program, but when you try to modify or enhance the same code later, you may find it difficult.

The above information is just the tip of the iceberg, when it comes to computer programming basics. Along with functions, there are programming constructs and definitions to consider, which differ from language to language. The best way to command a programming language, is to keep at it and not give up, even when it seems hard.

Stay Tuned for more…


Sunday, January 26, 2014

List of Computer Programming Languages

Programming language is the process of developing and implementing various sets of instructions to enable a computer to do a certain task. These instructions are considered computer programs and help the computer to operate smoothly. The language used to program computers is not understood by an untrained eye. 

Computer programming continues to be a necessary process as the Internet continues to expand. They are based on certain syntactic and semantic rules, which define the meaning of each of the programming language constructs. The syntactic and the semantic rules of every programming language define the language implementation. Programming languages provide computer programmers with the means to express computer algorithms.


INTERPRETED PROGRAMMING LANGUAGES
The programming languages that are implemented by means of an interpreter are known as interpreted languages. Interpreters execute the source code directly by translating the source code into an intermediate representation.