I made this widget at MyFlashFetish.com.

Showing posts with label chapter 14. Show all posts
Showing posts with label chapter 14. Show all posts

Tuesday, April 12, 2011

Top Programming Languages for 2011

As we know there are many type of programming language that use by people, but there are several that is most used over the world...

By Darryl K. Taft on 2010-12-20 


As 2011 approaches, eWEEK takes a look at the top 18 programming languages for developers going into the new year. This list is filled with the tried and true. In some instances, some observers might view a few of the picks as the "tired and through." However, despite their age, the workhorse languages such as C and C++ continue to remain at the top end of the software development landscape in terms of language use and job potential (despite growing more slowly and even decreasing, according to some sources). Moreover, this list is not intended to highlight the hot, hip new languages on the horizon, but to focus on where programmers can go to look for work. To compile this list, eWEEK checked out the TIOBE Index, which sorts out developer language popularity, Regular Geek as well as job sites such as Indeed.com andSimplyHired.com. Java has dominated the programming jobs rankings for the last several years and remains dominant going into 2011. According to Simply Hired, since April 2009, Java jobs increased 52 percent, Perl jobs increased 33 percent, C# jobs increased 52 percent, Objective C jobs increased 60 percent (however, a search for "Objective-C" showed a 207 percent increase in jobs), Visual Basic jobs increased 112 percent, JavaScript jobs increased 76 percent, Ruby jobs increased 78 percent, Python jobs increased 69 percent, C jobs increased 11 percent and PHP jobs increased 58 percent. Yet, Simply Hired shows a decrease of 13 percent in terms of jobs for the C++ language.


The programming language that we usually hear are: 
C, C++, Visual Basic, Java, JavaScript ....
Here i want to share more type of this popular programming language in 2011 that shown by Darryl K. Taft.

















The different generations of languages

There are currently five generations of computer programming languages. In each generation, the languages syntax has become easier to understand and more human-readable. 
First generation languages (machine language)  
Represent the very early, primitive computer languages that consisted entirely of 1's and 0's - the actual language that the computer understands (machine language). 
Second generation languages (2GL)  
 A typical 2GL instruction looks like this: ADD 12,8
Represent a step up from from the first generation languages. Allow for the use of symbolic names instead of just numbers. Second generation languages are known as assembly languages. Code written in an assembly language is converted into machine language (1GL).
Third generation languages (3GL)   
 third-generation language is a "high-level" programming language, such asPL/IC, or Java. Java language statements look like this:
public boolean handleEvent (Event evt) {
switch (evt.id) {
case Event.ACTION_EVENT: {
if ("Try me" .equald(evt.arg)) {
compiler converts the statements of a specific high-level programming language into machine language. (In the case of Java, the output is called bytecode, which is converted into appropriate machine language by a Java virtual machine that runs as part of an operating system platform.) A 3GL language requires a considerable amount of programming knowledge.
With the languages introduced by the third generation of computer programming, words and commands (instead of just symbols and numbers) were being used. These languages therefore, had syntax that was much easier to understand. Third generation languages are known as "high level languages" and include C, C++, Java, and Javascript, among others.
Fourth generation languages (4GL)   
The syntax used in 4GL is very close to human language, an improvement from the pervious generation of languages. 4GL languages are typically used to access databases and include SQL and ColdFusion, among others. 
 4GL language statement might look like this: EXTRACT ALL CUSTOMERS WHERE "PREVIOUS PURCHASES" TOTAL MORE THAN $1000
Fifth generation languages (5GL)  
Fifth generation languages are currently being used for neural networks. A nueral network is a form of artifical intelligence that attempts to imitate how the human mind works. 
Fifth-generation language is programming that uses a visual or graphical development interface to create source language that is usually compiled with a 3GL or 4GL language compiler. Microsoft, Borland, IBM, and other companies make 5GL visual programming products for developing applications in Java, for example. Visual programming allows you to easily envision object-oriented programming classhierarchies and drag icons to assemble program components. 
Procedure-oriented programming
A type of programming where a structured method of creating programs is used. With procedure-oriented programming, a problem is broken up into parts and each part is then broken up into further parts. All these parts are known as procedures . They are separate but work together when needed. A main program centrally controls them all.
Some procedure-oriented languages are COBOL, FORTRAN, and C. 
Object oriented programming
A type of programming where data types representing data structures are defined by the programmer as well as their properties and the things that can be done with them. With object-oriented programming, programmers can also create relationships between data structures and create new data types based on existing ones by having one data type inherit characteristics from another one.
In object-oriented programming, data types defined by the programmer are called classes (templates for a real world object to be used in a program). For example, a programmer can create a data type that represents a car - a car class. This class can contain the properties of a car (color, model, year, etc.) and functions that specify what the car does (drive, reverse, stop, etc.)
Some object-oriented languages are C++, Java, and PHP.
 

Web Language and Software Language

for this section, I want to share about the programming language for web and the software of the languange...for more information, check it out below... 
Web languages
Used for creating and editing pages on the web. Can do anything from putting plain text on a webpage, to accessing and retrieving data from a database. Vary greatly in terms of power and complexity. 
  • HTML 
Hyper Text Markup Language. The core language of the world wide web that is used to define the structure and layout of web pages by using various tags and attributes. Although a fundamental language of the web, HTML is static - content created with it does not change. HTML is used to specify the content a webpage will contain, not how the page functions. Learn HTML at our HTML tutorials section. 
  • XML 
Extensible Markup Language. A language developed by the W3C which works like HTML, but unlike HTML, allows for custom tags that are defined by programmers. XML allows for the transmission of data between applications and organizations through the use of its custom tags. 
  • Javascript 
A language developed by Netscape used to provide dynamic and interactive content on webpages. With Javascript it is possible to communicate with HTML, create animations, create calculators, validate forms, and more. Javascript is often confused with Java, but they are two different languages. Learn Javascript at ourJavascript tutorials section. 
  • VBScript 
Visual Basic Scripting Edition. A language developed by Microsoft that works only in Microsoft's Internet Explorer web browser and web browsers based on the Internet Explorer engine such as FlashPeak's Slim Browser. VBScript Can be used to print dates, make calculations, interact with the user, and more. VBScript is based on Visual Basic, but it is much simpler. Learn VBScript at our VBScript tutorials section. 
  • PHP 
Hypertext Preprocessor (it's a recursive acronym). A powerful language used for many tasks such as data encryption, database access, and form validation. PHP was originally created in 1994 By Rasmus Lerdorf. Learn PHP at our PHP tutorials section. 
 Software languages 
Used for creating executable programs. Can create anything from simple console programs that print some text to the screen to entire operating systems. Vary greatly in terms of power and complexity. 
1) C

An advanced programming language used for software application development. Originally developed by Dennis Ritchie at Bell Labs in the 1970's and designed to be a systems programming language but since then has proven itself to be able to be used for various software applications such as business programs, engineering programs, and even games. The UNIX operating system is written in C.
2) C++ 


Descendant of the C language. The difference between the two languages is that C++ is object-oriented. C++ was developed by Bjarne Stroustrup at Bell Labs and is a very popular language for graphical applications. 
3) Visual Basic 

A language developed by Microsoft based on the BASIC language . Visual Basic is used for creating Windows applications. The VBScript language (also developed by Microsoft) is based on Visual Basic. 
4 ) Java 

A powerful and flexible language created by Sun MicroSystems that can be used to create applets (a program that is executed from within another program) that run inside webpages as well as software applications. Things you can do with Java include interacting with the user, creating graphical programs, reading from files, and more. Java is often confused with Javascript, but they are two different languages. Learn Java at our Java tutorials section
 

 

Saturday, April 9, 2011

Do...Loop Statement

Repeats a block of statements while a Boolean condition is True or until the condition becomes True.

Use a Do...Loop structure when you want to repeat a set of statements an indefinite number of times, until a condition is satisfied. If you want to repeat the statements a set number of times, the For...Next Statement is usually a better choice.
You can use either While or Until to specify condition, but not both.
You can test condition only one time, at either the start or the end of the loop. If you test condition at the start of the loop (in the Do statement), the loop might not run even one time. If you test at the end of the loop (in the Loop statement), the loop always runs at least one time.
The condition usually results from a comparison of two values, but it can be any expression that evaluates to a Boolean Data Type (Visual Basic) value (True orFalse). This includes values of other data types, such as numeric types, that have been converted to Boolean.
You can nest Do loops by putting one loop within another. You can also nest different kinds of control structures within each other. For more information, seeNested Control Structures (Visual Basic).

DO WHILE

Executes statements repetitively while a condition is true

Valid:
in a DATA step
Category:
Control
Type:
Executable


SYNTAX

DO WHILE (expression);
…..more SAS statements…
END;

ARGUMENTS.

(expression)
is any SAS expression, enclosed in parentheses. You must specify at least one expression.

DETAILS.
The expression is evaluated at the top of the loop before the statements in the DO loop are executed. If the expression is true, the DO loop iterates. If the expression is false the first time it is evaluated, the DO loop does not iterate even once.
COMPARISONS.
There are three other forms of the DO statement:


  • The DO statement, the simplest form of DO-group processing, designates a group of statements to be executed as a unit, usually as a part of IF-THEN/ELSE statements.
  • The iterative DO statement executes statements between DO and END statements repetitively based on the value of an index variable.
  • The DO UNTIL statement executes statements in a DO loop repetitively until a condition is true, checking the condition after each iteration of the DO loop. The DO WHILE statement evaluates the condition at the top of the loop; the DO UNTIL statement evaluates the condition at the bottom of the loop.
  • Note:   If the expression is false, the statements in a DO WHILE loop do not execute. However, because the DO UNTIL expression is evaluated at the bottom of the loop, the statements in the DO UNTIL loop always execute at least once.  


EXAMPLES.
These statements repeat the loop while N is less than 5. The expression N<5 is evaluated at the top of the loop. There are five iterations in all (0, 1, 2, 3, 4).
n=0;
   do while(n<5);
      put n=;
      n+1;
   end;


DO UNTIL

 Executes statements in a DO loop repetitively until a condition is true
Valid:   in a DATA step
Category:         Control
Type:    Executable


DO UNTIL (expression);
...more SAS statements...
END;


ARGUMENTS.
(expression)
is any SAS expression, enclosed in parentheses. You must specify at least one expression.
Details
The expression is evaluated at the bottom of the loop after the statements in the DO loop have been executed. If the expression is true, the DO loop does not iterate again.

Note:   The DO loop always iterates at least once. 
Comparisons
There are three other forms of the DO statement:

The DO statement, the simplest form of DO-group processing, designates a group of statements to be executed as a unit, usually as a part of IF-THEN/ELSE statements.
The iterative DO statement executes statements between DO and END statements repetitively based on the value of an index variable.

The DO WHILE statement executes statements in a DO loop repetitively while a condition is true, checking the condition before each iteration of the DO loop. The DO UNTIL statement evaluates the condition at the bottom of the loop; the DO WHILE statement evaluates the condition at the top of the loop.

Note:   The statements in a DO UNTIL loop always execute at least one time, whereas the statements in a DO WHILE loop do not iterate even once if the condition is false. 

Examples
These statements repeat the loop until N is greater than or equal to 5. The expression N>=5 is evaluated at the bottom of the loop. There are five iterations in all (0, 1, 2, 3, 4).

n=0;
   do until(n>=5);
      put n=;
      n+1;
   end;


 DO WHILE VERSUS DO UNTIL.

The do-while loop is similar to the while loop, except that the test condition occurs at the end of the loop.  Having the test condition at the end, guarantees that the body of the loop always executes at least one time.
The do-while loop is an exit-condition loop.  This means that the body of the loop is always executed first.  Then, the test condition is evaluated.  If the test condition is true, the program executes the body of the loop again.  If the test condition is false, the loop terminates and program execution continues with the statement following the while….

Do...Loop enables the script to continue to perform certain actions until a specific condition occurs. Do While...Loop enables your script to continue to perform these actions as long as the specified condition remains true. Once the specified condition is no longer true, Do While...Loop exits. In contrast, Do Until...Loop has the opposite effect the script continues to perform the action until a certain condition is met….




PSEUDOCODE

What is pseudocode?
Pseudocode consists of short, English phrases used to explain specific tasks within a program's algorithm. Pseudocode should not include keywords in any specific computer languages. It should be written as a list of consecutive phrases. You should not use flowcharting symbols but you can draw arrows to show looping processes. Indentation can be used to show the logic in pseudocode as well. For example, a first-year, 9th grade Visual Basic programmer should be able to read and understand the pseudocode written by a 12th grade AP Data Structures student. In fact, the VB programmer could take the other student's pseudocode and generate a VB program based on that pseudocode.

Why is pseudocode necessary?
The programming process is a complicated one. You must first understand the program specifications, of course, Then you need to organize your thoughts and create the program. This is a difficult task when the program is not trivial (i.e. easy). You must break the main tasks that must be accomplished into smaller ones in order to be able to eventually write fully developed code. Writing pseudocode WILL save you time later during the construction & testing phase of a program's development.

How do we write pseudocode?
First you may want to make a list of the main tasks that must be accomplished on a piece of scratch paper. Then, focus on each of those tasks. Generally, you should try to break each main task down into very small tasks that can each be explained with a short phrase. There may eventually be a one-to-one correlation between the lines of pseudocode and the lines of the code that you write after you have finished pseudocoding.

It is not necessary in pseudocode to mention the need to declare variables. It is wise however to show the initialization of variables. You can use variable names in pseudocode but it is not necessary to be that specific. The word "Display" is used in some of the examples. This is usually general enough but if the task of printing to a printer, for example, is algorithmically different from printing to the screen, you may make mention of this in the pseudocode. You may show functions and procedures within pseudocode but this is not always necessary either. Overall, remember that the purpose of pseudocode is to help the programmer efficiently write code. 

Therefore, you must honestly attempt to add enough detail and analysis to the pseudocode. In the professional programming world, workers who write pseudocode are often not the same people that write the actual code for a program. In fact, sometimes the person who writes the pseudocode does not know beforehand what programming language will be used to eventually write the program.

Sample PHP Application: A Simple PHP Command Line-based File Generator


PHP is a great scripting language to build web applications. Despite the sluggish improvement and development towards a more architecturally robust, more feature-rich, and less quick-and-dirty programming language recently, I still love coding bytes in PHP. Some people may think of PHP as the language for programming the web quickly. Write some HTML, embed some javascript, add some CSS, put some PHP code, and voila… a dynamic web page is created. I won’t praise how good PHP is for developing a web application. Several companies may have done that. Name Facebook and Yahoo as examples. With some optimization to native PHP codes, both companies have shown how to use the language to cater to millions of users and run a serious business.
In this post, I’d like to highlight another feature of PHP, the command line interface (CLI). PHP CLI can be an alternative to some administrative tasks. Linux users may have been familiar with shell scripting for carrying out system management and configuration tasks. So, why must PHP? The answer is portability. The same PHP code should work not only on Linux but also on Windows. Some critics may argue that other languages may also have answer for portability. I concur to that criticism while at the same time emphasizing PHP as another viable option.
The application to be shown immediately is a file generator. It will create a file of random content with size specified by user when executing the file. The content consists of alphanumeric ASCII characters that are picked randomly. No newline are included in the file. Yet, user can tweak the application to make the generated output file also include newline.
This application can be useful for those who are learning how to write a command line-based PHP utility and also for others who want to conveniently generate files of various sizes for workload testing purpose.
Source code and snapshots are provided below:
a. Source code: filegenerator.php


If you want to play with this simple application, you can download it directly from the following link: