101 Reasons Why Java is Better than .NET

you migrate to a superior Java platform .

1. Public Domain APIs - Any Java public apis are part of the public domain, .NET apis are proprietary and can open the door to a law suit.
2. Standard Library Source Code Availability - Java source code for the core libraries are available in every J2SDK distribution, .NET sources can only be seen by resorting to illegal means.
3. dotNet Purity Is A Myth - Java promotes 100% pure Java libraries, for .NET purity is nothing more than a myth.
4. 75% Of Enterprise Software Development - Avoid becoming one of the 25% of "use-less" employees.
5. Preferred Platform for Implementing WebServices - Despite billions spent by Microsoft in marketing, surveys A Java keyword used to resume program execution at the end of the current loop. If followed by a label, continue resumes execution where the label occurs. 

', CAPTION, 'continue',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">continue to reveal that Java is the preferred platform when it comes to Web Services.
6. Superior Platform for Web Development - ASP.NET is a poorly designed and crippled framework as compared to the richness of frameworks found in Java.
7. Write Stored Procedures using Java - Most relational databases support writing of stored procedures in the Java language. There has yet to be a production release of a database that supports any .NET languages.
8. An Abundance of Experienced Practitioners - Nobody seems to know how to write .NET programs well and that's giving .NET a bad name! A pretty lame excuse I must say!
9. Supportive Open Source Communities - Open Source communities that support Running in more than one address space. 

', CAPTION, 'distributed',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">distributed
development are a plenty in the Java world.
10. Proven Security - 2 Years after Trust Worthy initiative is launched and we collectively lose $55 billion last year.
11. No Lizard Brain - .NET programmers continue to struggle with the complexities of a hybrid managed/unmanaged environment.
12. More Languages - The JVM is more "common" than the CLR.
13. Smaller Runtime Download - You can't run your app if you don't have the runtime.
14. No Mandatory Upgrade Fees - 3 things a Microsoft shop can't avoid: Death, Taxes and License 6.
15. More Vendor Choices - .Net is a marketing program. Java is a Market.
16. Industrial Strength Collection Classes - The .Net libraries look like they were designed by high-school students, First year CompSci? students at best.
17. FutureProof - The way to ensure your return on investment (i.e. ROI) is that your choice of platform doesn't get obsolete in 5 or even 10 years. Avoid the Microsoft upgrade treadmill!
18. Larger Talent Pool - Majority of Universities not only teach but require knowledge of Java. That's a big talent pool that you need to consider before you off-shore your project to a different time-zone.
19. More Contributions From Researchers - Research institutions and universities have consistently provided innovative research not only built on top of Java but also contributing to Java.
20. US Government Approved - Guess where the billions of dollars spent on the U.S. government's IT renovation is going to?
21. NoEvilTypeCoercion - Some C++ constructs are meant to be entombed forever, .NET resurrects them with disastrous consquences.
22. More Mature And Robust O/R Mapping - You can't beat the wealth of O/R mapping solutions found in Java.
23. Superior Coding Tools - Like having your own personal Java fairy dancing through your code, anticipating your every thought and keystroke.
24. Sane Coding Conventions - I don't know what's worse Hungarian notation or .NET coding conventions.
25. Higher Paying Jobs - Somehow you've got to afford those skyrocketing housing prices don't you?
26. Favored for Implementing P2P - Gnutella and JXTA, anything A Java keyword used to execute a block of statements in the case that the test condition with the if keyword evaluates to false. 

', CAPTION, 'else',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">else
legally more pervasive?
27. PureJavaRDMS - Can't beat the ease of installation when the RDMS is Java based and packaged with the application in a .zip file.
28. More An event during program execution that prevents the program from continuing normally; generally, an error. The Java programming language supports exceptions with the try, catch, and throw keywords.

', CAPTION, 'exception',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">exception
Handling Options - .NET has no analog to the throws clause in A function defined in a class. 

', CAPTION, 'method',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">method
signatures.
29. Better Structured Diagramming Frameworks - When going beyond forms and windows, Java can't be beat.
30. Reusable Open Source IDE Frameworks - Why re-invent the wheel? Start building your killer Graphical User Interface. Refers to the techniques involved in using graphics, along with a keyboard and a mouse, to provide an easy-to-use interface to some program. 

', CAPTION, 'GUI',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">GUI
application on top of killer IDE frameworks.
31. RobustParserGenerators - Want to build a A Java keyword used to create an instance of a class. 

', CAPTION, 'new',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">new
language, well you'll need some robust parser building tools.
32. AspectOrientedProgramming - The next advance in modular software development, get a head start by using Java.
33. PureJavaWebServers - Customizations and extensions are easier in a web container that's built using the same language as applications. Furthermore, managed environments support better reliability and security.
34. OpenSourceJavaCompilers - Your tools have got to be able to parse the code before it has any chance in understanding it.
35. Distributed Caching - Sometimes embarassingly parallel applications aren't the only things that you need to scale.
36. MultipleReliableMessagingChoices - Java provides more choices for the backbone that integrates the Enterprise.
37. Faster Development Turnaround - Incremental compilation is unavailable in the .NET environment.
38. Lightweight Persistence - Sometimes a relational database (RDMS) has too big a footprint.
39. Open Community Process - How does one contribute to the specification of standards?
40. Hardware Accelerators - Performance boosting hardware.
41. More Flexible Licensing Options - Ultimate flexibility in licensing.
42. EmbeddedDevices - Java inside small packages.
43. Faster Virtual Machines -
44. MickrokernelArchitectures
45. ContinuousBuild
46. WholeProgramOptimization - Please sir may I have a linker?
47. Comprehensive RDMS Driver Support - Can you find a ADO.NET driver for an open source database?
48. Superior Code Analysis Tools
49. NetworkingSupport - Why is MSN managed by a Java based tool?
50. More The automatic detection and freeing of memory that is no longer in use. The Java runtime system performs garbage collection so that programmers never explicitly free objects. 

', CAPTION, 'garbage collection',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">garbage collection
Options
51. ReliabilityConcerns
52. Better Web Services Interoperability
53. Better Domain Specific Languages Support
54. Painless Upgradability
55. Simple Side By Side Execution
56. More Business Rules Engines
57. Lightweight Containers
58. Better Business Process Management
59. Sixty Four The smallest unit of information in a computer, with a value of either 0 or 1.

', CAPTION, 'bit',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">bit
Support
60. Millions Of Java Phones
61. Garbage Collect Classes - The only way to unload MSIL code is to unload an entire application domain.
62. More Alternative VM Implementations
63. Hard Realtime Capabilities
64. Cross Platform Language Integration
65. More Extensive XML Support
66. Better Support For Dynamic Distributed Systems
67. Superior 2D Drawing
68. Better GUI Framework - Why isn't VS.NET written in a .NET language?
69. SuperiorBranding
70. No Anti Open Source Agenda
71. Standardized Portal Frameworks - Standardized ""Integration at the glass"".
72. RunInIntepreterMode - ""We're just not optimized for interpreting""
73. More Semantic Web Research
74. Leads In Software Process Best Practices
75. Better Concurrency Utilities
76. More Multicasting Libraries
77. Superior Refactoring Tools
78. Higher Demand Therefore More Jobs
79. Faster And More Reliable Regex
80. SuperiorBuildEnvironments - A .NET practitioner's concept of a build is F7.
81. Embarassingly Rich Information Sources
82. More Open Source Projects
83. Affordable Industrial Grade IDEs
84. Standardized Enterprise Connectivity
85. DynamicLanguagesSupport
86. MorePDASupport - Why limit oneself to a single PDA brand?
87. OpenTechnologyRoadmap - .NET is like a five year plan in the former USSR: You know it doesn't actually make sense or help anything, but if you live under it, you're certainly not going to say anything negative about it.
88. EmergingStandardsSupport
89. JavaCard - JavaCards? are becomming the preferred method of keeping tabs on your citizenry or customers. If Microsoft ever co-opts this technology then "1984" will become more than just a paperback novel.
90. Complete Open Source Stack - Open Source code visibility spanning all layers of an application.
91. NonStopServers - .NET not fault-tolerant enough for Hewlett-Packard-Compaq?
92. Out Of This World - Java runs on other planets, .NET has yet to leave Terra Firma.
93. Better Unit Testing Support - More extensions and comprehensive IDE support
94. More Identity Management Solutions - Can you trust Microsoft to keeping your customer's identity secure and available?
95. Most UML Tools Implement In Java - Ever wonder why the best UML tools are implemented in Java?
96. More R&D On Intelligent Agents - Java is the preferred implementation platform for Intelligent Agents.
97. Easy Rich In the client/server model of communications, the client is a process that remotely accesses resources of a compute server, such as compute power and large memory capacity.

