Could Rails be used to make a Digg-like site?

In no am I actually trying to make a digg-like site, it just serves as
a good example for this discussion. (And anyways, there’s pligg,
which is an open source cms that’ll install a digg-like site in a few
clicks)

I’m actually just trying to decide which framework to use (rails or
cakephp). I know that twitter uses rails, but honestly that’s the
worst website on the net. Not twitter itself, but the actual default
itself. It’s almost completely useless, and something like tweetdeck
is a must. Also, I do know that hulu uses rails, and I guess if it’s
good enough for a mulimillion dollar joint venture between a couple
mulitbillon dollar corporations, then it should be good enough for
me. However, digg uses php, and I wasn’t sure if all the
functionality would be able to implemented using rails.

All of the rails vs (cake)php comparisons are quite dated, and I’m
still undecided. Yeah, I know, just pick one, I probably can’t go
wrong. I just don’t want to find out a few months from now that I
made a mistake using rails, and have caused myself a lot more
headache.

Any insight is greatly appreciated.

A digg-like site could be made with ruby, php, python, etc, they all
have web libraries, and rails isn’t the only good ruby web framework by
a long way (there are lots - merb, ramaze, sinatra etc). Digg is
basically a CMS (where the content is web links and comments) and so
rails is well suited to the job, since rails was designed as a cms
engine, ie a web interface onto a database.

For my degree project a couple of years ago i did a site inspired by
Reddit, which is a similar sort of site to digg, rails made it easy.

You not liking twitter has nothing to do with rails - it sounds like
it’s the design of the site that you object to. I don’t think you could
really notice, as a twitter user, if it was made with cakephp or django
instead.

It’s good that you mention twitter though because an early complaint
directed towards rails was that it didn’t scale easily - a problem most
clearly seen in twitter, which really struggled to cope with its success
when it started to take off. This was partly due to the decisions of
its creator though, who initially used not just a single database but a
SINGLE TABLE to track all of the activity on twitter. As far as i know
these scalability concerns have been addressed though, and there are
some sites with huge amounts of data and traffic (eg yellowpages.com*)
which use rails.

*i just checked and yellowpages.com is down! hahahahahaha :slight_smile:

Yeah, that’s what I figured: Almost any language could be used.

I just wanted to use the easiest and best to do so, and I wasn’t sure
if those were the same. It seems like rails would be easier than php,
but that’s a framework to language comparison, so I didn’t know if
cakephp (or some other iteration) would actually make php a better
choice. Yeah, twitter’s had some scalability issues, but honestly any
site with that much explosive growth would probably buckle, no matter
the language used.

I guess my real question is: who has the better community, rails or
(cake)php? There seems to be a lot of hype around rails right now,
and it may be justly deserved, but I don’t want to get 6 months or a
year into a project and get stuck. I am leaning towards rails for its
ease of use (but cakephp may be just as easy, idk), but a lot more
companies, and a lot more programmers use php. Should I pick php for
that reason?

On Jul 23, 4:40 am, Max W. [email protected]

Given that CakePHP is one of several PHP frameworks directly inspired
by Rails, I’d say you’re better off with the original… :slight_smile:

Although I may be biased, as I’ve encountered far too much remarkably
bad PHP code.

–Matt J.

Yeah, I just didn’t know if php’s community would be better for a noob
like me. Both seem pretty well documented, but php is far greater in
popularity (probably because its been around longer? and sites don’t
want/need to switch).

Like I stated in my above response, I guess what I’m asking is which
has a better community?

Just running a quick search on google, I didn’t find any rails forums
that seemed all that active.

PHP has been around longer. However, Ruby is a much better-designed
language than PHP.
Yeah, I didn’t know if cakephp made php more of a competitor, since it
is somewhat of a rails clone. Didn’t know if I might should stick
with php because if it, but I think I have decided to give rails a
go. Thank you guys.

Um, WTF? The Rails mailing list – where we are right now – has
18883 users and lots of activity.
I guess what I mean is that the forums seem pale in comparison to
something like the joomla.org forums. Also, why doesn’t the
rubyonrails.org site have any official forums? It seems like such a
good place to house such a thing.

By the way, Patrick Lenz used a Digg clone as the main example in his
Rails book. Although I don’t recommend the book, that certainly
addresses your original question.
Thank you for this for this suggestion. It still might be good to
read for me, since I’m just starting out. Why don’t you recommend it?

What books (ebooks, or anything) do you recommend? I think I’m going
to buy the Agile Web D., Third Edition. It’s a must have
right?

Thank you for your help.

On Fri, Jul 24, 2009 at 1:12 AM, AlwaysCharging[email protected]
wrote:

PHP has been around longer. However, Ruby is a much better-designed
language than PHP.
Yeah, I didn’t know if cakephp made php more of a competitor, since it
is somewhat of a rails clone. Didn’t know if I might should stick
with php because if it, but I think I have decided to give rails a
go. Thank you guys.

CakePHP is like using Rails in twice the time. The PHP syntax makes it
extremely time consuming even if it is using the same basic premise.

Andrew T.
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings

On Jul 23, 4:19 pm, AlwaysCharging [email protected] wrote:

Yeah, I just didn’t know if php’s community would be better for a noob
like me. Both seem pretty well documented, but php is far greater in
popularity (probably because its been around longer? and sites don’t
want/need to switch).

PHP has been around longer. However, Ruby is a much better-designed
language than PHP.

Like I stated in my above response, I guess what I’m asking is which
has a better community?

