Search

Sunday, July 8, 2012

[web dev] PHP vs ASP.net


A comparison of PHP (Open Source) vs ASP.net (Commercial), Performance, Cost, Scalability, Support and Complexity

There are hundreds of forum debates and articles on the Internet about whether PHP or ASP.net is a better platform. Unfortunately, most opinions are biased and their preference is typically based on promoting one programming language over the other.
Also, if you pay attention to the dates on those articles and debates, you will see that most of the information is outdated and old. This is unfortunate — the debates are showing on top of search engines and the information is no longer valid. We need to consider that there are periodic major upgrades and improvements done to both PHP and ASP.net platforms. 

Let me assure you that both programming languages are used in very large web applications and large successful web sites so there should not be any doubt to the ability of any of the above programming languages to handle a large web application project.

In this article:
Regarding performance, I'll explain what factors will effect performance and the result will prove that selecting one programming language over the other because of speed is pointless in most scenarios.

Regarding scalability, I'll explain what factors to consider when it comes to scalability and if programmed correctly, both programming languages are very scalable.

Regarding cost and support, since PHP is open source and commonly runs on an open source platform, LAMP (Linux, Apache, MySQL, PHP), PHP wins over ASP.net for providing the most cost effective solution and providing a large amount of resources and support. 

Regarding time to deployment (an additional concern for cost,) on average, it takes twice as much code writing to accomplish something with ASP.net than PHP, so time to deployment is faster using PHP.
I'll go over each of the considerations and also provide my two cents below:

I. Scalability and Ease of Maintenance

Scalability and ease of maintenance have nothing to do with whether you select PHP or ASP.net platform. Web Application scalability and ease of maintenance primarily depend on:
  • Programmers' experience
  • Using the best programming practices
  • Using a solid programming framework
  • Following programming guidelines and standards

II. Performance and Speed

There has been much debate about this subject and most of the debates have been biased and have been tailored to promote one of the programming languages instead of informing the audience.
There are so many other factors to consider when it comes to measuring web application speed, so the speed of any programming language should not have any noticeable effect on the speed and performance of most of the websites today. 

However, if the programming language needs to perform enormous tasks similar to the kind that sites such as Google or Yahoo do daily, then there should be a lot of consideration in selecting a very fast programming language for required enormous tasks — that is why Google and Yahoo use several programming languages (mostly open source), each selected to handle the tasks that the programming language is best at performing.

Below, I'm going to analyze the common and uncommon scenarios and explain which task is better than the other:
1st Common Scenario: 
One of the common tasks of any web application would be to access and query the database and output the result to the web server and then to the browser. So on this common scenario, all the programming language is doing is communicating / interfacing with the database server and web server. On this common scenario, the speed of the programming language has almost no affect on this process; the speed of this process relies on the database server, web server, client's web browser / computer and bandwidth.
When it comes to the main and common database servers, MySQL (now owned by Oracle), PostgreSQL, MSSQL and Oracle are all fighting for speed and performance. We keep seeing new features and better performance by all database servers in each version upgrade so I will say that the above database servers will all have a great performance if the database programmers use optimized and practical SQL queries and if needed, use the advanced features such as caching.
MySQL is used by Google, Facebook, YouTube, Yahoo and recently on FIFA World Cup which received a huge audience around the World. So I would not question the capability of the MySQL database server.
Based on my research on a few online stats, as of this writing, the communication and interfacing between PHP and MySQL is faster than ASP.net and MSSQL but it is not very noticeable.
2nd Common Scenario: 
One of the other common tasks of any web application would be to access the file system, find an image and send it to the web server. In this case, again, the programming language is doing very little — it is the Operating System and the file system that has the burden of communicating with the programming language. 

Based on my research on a few online stats, as of this writing, the Linux OS and ext4 (file system) performs better (IO) than Windows OS and NTFS (file system.) 

3rd Common Scenario: 
Most Linux / Unix servers are run very lean without any extra un-needed packages or GUI interfaces and therefore the OS uses a lot less CPU and RAM which provides more allocation to the database and web server.

Most windows servers run clunky and with many un-needed packages and GUI which will be using much more CPU and RAM.