', CAPTION, 'client',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();">client
Deployment - No-Touch development was shaky.
98. Lower Cost for Massively Parallel Systems - How much does it cost to deploy a .NET application on a platform with 10,000 servers like google?
99. More Profilers - Profilers mitigate the risk of not finding the root cause of show stopping bugs.
100. Eclipse
101. OneHunderedReasons

Top 10 PHP MVC frameworks

Top 10 PHP MVC frameworks

Development of PHP scripts without a preconceived plan to manage them is asking for a headache. The goal of a framework is to make the process of writing web-based applications simpler.

An application designed around MVC is easier to manage because it is split into tiers, which allow for independent development. This promotes code reusability by building models, which are reusable throughout the application.

What makes a good framework?

A good framework is easy to learn, simple to use, intuitive to work with, easy to extend or to modify, rapid to build (maintain) applications with and of course stable.

Having said that, here is my top 10 PHP MVC Frameworks:

10- Ambivalence: A Java-Maverick Port
9- WACT: Web Application Component Toolkit
8- Achievo: A good RAD framework
7- Phrame: A Java-Struts port
6- Studs: A Java-Struts port to PHP
5- Prado: The winner of Zend coding contest
4- PHPOnTrax: a Rails port - PHP5 Only
3- CakePHP: Inspired by Rails PHP4/5
2- Mojavi: The first MVC framework I fell in love with

and the winner is:

1- Symfony: Based on Mojavi and inspired by Rails

This list is based on my personal tests and use. I have tested and played with many others, but I think these are the best frameworks out there.
- The first framework I fell in love with was Mojavi because of its elegant way to implement the MVC model.
- Symfony corrected some problems in Mojavi and improved it by taking the good sides of RubyOnRails and Propel.
- CakePHP is very promising, the only problem - really, I don't know if it is a problem - is: the development process is very slow.

PHP Security Rules

PHP security rules

here’re some PHP security tips:

(1) HTTPS. No discussion, don’t assume anything if you haven’t got it.

(2) Userdata belongs on the server, and stays on the server. Users know their own password, emailadres, etc, and why transfer logged in status & rights to and from the user? THe only place where they’re needed is on the server itself…

(3) Using Cookies to keep track of logged in visitors is handy. They should have random, unguessable values, and absolutely nothing to with their actual information. Their just an random ID for you, the data that they represent you can link on the server.

(4) Do not keep users logged in. Session time out and cookies, if still present, become useless for anyone trying to use it later. Explain that to people who don’t want to remember passwords.

(5) Do not use the same ID purposefully twice (although it might occur, chances should be very slim). A user logs in, and gets a random id.

(6) THE golden rule: never, ever trust user input. If you expect a number, make sure it’s a number. If you expect only certain characters, make sure there are no other. If you cannot escape the fact that users have to enter an unknown text, use the escaping tools of characters at your disposal. Be very, very weary for SQL injection.

There are others, but these are the most important imho. There are others, like keep a log what users do from what location, but that’s usually only needed when is has gone wrong, and you have to track it back, never save a plain password, do not display errors in you code should it break for some reason, error-displaying is for development, etc

10 Advanced PHP Tips To Improve Your Programming

PHP programming has climbed rapidly since its humble beginnings in 1995. Since then, PHP has become the most popular programming language for Web applications. Many popular websites are powered by PHP, and an overwhelming majority of scripts and Web projects are built with the popular language.

Because of PHP’s huge popularity, it has become almost impossible for Web developers not to have at least a working knowledge of PHP. This tutorial is aimed at people who are just past the beginning stages of learning PHP and are ready to roll up their sleeves and get their hands dirty with the language. Listed below are 10 excellent techniques that PHP developers should learn and use every time they program. These tips will speed up proficiency and make the code much more responsive, cleaner and more optimized for performance.


1. Use an SQL Injection Cheat Sheet


A list of common SQL injections.

SQL injection is a nasty thing. An SQL injection is a security exploit that allows a hacker to dive into your database using a vulnerability in your code. While this article isn’t about MySQL, many PHP programs use MySQL databases with PHP, so knowing what to avoid is handy if you want to write secure code.

Furruh Mavituna has a very nifty SQL injection cheat sheet that has a section on vulnerabilities with PHP and MySQL. If you can avoid the practices the cheat sheet identifies, your code will be much less prone to scripting attacks.


2. Know the Difference Between Comparison Operators


PHP’s list of comparison operators.

Comparison operators are a huge part of PHP, and some programmers may not be as well-versed in their differences as they ought. In fact, an article at I/O reader states that many PHP developers can’t tell the differences right away between comparison operators. Tsk tsk.

These are extremely useful and most PHPers can’t tell the difference between == and ===. Essentially, == looks for equality, and by that PHP will generally try to coerce data into similar formats, eg: 1 == ‘1′ (true), whereas === looks for identity: 1 === ‘1′ (false). The usefulness of these operators should be immediately recognized for common functions such as strpos(). Since zero in PHP is analogous to FALSE it means that without this operator there would be no way to tell from the result of strpos() if something is at the beginning of a string or if strpos() failed to find anything. Obviously this has many applications elsewhere where returning zero is not equivalent to FALSE.

Just to be clear, == looks for equality, and === looks for identity. You can see a list of the comparison operators on the PHP.net website.


3. Shortcut the else

It should be noted that tips 3 and 4 both might make the code slightly less readable. The emphasis for these tips is on speed and performance. If you’d rather not sacrifice readability, then you might want to skip them.

Anything that can be done to make the code simpler and smaller is usually a good practice. One such tip is to take the middleman out of else statements, so to speak. Christian Montoya has an excellent example of conserving characters with shorter else statements.

Usual else statement:

  1. if( this condition )
  2. {
  3. $x = 5;
  4. }
  5. else
  6. {
  7. $x = 10;
  8. }

If the $x is going to be 10 by default, just start with 10. No need to bother typing the else at all.

  1. $x = 10;
  2. if( this condition )
  3. {
  4. $x = 5;
  5. }

While it may not seem like a huge difference in the space saved in the code, if there are a lot of else statements in your programming, it will definitely add up.

4. Drop those Brackets

Drop Brackets
Dropping brackets saves space and time in your code.

Much like using shortcuts when writing else functions, you can also save some characters in the code by dropping the brackets in a single expression following a control structure. Evolt.org has a handy example showcasing a bracket-less structure.

  1. if ($gollum == 'halfling') {
  2. $height --;
  3. }

This is the same as:

  1. if ($gollum == 'halfling') $height --;

