<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0

    Around March of 2006, I decided to proceed with a complete rewrite of Ajaxwhois.com. I had been studying Ruby on Rails for long enough and knew it would be the ideal platform to develop with. And I was right. While Ruby and Rails might be a little awkward at first for the Java or .NET coder in you, it all really makes sense after a little while.

    The behind the scene code generation (aka: magic), the lack of a decent IDE, and worse, of a good debugger made my transition to Ruby somewhat difficult and sometimes confusing frustrating. I used to live in Visual Studio .NET and breath Intellisense. In fact, I still miss that to this day.

    Any newcomer to Rails will quickly discover why it is so talked about. First of all, even though I don’t consider myself anywhere near a decent Rails programmer, I am now at least twice as productive with Ruby on Rails than with ASP.NET and C#. Thanks to the MVC (Model, View, Controller), DRY (Don’t Repeat Yourself) and Convention Over Configuration mindset of Rails. All the data access code is automagically generated for you (without running a code generator), templating is built in and creating AJAX’ed applications is a snap.

    Life was good with Rails and the more I used it, the more I liked it. That was until early August of 2006. I was ready to launch version 2.0 of Ajaxwhois. Knowing so many professional Rails hackers, I thought deploying my application to my production server was going to be a breeze. I was wrong. Even though the installation of Linux (Ubuntu Dapper Drake 64 bit), Lighttpd, MySql and Mongrel went well, I experienced weird problems, mainly related to Mongrel. Sometimes, my Mongrel instances would simply die and disappear from the process list for no apparent reason. I didn’t have ANY traffic at this point because I hadn’t done DNS transfers yet. On other occasions, Mongrel went crazy and started peaking the CPU at 99%. I had to manually kill and restart it.

    After extensive research and countless “from scratch” reinstalls, I found out that Mongrel was known to not play well with 64 bit Ubuntu (I lost the links to this evidence, unfortunately). Mongrel was patched accordingly, but it didn’t solve my problem. It still crashed many times a day and I just couldn’t figure out what was wrong. I asked my good friends Rich Collins and Adam Thorsen (of Guruza.com) who are both experienced Rails developers and they had no idea either. I was stuck.

    I wanted to launch. Badly. I didn’t want to waste anymore time with this so I picked up a Python book and rewrote the whole site one more time, in Python using the Django framework this time. I had never programmed in Python before and much less used Django. However, the switch was easy enough since Ruby and Python are somewhat similar.

    My experience with Python and Django was great; it is a combination every web developer should consider. However, I soon missed Ruby and Rails. Ruby supports “real” private/public/protected methods (Python just fakes that with its naming convention) and it’s syntax is more forgiving (the need for () at the end of each method call in Python was killing me). Django is not as straightforward as Rails, and requires more code to get things done. There are also many little things that don’t “feel right” in Django, like the need to manually pass variables to a view. Data access is confusing at best while Rails’ ActiveRecord is god-sent. These little things really add up.

    On the flip side, Python is faster than Ruby and less memory hungry. I was also surprised to actually love Python’s significant indentation (see example). But more importantly, Python and Django just worked! I never experienced weird crashes like I did with my Rails stack.

    So, why am I back to Rails for my next project? 3 letters: FUN. I find Ruby and Rails to be pleasant to use. The community large, active and very helpful. The number of freely available Rails plugins and the fast evolution of the core code are also welcomed additions. Rails requires less code, less self.__awkward_method_calls(), has built-in AJAX and REST support, and has much more flexible data access and templating engines.

    But what about those crashes? What about the speed issue? Well, I don’t have the crashes anymore. Don’t ask me why, I don’t know, but it’s fine now, I swear! Something somewhere got fixed and it seems to have solved the problem. However, speed is still one of the low points of Rails. Using caching and proper code optimization should take you a long way, though. Matz, the author of Ruby, is working hard on a new virtual machine that should make Ruby just as fast, if not faster than Python.

    My recommendation is, try both for long enough to figure out what works and what doesn’t for you. If you are a long-time Python user, Django might be more compelling for you, but if you are coming from a Java, Perl or Smalltalk background, Ruby and Rails will most likely be what you’ll end up using. Either way, I don’t think you can go wrong.

    PS: I don’t want to blame Mongrel for my Rails problems because I am still not sure who was the guilty party. Mongrel is a wonderful piece of software and I heartily recommend it. Just make sure you watch it closely if you use Ubuntu on a 64 bit machine.

    posted on 2008-11-21 10:46 周銳 閱讀(515) 評論(0)  編輯  收藏 所屬分類: PythonRuby and Rails
    主站蜘蛛池模板: 亚洲情a成黄在线观看| 亚洲av无码成h人动漫无遮挡| 日韩免费高清一级毛片| 亚洲中文字幕无码久久精品1 | 精品特级一级毛片免费观看| 在线亚洲午夜理论AV大片| 91免费在线播放| 四虎国产精品成人免费久久| 老色鬼久久亚洲AV综合| 国产区卡一卡二卡三乱码免费| 精品国产污污免费网站| 亚洲变态另类一区二区三区| 亚洲av无码一区二区乱子伦as | 国产无遮挡吃胸膜奶免费看视频| 中文字幕无线码中文字幕免费| 激情内射亚洲一区二区三区爱妻| 亚洲国产综合久久天堂| 永久免费av无码不卡在线观看| aa级女人大片喷水视频免费| 国产成人精品日本亚洲网址| 亚洲精品无码mv在线观看网站| 日韩中文无码有码免费视频| 91精品视频在线免费观看| 免费的黄色网页在线免费观看| 亚洲国产成人在线视频| 亚洲AV无码一区二区乱子伦| 吃奶摸下高潮60分钟免费视频| xxxxwww免费| 午夜免费福利视频| 一级做a爰片久久毛片免费看| 亚洲日韩精品国产3区| 内射少妇36P亚洲区| 亚洲精品成人无限看| 亚洲av成人一区二区三区在线观看| 可以免费看黄视频的网站| 免费福利电影在线观看| 国产免费黄色无码视频| 在线观看亚洲免费| 亚洲国产欧洲综合997久久| 亚洲国产福利精品一区二区| 亚洲成人动漫在线|