Obviously, a LAMP platform will have an advantage over the ASP.net platform because it will have more available resources.
4th Not Very Common Scenario: 
ASP.net is usually written in C# (pronounced C Sharp) — generally speaking, as of this writing, C# is a faster programming language than PHP. (This may change as each programming language will come up with upgrades to fight for a better speed.) So if the programming language needs to run a 2,000,000 loop execution of a calculation, an ASP.net written in C# will win over PHP. However, this is a very uncommon scenario, the most loop executions of a calculation would be in 100s and not 2,000,000s. And in this case, there should be other concerns about why someone needs to do a 2,000,000 loop calculation.
Additional items that can have an effect on performance but have nothing to do with which programming language is selected are:
  • Ability and knowledge of programmer(s) to optimize the code
  • Ability and knowledge of programmer(s) to write proper and optimized SQL queries.
  • Functionality required (some functions may take longer to execute in the ASP.net platform and less time in PHP platform and vice versa.

III. Cost:

PHP, MySQL server, PostgreSQL server, Apache server, and Linux OS are all free and upgrades are also free. In addition, there is no additional licensing cost for having another hot standby server as a backup, or needing to run multiple servers for load balancing or server clustering.
LAMP (Linux, Apache, MySQL and PHP) is also much more popular among hosting companies, and its popularity results in a lower monthly hosting cost for LAMP hosting compared to Windows hosting.
ASP.net and IIS are free if you purchase Windows OS. There is a substantial licensing cost for a Microsoft Windows Server, Microsoft SQL Server and future upgrades. For example, Microsoft Server 2008 R2 Standard - 64-bit cost is about $1029 and Microsoft SQL Server 2008 Standard Edition For Small Business cost approximately $1038.
The above licensing costs for Microsoft can substantially increase if the site becomes popular and there is a need to run the site on multiple servers or requires server features such as load balancing, server clustering or hot standby.

IV. Support and Resources

Since LAMP is open source, there is a vast amount of dedicated and friendly developers around the world who continuously make improvements and updates, and provide support for the platform. Additionally, there are more support resources and developers available for PHP and LAMP Platforms.
The reason why I mentioned the word "friendly," is because Open Source developers who contribute to the Open Source community are doing so not for financial gain. If you seek help with a functionality challenge and post a question on a PHP forum, you will receive useful information from friendly contributors.
ASP.net relies on an available number of developers at Microsoft for making improvements and updates. There are less support contributors available to solve ASP.net challenges.

V. Time to Deploy

It takes a larger amount (more lines) of code to accomplish complex features and functionality with ASP.net compared to PHP, adding more time to the development process.
Additionally, PHP is interpreted at the server, so when changing a functionality, no additional steps are required to see the changes. On the other hand, ASP.net needs to be compiled each time the code is modified. Again, the development process is more time-consuming when using ASP.net as opposed to PHP.

VI. Editors and Tools

PHP & MySQL is editor independent. PHP developers have access to an extensive number of editors.
Most ASP.net programmers rely on Microsoft Visual Studio editor to help them develop .NET Applications. (Many ASP.net developers love and swear by the Microsoft Visual Studio.)

It is a different style of programming — PHP and open source developers tend to use text editors such as VI, VIM, Notepad ++. 

VI and VIM are very advanced and independent editors, and the programmers who learn and use those editors to the fullest capabilities can perform very complex programming, in a fast, efficient and independent way. Those programmers have more control and flexibility, and when it comes to the need of using and integrating other essential platforms, such as JavaScript, Ajax, JQuery, etc., the PHP developers have a better advantage because of their familiarity with the open source environment and hand coding using VI or VIM editors.

VI. Platform Independent

PHP is platform independent and can run on any platform — Linux, Unix, Mac OS X, Windows.
ASP.net is built to run only on Windows platform.

VI. Which popular sites run on which platforms?

The following table lists the top, popular sites and the platform and languages they use.
Note: Please don't confuse C with C# (pronounced C Sharp) — they are completely different programming languages. ASP.net is mostly programmed in C# (C Sharp) or Visual Basic and not C.
SiteUp SinceServer PlatformProgramming
Language
Google.comNovember 1998LinuxC, Java, C++, PHP & MySQL
Facebook.comFebruary 2004LinuxPHP, MySQL and C++
YouTube.comFebruary 2005LinuxC, Java and MySQL
Yahoo.comAugust
1995
LinuxC++, C, Java, PHP & MySQL
MSN.com (owned by Microsoft)August
1995
WindowsASP.net
Live.com (owned by Microsoft)August
2008
WindowsASP.net
WikipediaJanuary
2001
LinuxPHP & MySQL
Amazon.comOctober
1995
Linux & SolarisC++, Java, J2EE
WordPress.comNovember
2005
LinuxPHP & MySQL

VII. Popularity

The LAMP platform is much more popular than the Windows platform. Based on Netcraft's July 2010 Web Server Survey of 205,714,253 sites, 112,945,968 (54.90%) are hosted on Apache and 53,217,620 (25.87%) are hosted on Windows; the rest are hosted on other platforms.

VII. Usability and Ease of Deployment

There are many misconceptions and misinformation about Linux being unfriendly.
This really depends on the experience and knowledge of the person setting up the platform.
However, I have to say that I'm very impressed with the new and improved versions of popular Linux distributions. These distributions of Linux such as Ubuntu, Red Hat, CentOS, openSUSE, and Fedora have done a great job providing ease of installation and deployment, as well as a simple and straight forward GUI interface that makes configuration and setting up of a Linux server very manageable.
Unfortunately, in my opinion, Microsoft Server has been going backward with usability, by making the server administration extremely clunky and filled with complex and un-needed features.
Research for this article was completed August 1, 2010; pricing and other information may change.

[web gaming] Java vs Flash

On the surface, Java is a lot more powerful than Flash. Flash, on the other hand, may be easier on beginners.

Java Pros:
- A powerful programming language and VM environment.
- Arguably faster rendering vs. Flash.
- Threading support.
- Excellent documentation (compared to Flash).

Java Cons:
- Performance on some systems/browsers isn't that great always.
- More dangerous (and treated as such by browsers).
- You really need to be a programmer to use it.
- You need a lot more "framework" to get rendering/input going.

Flash Pros:
- Designed specifically for graphics output (animations, movies, etc).
- Easy for beginners to venture into making games.
- Development-time visualization (time-line based development).
- Built-in, simple, resource management.
- AS3
- Supports 3D rendering (Flash Player 10+)

Flash Cons:
- Single threaded. No support for multithreading.
- Performance problems (inherent to Flash).
- Lackluster documentation.
- Terrible code editor (Adobe Flash CSx)
- Terrible debugging (Adobe Flash CSx)
- AS2. 'nuff said.
- A lot of quirks you need to get used to.

Once a wise man said - 
'From a programmer's perspective,I like Java better. From a designer's perspective, I like Flash better.    Personally, I hate both'. 

Free high quality Icons


Today, I was searching for free icons for a website. And, I found a very useful website freeiconsdownloads.com. Free Icons Downloads offer over 230 high quality Royalty Free Icons sets. The best thing about them is all the Icon-set displayed in their website is free to download.You know many of similar kind of website offers high quality icons but you’ve to spend some money for this which you’ve not do in this website.

Icons divided in Various Category

There are more than 15 categories under which icons are categorized in Free Icons Download. So it will be easy for you to find the icon of certain category of your choice. Furthermore, you can browser the icon-sets by various options such as LatestMost DownloadsMost Populars .

Useful Icons

Whenever I need icons for me, my first choice is Freeiconsdownloads as they have exclusive collections of useful items icons divided under various category. You can find the icons in that website easily navigating from different category.

Other free designing Stuff

Including free Icons,Freeiconsdownload has many other free designing stuffs like free banners, free logos and designs and interfaces. You can browser all these other free designing stuffs from the right sider bar of their website.
Have look at freeiconsdownloads.com , it very useful website for for designing stuffs which you may need on your daily works.

Jquery - Benefits, Examples and Free Ebook


What is jQuery?

Directly taken from the website of jQuery -” jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages”.It is basically a JavaScript framework for writing huge task of JavaScript with few lines of code.

What are the benefits of jQuery?

1) 5 lines of code of jQuery can perform better task than 25 lines of traditional Javascript code.
2) Various number of plugins are available and a large community support this project it is better to use jQuery in your project compared to other JavaScript frameworks like prototype.js or moottools .
3) jQuery’s website contains very good documentation with useful examples.
4) It simplifies the Ajax Development. Just have to write 5 or 6 lines to call the Ajax. Isn’t that easy??
Well these are just few benefits of jQuery but if you start using jQuery then you’ll come to know about the actual benefits of using jQuery. And believe me, It worth using jQuery in your web applications otherwise just blame me.

Basic Examples of jQuery :

$(document).ready(function()
{
    $(".button").click(function ()
    {
      $("p").hide("slow");
    });
});
In the above example, when a element with class “button” is clicked, all the paragraph element (“p”) will be hidden in the whole document in slow movement i.e. with slight animation.
$(document).ready(function()
{
      $("#divid").load("sample.php");
});
Above is the example Ajax using jQuery, look how simple it is to use ajax using jquery.The response got from the sample.php file is filled inside the element whose id is “divid”.

Free Ebook for download :

Well I’ve downloaded a E-book of jQuery in chm format.It contains chm version of the document found in docs.jquery.com. This E-book contains the very good documentation as well as useful examples.

6 free ajax-php chat applications


While talking about chat application, these days people hate those kind application made in PHP which need page refreshing. In this post, I’ll show you six different free Ajax chat applications which might be very useful if you’ve to use Ajax based chat application. Depending upon the requirement of your chat application, you can use them. I might have missed another good Ajax based chat application, if you find any the please post it to the comments.

Ajax Chat from http://blueimp.net

Free Ajax chat application using PHP
A powerful Ajax chat application with a lot of features at free of cost. Customize the layout and Use it in your project.

Ajax- IM

It is not a only a chat application, it is a instant messenger that’s why it is named as Ajax-IM. Very useful for implementing in community based websites.