I daresay a higher percentage of Rails developers are interested in
good coding and design practice. (Yes, I know that many PHP
developers are interested in these things too, but it’s amazing how
many of them have switched away from PHP…)

Just running a quick search on google, I didn’t find any rails forums
that seemed all that active.

Um, WTF? The Rails mailing list – where we are right now – has
18883 users and lots of activity.

By the way, Patrick Lenz used a Digg clone as the main example in his
Rails book. Although I don’t recommend the book, that certainly
addresses your original question.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

OH and wrt books - a warning!

I started out with Agile Web Dev like a lot of people. And while it
gives you a great introduction to rails i think it encourages a
particular bad behaviour that’s common in rails, which i call ‘addicted
to the magic’. Rails is a very magical framework - lots of stuff ‘just
works’, and the mechanisms of this working are hidden from the
programmer. This is great for demonstrating how to make a blog app in
fifteen minutes, as DHH famously did, but when something goes wrong, you
are screwed because you’re addicted to the magic - you don’t have the
first principles knowledge needed to get yourself out of the hole. I
really felt myself get bitten by this many times when I was starting
out, since i was learning rails first and picking up ruby as i went
along, which is the wrong order. Walk before you can run, right?

Now, i’m not saying that rails itself is bad because of this. I’m
saying that it’s bad practise to jump straight into rails without having
an understanding of ruby. And i’m not saying that Agile Web Dev is a
bad book either - it’s a great recipe book and a great walkthrough of
how rails works. But, i’d actually recommend, for a beginner, Ruby for
Rails by David A Black (a frequent contributor to this forum): it will
give you a better understanding of what you are really doing.

Even now i answer questions by people who don’t even understand the
client-server paradigm: ie, that rails runs on a server and sends
standard html back to web browsers which have no knowledge of rails.
People ask things like ‘how can i get rails to refresh the page when the
user does something’ - as if it was a desktop app. So there’s a lot of
people making rails apps who don’t really understand what they’re doing.

Again, this isn’t a reason to not use rails - people fall into this trap
because it’s so good at what it does. It’s just a warning to someone
who looks like they’re about to start down the rails road.

Anyway, good luck, and have fun. Oh, and look at some other web
frameworks besides rails! It will broaden your horizons. :slight_smile:
max

PHP has been around longer. However, Ruby is a much better-designed
language than PHP.
Agree completely. It’s not about rails vs php, it’s about ruby vs php.
Ruby is a very friendly language. Rails has also made it very popular,
which means there are many advantages to using it, such as support and
work availability. Php is still here and will be for a while but it’s
kind of horrible. Most of the php work i see is in hacking wordpress
sites. Do not want. I have no experience of cakePHP but it sounds like
a rails clone done in a painful language, with a smaller community.

Um, WTF? The Rails mailing list – where we are right now – has
18883 users and lots of activity.
See also http://railsforum.com which caters more to the
new-to-rails-and-ruby end of the community. i tend to ask on here and
answer on there :slight_smile: There are also a myriad of mailing lists devoted to
specific ruby gems. I’m on backgroundrb, ferret, ramaze, to name but a
few. Generally speaking there is a TON of support before you even get
to the IRC channels, which i tend to save for when i’m desperate.

On Jul 24, 4:10 am, Max W. [email protected]
wrote:

PHP has been around longer. However, Ruby is a much better-designed
language than PHP.

Agree completely. It’s not about rails vs php, it’s about ruby vs php.
Ruby is a very friendly language.

So is PHP – so much so that it tends to attract people who don’t
really know how to program, which is probably what gives it its bad
reputation. It is quite feasible to do decent coding in PHP that
doesn’t hurt to read or maintain.

However, Ruby is a better language than PHP, and I’ll take Ruby over
PHP any day if I have the choice.

Rails has also made it very popular,
which means there are many advantages to using it, such as support and
work availability. Php is still here and will be for a while but it’s
kind of horrible. Most of the php work i see is in hacking wordpress
sites. Do not want.

That’s the fault of WordPress, then. Don’t blame the language for the
framework.

I have no experience of cakePHP but it sounds like
a rails clone done in a painful language, with a smaller community.

PHP isn’t “painful”, at least if you do it right – it’s just not as
well designed as Ruby. I haven’t used CakePHP either, but CodeIgniter
(another Rails-inspired PHP framework) is really well thought out, or
so it seems from the little bit that I’ve done with it.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Most of the time for me, personally, it is a matter of resources. If
the client wants me to build a project on top of their existing
hosting infrastructure it primarily ends up being something in PHP.
PHP has a much broader install base than Ruby and Rails so I can
always count on having it installed on the client’s server.

I agree that most of the PHP code out there in the wild is garbage,
but I have to blame the authors and not the language itself – you can
write PHP code that is clean and encapsulated. While Rails is highly-
opinionated – it strongly guides you to use the “Rails Way” – you
can write garbage Ruby code just as easily as you could write garbage
PHP or Python code. And as one commenter points out, Twitter learned
this lesson the hard way…who in their right mind uses just one table
for a web app? Do we blame Rails or the developer?

My position on this subject it that if you have the resources to do
something in Rails then you can quite often get something up-and-
running in much less time than a comparable PHP app. Frameworks like
CakePHP and CodeIgniter do have some conventions in common with Rails
– namely an MVC architecture – but the similarities end there. I use
CakePHP or CodeIgniter when I have to work in PHP. I use Django when I
have to work in Python. And I use Rails when I want and/or can use
Ruby.

Given a choice I would choose Rails or Django almost every time. But
PHP can be useful too depending on the context. “Know your land, know
your prey.” :slight_smile: