Sunday 15 June 2014

Indentations and Alignments

Hi Everyone,

Here is a habit that I picked up since Monash University about 10 years ago in order to enable easier code reading.

This applies to most programming languages including C#, Javascript, VBScript and SQL.

I am talking about indentations and the position of the braces, {}. Usually the standard would look like this:

function x(){
    //todo
}


function b()
if (condition) then
//todo
end if

for i = 0 to 5
if (condition) then
    //todo
end if  
next
end function

It is harder to read if there are no indentations or if the braces are not alinged properly. 

Instead of that, we can actually do:

function x()
{
    //todo
}


If we have a longer code like this, it is better with indentations as shown below:

function x()
{
    //todo
    if (condition)
    {
        switch (anotherCondition)
        {
            case a:
                //todo
                break;
            case b:
                //todo
                break;
            default:
                //todo
                break;
        ]
    }
    else
    {
        switch (condition)
        {
            case d:
                //todo
                break;
            case e:
                //todo
                break;
            default:
                //todo
                break;
        }
    }
}


Here's another example for VBScript:

 function b()
    if (condition) then
        //todo
    end if
  
    for i = 0 to 5
        if (condition) then
            //todo
        end if
    next
end function


and HTML 


    


    
        
            
        
      
        
            Label
        
    
  
    
        
        
    

As a conclusion, codes with indentation and braces aligned properly are neater and easier to see and analysed. It allows other programmers to know what the code is doing and where the code block ends precisely.

That's all,

Rogerkoo

Saturday 1 September 2012

New Trends

Hi All,

Microsoft has just launched Visual Studio 2o12, one of the most powerful web development programming in the world. It supports the latest Metro programming that comes with Windows 8, Windows Phone 8 and Windows RT 8. Windows 8 and its related systems will be launched on 26th October 2012 (Source: Chip Magazine, August 2012). Nokia will be one of the pioneers of the Windows Phone 8 with its Lumia smartphone offerings. It also comes with Internet Explorer 10.

I have also read Chip Magazine July 2012. Intel is coming out with its new Ivy Bridge processors that promises 4o% higher performance without increasing the voltage. AMD also has its Trinity processors unveiled that boosts the performance. Intel and AMD are improving their range of processors and this will also be available for desktops, ultrabooks and the fast rising tablet markets.

New technologies are coming out faster now. Samsung just launched Galaxy Note 2. IPhone 5 is rumoured to be out this month in a few weeks time. Android 4.1 (Jellybean) is out too with new features. Firefox and Google Chrome also utilises the rapid development method to release new versions of browsers to us. Google Chrome is now in Version 21 now.

More are expected to come such as the launch of Adobe Photoshop CS6 (Source: Chip Magazine, July 2012). Wifi speeds will be faster. Processors from both Intel and AMD will be faster and more energy efficient. New versions of iOS and Android will be better. 

Stay tuned for more tech updates.

Cheers,

Rogerkoo

Friday 17 August 2012

Browser Wars

Hi Everyone,

Mozilla Firefox, Google Chrome and Internet Explorer are the most used internet browsers in the world. The history of internet browser started with Netscape Navigator and later Internet Explorer


Security vulnerabilities were discovered in the Internet Explorer 6.0 and since then alternative browsers are available. This includes Firefox, Opera and later Google Chrome. Netscape relaunched its Netscape 8 browser but failed to gain market share. Firefox and Google Chrome are variants of Netscape and currently using the Mozilla framework.


I am personally using both Mozilla Firefox 13 and Google Chrome 21. This blog is written using Google Chrome 21. Safari for Windows was also available until now where there is no link to download Safari for Windows. I have just checked and verified it.


The question is which browser is the best of all? Can the latest Internet Explorer 9 and soon Internet Explorer 10 be able to catch up?


Loading Speed:

Google Chrome 21: 1 second
Firefox 14: 2 seconds
Internet Explorer 9: 2 to 6 seconds (fully loaded). It is faster after the 1st

Interface:
Google Chrome 21: Cleanest interface of all and comes with apps
Firefox 14: Simple but comes with a lot of features
Internet Explorer: Good layout and design. Much improved since version 6.0

Flash:
Google Chrome 14: May crash sometimes but improved from previous versions
Firefox 14: May crash sometimes but less frequent in Firefox 12
Internet Explorer: Supported. Smooth running

Apps:
Not supported by Internet Explorer

Developers Support:
All browsers are supported

All browsers can support the latest HTML5 and CSS3 capabilites. The web design can be excellent through these web development standards. Firefox and Chrome are the pioneers of this standards as well, able to display webpages developed in HTML5 properly. Microsoft can also be the forerunner as well with the going to be launch Internet Explorer 10.  Windows 8, Windows RT and Windows Phone 8 are coming out with exciting features too. These may be the best Microsoft products so far.

Firefox is the most secure browser followed by Chrome and Internet Explorer 9. Having said that, the security features provided by IE9 is now as good as Firefox. They have chased up.

I have not been using Opera for the past few years. Currently, in version 12, it may still be the best browser of all as claimed. For me, I would put Google Chrome and Firefox to be the top of the crop. I have tried Opera once but I still prefer Firefox and Chrome. The winner is definitely Chrome followed by Firefox and Internet Explorer. Chrome is getting more stable now. Flash plugin for Chrome is much improved from previous versions.

I am beginning to use Chrome again. Although Chrome is the clear winner, Firefox is the more stable browser. Here is the link to download Firefox. You can also download the respective browsers from the links above to use or maybe to test it out.

For Apple users, Safari remains the best browser.

3.6 Upgrade

Google Chrome

Internet Explorer
Opera


Cheers,

Rogerkoo

Saturday 30 June 2012

RPG Programming vs Windows Based Applications

Hi All,


A colleague, he or she shall remain anonymous, said that RPG programs are better then Windows based programs. Windows based applications need to go through the hardening process to ensure that it meets the security guidelines of the company. Symantec ESM is a tool used for the hardening process. There is no need for any hardening for RPG.


RPG or known as Report Program Generator is a legacy system used by most financial institutions such as banks today. It is a structured programming language and it provides accurate and reliable information to bank staff across the world. Its reliability is proven until now. It can be confusing if the RPG program is very complicated. If a RPG program has over thousands of lines of code, you may not be able to find the portion that we need to enhance or change. There are also no indentations in RPG. A maximum 19-20 lines of coding are displayed at a time. To go the next 20 lines, you will press Page Down. You can't see the previous 20 lines already. When there are a lot of nested ifs and loops, it is very difficult to see each section. An example are something like below. It is quite a complicated program


IF
DOW
IF
IF
DOW
.................. (200 lines here)
IF
ELSEIF
ELSE
IF
ENDIF
ENDIF
ENDDO
.................(50 lines of coding here)
ENDIF
................(50 lines of coding here)
ENDIF
ENDO
ENDIF


The modern generation programming languages include .NET, Java, SQL Server and scripting languages such as Javascript and VBScript. These programming languages can be very powerful and used widely in any software development now. A lot of applications are running on Java now but it may also cause performance issues. Running Java applets can sometimes slow down the PC performance. These development languages are quite customisable too. Applications developed using these programming languages have been exposed to security vulnerabilities as well.


My favourite programming languages include C#.NET, Java, Javascript and SQL. RPG may not be my preferred language and I am writing RPG programs in my current job now. Knowing both legacy and modern programming languages are good. Some companies are still using older languages such as COBOL but the programs are still doing their jobs providing accurate and precise information.


Modern programming languages have better Graphical User Interface (GUI) and will make development easier. It is more intuitive and easier to develop. For RPG and COBOL, we need to follow the required declarations and syntaxes determined. We need to declare certain things first before we proceed to write the programs. 


RPG have concepts like file specifications, data structure definitions and calculation specifications (programming). File specifications include declaring whether the files are externally described or internal described files and whether the files are used for input only, output only, or combined (both output and input). This is followed by variable and data structure definitions that include arrays. All these rules need to be specified first before writing any programming logic. 


Different programming languages may have different styles and syntaxes. For myself, I can  write in any programming language that I have learnt. I may not use Java or .NET now but , I am able to use both of it if I refreshed myself with Java or C# knowledge again. I am able to adapt to the language. The learning curve may not be as steep for me partly because I like programming. It will be steeper if it is a brand new language but I should be able to write it within 2-3 months.  I have also looked at HTML5 and CSS3 during my free time but I have not covered it completely.


So which programming language do you prefer? Legacy or object oriented? GUI or non GUI based? Pointers or without pointers? Languages with text editor or without? Web based or non web based? Syntax strict or non-strict languages? Please let me know.


Cheers,


Rogerkoo

Saturday 21 April 2012

Web Design IDEs

Hi Everyone,

I have learnt web design techonologies at my university and also tried my hands on the new HTML5 and CSS3 web standards. I still know how to perform web programming with hands on knowledge and a refresher on the coding syntaxes and API libraries.

I have used Microsoft Frontpage and Macromedia Dreamweaver (now Adobe Dreamweaver CSS 5.5). I have not tried the new designer from Microsoft, Microsoft Expressions.

The best IDE for web development is definitely Adobe Dreamweaver CS 5.5. It is the most extensive development environment today. It is also integrated with other Adobe products such as Adobe Fireworks, Adobe Flash, Adobe Illustrator and Adobe Photoshop. The latest version (5.5) also supports HTML5, CSS3 and jQuery technologies. Now it also has intelligent coding built in and there are multiple preview screens for pc and mobile devices. Drag and drop capabilities are also available. Dreamweaver has the most complete web development tools so far.

Microsoft Frontpage is a older webpage development tool that comes with Microsoft Office. It has built in drag and drop and publishing capabilites. It uses a lot of frames in the web design back then. Now, it is replaced by Microsoft Expressions. Expressions also comes with newer features such as HTML5 and CSS3 integration, dynamic website support (PHP, Javascript, CSS, Silverlight, Flash, Windows Media support and etc) and browser preview comparisons (IE, Safari, Firefox). We can compare how a website looks like between web browsers. Overall, it is much improved over Microsoft Frontpage.

Overall, Adobe Dreamweaver remains my best option for web development. However, it does not come cheap. It is quite expensive. I can't wait to get my hands on it.

This concludes the IDE posts that I am writing. 

My overall favourite programming languages:
  1. C#.NET / Java
  2. HTML5 / CSS3
  3. RPG Programming
  4. JavaScript / VBScript
  5. SQL Server
  6. C++
  7. Visual Basic.NET
My overall favourite IDEs:
  1. Adobe Dreamweaver CS5.5 and below (I liked it since Dreamweaver 8)
  2. Microsoft Visual Studio.NET 2010 and below (from Visual Studio 2003)
  3. Microsoft SQL Server 2010 and above (SQL Server 2005 onwards). SQL2000 is good but GUI is not as modern
  4. Netbeans / Eclipse
  5. JCreator / BlueJ
  6. IBM ISeries AS400 5250 Emulator
  7. Dev C++
  8. Microsoft Expressions (This ranking may not be accurate as have not used before)
  9. Microsoft Frontpage
  10. Unix Shell
It is good to know both front end and back end programming languages.

Cheers,

Rogerkoo

Sunday 8 April 2012

Preferred Programming Languages and IDEs (Integrated Development Environments): Part 1

Hi All,

Throughout my 5 years experience of software development, I have been using several programming languages. It includes C#, Java, Javascript, VBScript, "HTML5 (the latest version of HTML) and CSS3", SQL and RPG Programming.

Here are my preferred languages and the IDEs that I have used so far. 

On top of my list would be C#.NET and Java. There are similarities in syntaxes between these programmming languages. I would start off with Java first.


Java is one of most powerful programming languages in the world, now owned by Oracle. It is now an open source programming language. There are a lot of libraries that provides various functions and methods that can be used in software development. Java is now available in most platforms that we have seen and these include PC, mobile, Java Applets (online share trading for example), enterprise (business) and games.

BlueJ, Eclipse, Netbeans and JCreator are some of the IDEs that I like. I was using BlueJ when I first learnt Java at Monash University. It is an IDE designed to introduce object oriented programming using Java to programmers, especially those who are using Java for the first time. It was first developed in Monash University, Melbourne. It has a simple graphical user interface and we can see the relationship and depencies between objects. It comes with a built in compiler, virtual machine and debugger.

I have also used Eclipse. It is good as well. I tried it when I explored writing Java again to develop Android apps in the future. Plugins such as a graphical user interface (GUI) and other 3rd party plugins can be downloaded to improve the functions of the environment. It's debugger is quite good too showing the line of the codes that has an error. It also prompts if the code is written incorrectly or is not according to the standard. You can see all the classes both external and internal and projects that you have created as well. It also has the autocomplete feature whereby it will prompt the possible syntax or methods that can be used similar to Visual Studio.

Netbeans is another well known and probably the best and most powerful Java IDE available. It comes with GUI capabilities and auto complete features together with Java project management capabilities. It also comes with version control integration system. It is one of the most powerful Java IDE now. You have the option to download Netbeans bundled together with Java JDK too. It not only integrates with all versions of Java but PHP and GlassFish too. It will show if any codes is written incorrectly or if the methods are used incorrectly.