PHPfreeChat


Another great Ajax chat application build in PHP.Very easy to customize and use. You can even create rooms for chatting as well.

Chatr

Another simple ajax chat application with limited functionality built in PHP.

Ajax chat from Ajax-chat.org

Very simple, lightweight and easy to use another Ajax chat application built in PHP.

Ajax chat from Blogoscopted

Fancy and avatar based ajax chat application built in PHP. As you can see in the above image, it looks like you’re really inside a chat room for chtting.

Saturday, July 7, 2012

Google Trends - Did you know?

Did you know there is a google page where you can check the most frequent words and phrases searched on google on a given day?


Well, now you know :)

Google Trends


Google Hot Trends

Enjoy

10 Most Visited Websites 2011-2012


google-facebook-yahoo

The prevalent language for communication on the Internet has been English. This may be a result of the origin of the Internet, as well as the language’s role as a lingua franca. Early computer systems were limited to the characters in the American Standard Code for Information Interchange (ASCII), a subset of the Latin alphabet. After English (27%), the most requested languages on the World Wide Web are Chinese (23%), Spanish (8%), Japanese (5%), Portuguese and German (4% each), Arabic,French and Russian (3% each), and Korean (2%).By region, 42% of the world’s Internet users are based in Asia, 24% in Europe, 14% in North America, 10% in Latin America and the Caribbean taken together, 6% in Africa, 3% in the Middle East and 1% in Australia/Oceania. The Internet’s technologies have developed enough in recent years, especially in the use of Unicode, that good facilities are available for development and communication in the world’s widely used languages. However, some glitches such as mojibake(incorrect display of some languages’ characters) still remain. Overall Internet usage has seen tremendous growth. From 2000 to 2009, the number of Internet users globally rose from 394 million to 1.858 billion. Well, what websites are getting all these viewers?


1. Google

googlelogok 10 Most Visited Websites 2011 2012
Page rank: 1
Daily Pageviews: 8,322,375,115
Daily Visitors: 191,857,050
Country: USA
Net Worth: $5.5 Billion

