Youtilize

Read all about technology, web development and creative entrepreneurship

Currently showing 2 posts tagged php

 

Jun 08, 2008
Web development

... at least according to the TIOBE index, which measures language popularity based on the number of web searches:

The ratings are calculated by counting hits of the most popular search engines. The search query that is used is +”<language> programming” The search query is executed for the regular Google, Google Blogs, MSN, Yahoo!, and YouTube web search for the last 12 months. The web site Alexa.com has been used to determine the most popular search engines.

Observations

  • PHP moves up one spot from last year into #4 and still dominates the web languages
  • ActionScript enters top 20 (as #20) and I expect it to grow even more in the coming years
  • Java dominates with 20% market share and sits comfortably at the #1 spot
  • Pascal enters top 20 as well at #15, jumping up eight spots in one year! This one I’m just confused about, but I do miss the language
  • JavaScript and Ruby are #9 and #10 respectively, though over last 4 years, Ruby has risen tremendously (#27 in 2004) with the help of Ruby on Rails

View the rest

 

Jun 01, 2007
Ruby on Rails

Having switched to Ruby on Rails (for now), I was looking for the same functionality as the popular time_since() function and after hours of searching, I found that Ruby has this exact function built in.

No need to download a 3rd party module and add it to your project, simply use:

time_ago_in_words()

time_ago_in_words() does exactly this. Simply pass it a Date or a Time object and it will spit out time since in words. API

distance_of_time_in_words()

This is another cool function I just added to the comment bit. Instead of simply saying how long has passed since comment was added to now, I wanted to say how long has passed after the post was created to when the comment was added. Ex: about 10 minutes after. API

Here’s my code in the post view:

<% for comment in @post.comments %>
  ... stuff here ...
  <%= distance_of_time_in_words(@post.added, comment.added) %>
  ... stuff here ...
<% end %>

Hope these help out. I spend ridiculous amount of time looking for functions like this so you won’t have to :)