You can even use multiple instances:

  1. if ($gollum == 'halfling') $height --;
  2. else $height ++;
  3. if ($frodo != 'dead')
  4. echo 'Gosh darnit, roll again Sauron';
  5. foreach ($kill as $count)
  6. echo 'Legolas strikes again, that makes' . $count . 'for me!';

5. Favour str_replace() over ereg_replace() and preg_replace()

Str Replace
Speed tests show that str_replace() is 61% faster.

In terms of efficiency, str_replace() is much more efficient than regular expressions at replacing strings. In fact, according to Making the Web, str_replace() is 61% more efficient than regular expressions like ereg_replace() and preg_replace().

If you’re using regular expressions, then ereg_replace() and preg_replace() will be much faster than str_replace().

6. Use Ternary Operators

Instead of using an if/else statement altogether, consider using a ternary operator. PHP Value gives an excellent example of what a ternary operator looks like.

  1. //PHP COde Example usage for: Ternary Operator
  2. $todo = (emptyempty($_POST[’todo’])) ? ‘default’ : $_POST[’todo’];
  3. // The above is identical to this if/else statement
  4. if (emptyempty($_POST[’todo’])) {
  5. $action = ‘default’;
  6. } else {
  7. $action = $_POST[’todo’];
  8. }
  9. ?>

The ternary operator frees up line space and makes your code less cluttered, making it easier to scan. Take care not to use more than one ternary operator in a single statement, as PHP doesn’t always know what to do in those situations.

7. Memcached

Memcached
Memcached is an excellent database caching system to use with PHP.

While there are tons of caching options out there, Memcached keeps topping the list as the most efficient for database caching. It’s not the easiest caching system to implement, but if you’re going to build a website in PHP that uses a database, Memcached can certainly speed it up. The caching structure for Memcached was first built for the PHP-based blogging website LiveJournal.

PHP.net has an excellent tutorial on installing and using memcached with your PHP projects.

8. Use a Framework

Framework

CakePHP is one of the top PHP frameworks.

You may not be able to use a PHP framework for every project you create, but frameworks like CakePHP, Zend, Symfony and CodeIgniter can greatly decrease the time spent developing a website. A Web framework is software that bundles with commonly needed functionality that can help speed up development. Frameworks help eliminate some of the overhead in developing Web applications and Web services.

If you can use a framework to take care of the repetitive tasks in programming a website, you’ll develop at a much faster rate. The less you have to code, the less you’ll have to debug and test.

9. Use the Suppression Operator Correctly

The error suppression operator (or, in the PHP manual, the “error control operator“) is the @ symbol. When placed in front of an expression in PHP, it simply tells any errors that were generated from that expression to now show up. This variable is quite handy if you’re not sure of a value and don’t want the script to throw out errors when run.

However, programmers often use the error suppression operator incorrectly. The @ operator is rather slow and can be costly if you need to write code with performance in mind.

Michel Fortin has some excellent examples on how to sidestep the @ operator with alternative methods. Here’s an example of how he used isset to replace the error suppression operator:

  1. if (isset($albus)) $albert = $albus;
  2. else $albert = NULL;

is equivalent to:

But while this second form is good syntax, it runs about two times slower. A better solution is to assign the variable by reference, which will not trigger any notice, like this:

It’s important to note that these changes can have some accidental side effects and should be used only in performance-critical areas and places that aren’t going to be affected.

10. Use isset instead of strlen

Strlen
Switching isset for strlen makes calls about five times faster.

If you’re going to be checking the length of a string, use isset instead of strlen. By using isset, your calls will be about five times quicker. It should also be noted that by using isset, your call will still be valid if the variable doesn’t exist. The D-talk has an example of how to swap out isset for strlen:

A while ago I had a discussion about the optimal way to determine a string length in PHP. The obvious way is to use strlen().

However to check the length of a minimal requirement it’s actually not that optimal to use strlen. The following is actually much faster (roughly 5 times)

It’s a small change but, like all the tips we’ve covered today, adds up to quicker, leaner code.