Google Search or Google Web Search is a web search engine owned by Google Inc. Google Search is the most-used search engine on the World Wide Web, receiving several hundred million queries each day through its various services. The order of search results on Google’s search-results pages is based, in part, on a priority rank called a “PageRank”. Google Search provides many options for customized search, using Boolean operators such as: exclusion (“-xx”), inclusion (“+xx”), alternatives (“xx OR yy”), and wildcard (“x * x”). The main purpose of Google Search is to hunt for text in Web pages, as opposed to other data, such as with Google Image Search. Google Search was originally developed by Larry Page and Sergey Brin in 1997. Google Search provides at least 22 special features beyond the original word-search capability. These include synonyms, weather forecasts, time zones, stock quotes, maps, earthquake data, movie showtimes, airports, home listings, and sports scores. There are special features for numbers, including ranges (70..73),prices, temperatures, money/unit conversions (“10.5 cm in inches”), calculations (“3*4+sqrt(6)-pi/2″), package tracking, patents, area codes, and language translation of displayed pages. In June 2011, Google introduced “Google Voice Search” and “Search by Image” features for allowing the users to search words by speaking and by giving images.
—————————————————————————————————————

2. Facebook

facebooklogodb 10 Most Visited Websites 2011 2012
Page rank: 2
Daily Pageviews: 23,023,205,668
Daily Visitors: 168,117,950
Country: USA
Net Worth: $4.8 Billion

Facebook is a social networking service and website launched in February 2004, operated and privately owned by Facebook, Inc. As of July 2011, Facebook has more than 800 million active users. Users may create a personal profile, add other users as friends, and exchange messages, including automatic notifications when they update their profile. Facebook users must register before using the site. Additionally, users may join common-interest user groups, organized by workplace, school or college, or other characteristics, and categorize their friends into lists, e.g. “People From Work”, or “Really Good Friends”. The name of the service stems from the colloquial name for the book given to students at the start of the academic year by university administrations in the United States to help students get to know each other. Facebook allows any users who declare themselves to be at least 13 years old to become registered users of the website.
—————————————————————————————————————

3. Youtube

4176459448aa68a36c1a 10 Most Visited Websites 2011 2012
Page rank: 3
Daily Pageviews: 7,621,914,928
Daily Visitors: 118,256,600
Country: USA
Net Worth: $3.4 Billion

YouTube is a video-sharing website, created by three former PayPal employees in February 2005, on which users can upload, share and view videos. The company is based in San Bruno, California, and uses Adobe Flash Video and HTML5 technology to display a wide variety of user-generated video content, including movie clips, TV clips, and music videos, as well as amateur content such as video blogging and short original videos. Most of the content on YouTube has been uploaded by individuals, although media corporations including CBS, BBC, VEVO, Hulu, and other organizations offer some of their material via the site, as part of the YouTube partnership program.
—————————————————————————————————————

4. Yahoo

yahoologo 10 Most Visited Websites 2011 2012
Page rank: 4
Daily Pageviews: 1,813,459,921
Daily Visitors: 94,128,650
Country: USA
Net Worth: $2.7 Billion

Yahoo! Search is a web search engine, owned by Yahoo! Inc. and was as of December 2009, the 2nd largest search engine on the web by query volume, at 6.42%, after its competitor Google at 85.35% and before Baidu at 3.67%, according to Net Applications. Originally, Yahoo! Search started as a web directory of other websites, organized in a hierarchy, as opposed to a searchable index of pages. In the late 1990s, Yahoo! evolved into a full-fledged portal with a search interface and, by 2007, a limited version of selection-based search. Yahoo! Search, originally referred to as Yahoo! provided Search interface, would send queries to a searchable index of pages supplemented with its directory of sites. The results were presented to the user under the Yahoo! brand. Originally, none of the actual web crawling and storage/retrieval of data was done by Yahoo! itself. In 2001 the searchable index was powered by Inktomi and later was powered by Google until 2004, when Yahoo! Search became independent. On July 29, 2009, Microsoft and Yahoo! announced a deal in which Bing would power Yahoo! Search. All Yahoo! Search global customers and partners are expected to be transitioned by early 2012.
—————————————————————————————————————

5. Baidu

baidulogo300x2241 10 Most Visited Websites 2011 2012
Page rank: 5
Daily Pageviews: 3,079,134,653
Daily Visitors: 40,567,450
Country: China
Net Worth: $1.1 Billion