C#.NET

C#, pronounced as C Sharp is a subset of a programming language that is part of Microsoft .NET Framework. It is similar to Java in terms of syntax but different in methods. C# is using all .NET framework methods that are provided from simple string and numeric functions to database connectivity. Microsoft Visual Studio 2010 is the latest IDE for C#. It is also a very powerful IDE to develop mobile, web and Windows applications. It comes with Intellisense features (autocomplete) as well. ASP.NET, a web framework is built into the environment. It will show if any codes is written incorrectly or if the methods are used incorrectly. Drag and drop design functionalities are essential for designing any applications that Visual Studio supports. You just need to drag the relevant elements that are needed such as textbox, label, list, buttons and tables to the screen. All these elements are customisable and you can add in functions to the events that are supported by the elements. For example, a button can have a onclick event whereby it detects a mouse click. You can try C#.NET programming by downloading the free Express Editons of Microsoft Visual Studio.

Javascript and VBScript

There is no IDEs for Javascript and VBScript. I just used the built in tool that we used for software development in my past project. Alternatively, we can use Notepad or similar products such as Notepad++ or WScite that I recommend.

Both of these programming languages have differences in syntax. Javascript is a web scripting language commonly used together with HTML. VBScript is a Microsoft developed scripting language that are used for Windows programming and IE based webpages.

RPG Programming

RPG Programming, known as Report Program Generator is used mainly on IBM AS400 machines. It is considered to be a legacy programming language. However, knowledge of RPG is good as well especially in the finanical industry.

To code in RPG, we need to login to the AS400 system using the IBM AS400 iSeries Emulator. It has no graphical interface and by default comes with green colour. There are no advanced programming tools such as drag and drop and autocomplete features. Currently, we can use the IBM RDi (Rational Development Studio for i). It has been upgraded to a more modern version, that is the RPG IV.

There is a debugger that we can use and that is strdbg command. This will run the debugger and you can set and unset breakpoints by pressing F6 and view variable  values by pressing F11. F12 will proceed directly to the breakpoint and F10 will go through each line step by step.

The codes are displayed in one page. You can scroll down or up by using Page Down and Page Up respectively. It will look complicated if the codes are very long. This may not look good if you are not familiar with the RPG language. This is not an issue for long term and experienced RPG programmers. One good thing is that there is in-built help function by pressing F1 on the screen on what you are not sure. Pressing F4 will also prompt you the required values to be entered while programming.

Conclusion

In conclusion, these are my favourites:
  1. Visual Studio. NET and SQL Server Management Studio
  2. Netbeans
  3. Eclipse
  4. JCreator
  5. BlueJ
  6. iSeries 5250 Emulator

Next post will be on IDEs for web development.

Cheers,

Rogerkoo

Sunday 26 February 2012

Programming

Hi Everyone,

Do you know what are we talking when we talk about computer programming? Have you ever thought how Windows or an Internet stock market system or a website work?

For a website, you can have a look at the source code by right clicking on the website and click View Page Source. You will see the coding there.

Programming is writing source codes for computer systems, computer programs and websites. The process also includes testing and debugging. Behind every computer program, website, banking system, operating system and games, there are source codes. These source codes are transparent to users. It is also part of software development and software engineering.

The complexity of the programming increases when the system has a lot of functions and dependencies. The dependencies here are referred to the pre-conditions and the post-conditions of a system. For example, you need to perform Step A before performing Step B. It also includes validations that are needed for the systems. It also involves logical thinking skills as well when writing programs for banking systems and financial institutions. It does not come easy sometimes.

There are various programming languages available for us to write. As a software developer myself, I have been exposed to several programming languages.

These programming languages are:
  1. Java
  2. C#.NET
  3. Javascript
  4. VBScript
  5. SQL
  6. C++ (Basic)
  7. Unix (Basic)
  8. HTML 
  9. CSS
  10. RPG Programming
I do enjoy writing programs for various systems such as banking systems and websites. These programming languages can be updated often to introduce new functions and methods that can be used to develop a system. Testing and debugging of programs need to be performed thoroughly to ensure everything is running smoothly.

However, work life needs to be balanced though to really enjoy programming. It is also fun to create or modify our own website as a hobby, interest or casually.


In a nutshell, I enjoy programming.


Next Blog Post: My Favorite Programming Languages (which ones I like, debuggers)


More information on coding will be coming in the future after the next blog post.

Cheers,

Rogerkoo