Rails vs. PHP

While perusing my Slasdot feed, I ran across a great article on the ongoing Rails vs. PHP war. I agree with pretty much everything he says except I don’t like how he compares Rails vs. PHP. PHP is just a language, Rails is a framework. Although I am a fairly young web developer, there is one repeating theme I have learned: not one framework can fit all the needs of a complex web application. »

Data Access Application Blocks

Last week I discussed using ADO.NET in enterprise applications. A good part of the article was explaining the negatives of using the DataSet class. Although I stand by that conclusion, I also want to say that I like ADO.net overall. Some of the tools it provides are good for enterprise applications, while others are better for smaller applications. ADO.NET provides common interfaces and base classes that can be used with different database providers. »

ADO.NET

I recently started a new project here at Webmail.us which will be a .NET based web application. One of the core pieces of .NET web apps is, not surprisingly, ADO.NET. It is Microsoft’s upgrade from ADO, but it is more of a rewrite. Almost everything has been refactored, with many new abstractions and paradigms for how to access data. When I first read about ADO.NET, I was very skeptical. I didn’t understand the need for these complex, hard to understand abstractions like DataTable’s and DataRelation’s and DataSet’s. »

The buggiest PHP function

Well, its not really PHP’s fault. array_search is misused by developers more than any other PHP function I have seen. Just today, I found two bugs caused by misinformed developers using the function. I myself am also guilty of using this function incorrectly. The problem lies in array_search’s return value if the needle isn’t found in the haystack. If the needle isn’t found, array_search returns false. In my experience, many other libraries return -1 in this case. »

A better web framework - Part 1

As I have mentioned before, design patterns are one of my favorite areas of computer science. Well, design patterns have a close association with web frameworks, so web frameworks are definitely another favorite area of mine. They both help speed up the development process by providing a structure for applications. Since Ruby on Rails took off a couple years ago, other web frameworks have sprung up in many other languages. None of these have met my needs at Webmail.us. »

The best web framework yet

Ever since Ruby on Rails, every other web development language has attempted to develop a similar framework. Normally I don’t like them because they try and copy RoR, which can be hard because of Ruby’s differences with most other programming languages. But, I finally found one I will back. PythonOnPlanes is awesome. Not because of what it can do, but because its name is amazing. I have never really coded in Python, but I think I am going to start very soon. »

Breaking instanceof in Javascript

That’s right, this afternoon I figured out how to break instanceof in Javascript. Since I don’t use it often, I figured it worked just like it does in PHP. Basically it does, with one major caveat. Mozilla’s javascript reference gives this definition of the instanceof operator: Use instanceof when you need to confirm the type of an object at runtime. For example, when catching exceptions, you can branch to different exception-handling code depending on the type of exception thrown. »

4am

Since college, last night was the first night I can remember being up at 4 am and not wanting to be. I have been working hard on the next version of webmail which is going into beta very soon, so I haven’t had much spare time, especially to blog. During the development of this version of Webmail, I realized what could be my greatest flaw, or my greatest asset depending on who you ask. »

PHP References

I recently found this while going through PHP’s online documentation: Do not use return-by-reference to increase performance, the engine is smart enough to optimize this on its own. Only return references when you have a valid technical reason to do it! So, the question becomes, what is a valid technical reason to use references? Objects are already passed and returned by reference, so using references for them is a waste. In the last couple years of PHP coding, I have only found one good use for references: public function getNextLine(&$str){ .... »