Baidu, Inc.  simply known as Baidu and incorporated on January 18, 2000, is a Chinese web services company headquartered in the Baidu Campus in Haidian District, Beijing, People’s Republic of China. Baidu offers many services, including a Chinese language search engine for websites, audio files, and images. Baidu offers 57 search and community services including Baidu Baike, an online collaboratively-built encyclopedia, and a searchable keyword-based discussion forum. Baidu was established in 2000 by co-founders, Robin Li and Eric Xu. Both of the co-founders are PRC nationals who studied and worked overseas before returning to China. In June 2011, Baidu ranked 5th overall in the Alexa Internet rankings. During Q4 of 2010, it is estimated that there were 4.02 billion search queries in China of which Baidu had a market share of 56.6%.China’s internet-search revenue share in second quarter 2011 by Baidu is 76% In December 2007, Baidu became the first Chinese company to be included in the NASDAQ-100 index. Baidu provides an index of over 740 million web pages, 80 million images, and 10 million multimedia files. Baidu offers multimedia content including MP3 music and movies, and is the first in China to offer Wireless Application Protocol (WAP) and personal digital assistant (PDA) based mobile search.
—————————————————————————————————————

6. Wikipedia

wikipedialogo 10 Most Visited Websites 2011 2012
Page rank: 6
Daily Pageviews: 313,997,828
Daily Visitors: 55,386,100
Country: USA
Net Worth: $1.5 Billion

Wikipedia  is a free, web-based, collaborative, multilingual encyclopedia project supported by the non-profit Wikimedia Foundation. Its 19.7 million articles (over 3.7 million in English) have been written collaboratively by volunteers around the world. Almost all of its articles can be edited by anyone with access to the site, and it has about 90,000 regularly active contributors. As of July 2011, there are editions of Wikipedia in 282 languages.
—————————————————————————————————————

7. Blogger

blogger2 10 Most Visited Websites 2011 2012
Page rank: 7
Daily Pageviews: 624,202,064
Daily Visitors: 292,790,652
Country: USA
Net Worth: $1.4 Billion

Blogger is a blog-publishing service that allows private or multi-user blogs with time-stamped entries. It was created by Pyra Labs, which was bought by Google in 2003. Generally, the blogs are hosted by Google at a subdomain of blogspot.com. Up until May 1, 2010 Blogger allowed users to publish blogs on other hosts, via FTP. All such blogs had (or still have) to be moved to Google’s own servers, with domains other than blogspot.com allowed via Custom URLs. In July of 2011 a news outlet announced that Google intends to change the name of the service from “Blogger” to “Google Blogs,” as part of a larger plan to re-brand or retire all non-Google brands in its portfolio of products and services.
—————————————————————————————————————

8. Windows Live

windows20liveb 10 Most Visited Websites 2011 2012
Page rank: 8
Daily Pageviews: 684,728,105
Daily Visitors: 45,464,650
Country: USA
Net Worth: $1.3 Billion

Windows Live is the collective brand name for a set of services and software products from Microsoft, part of their software plus services platform. A majority of these services are Web applications, accessible from a browser, but there are also client-side binary applications that require installation. There are three ways in which Windows Live services are offered: Windows Live Essentials applications, web services, and mobile services.
——————————————————————————————————————

9. Twitter

 twitterlogovw 10 Most Visited Websites 2011 2012
Page rank: 9
Daily Pageviews: 253,299,926
Daily Visitors: 39,766,650
Country: USA
Net Worth: $1.1 Billion

Twitter is an online social networking and microblogging service that enables its users to send and read text-based posts of up to 140 characters, informally known as “tweets”. Twitter was created in March 2006 by Jack Dorsey and launched that July. Twitter rapidly gained worldwide popularity, with 200 million users as of 2011, generating over 200 million tweets and handling over 1.6 billion search queries per day. It is sometimes described as the “SMS of the Internet.” Twitter Inc., the company that operates the service and associated website, is based in San Francisco, with additional servers and offices in San Antonio, Boston, and New York City.
—————————————————————————————————————

10. QQ.com

 tencentqq 10 Most Visited Websites 2011 2012
Page rank: 10
Daily Pageviews: 1,092,194,208
Daily Visitors: 27,388,900
Country: China
Net Worth: $788 Million

Tencent QQ, generally referred to as QQ, is the most popular free instant messaging computer program in mainland China. As of July 11, 2011, the active QQ users accounts for QQ IM totaled 812.3 million,possibly making it the world’s second largest online community. The number of simultaneous online QQ accounts exceeded 100 million.
—————————————————————————————————————