Related
I am about to start a new project and I am hung up on which language/framework to use. I've been a PHP programmer professionally, but it wasn't on the scale of this project. I've played around with RoR and i've been very impressed so far. Right now, the two leading candidtates are RoR and Symfony2.
My major hang ups with RoR:
- i don't know ruby, or i hardly do. i can read it ok, but get stuck writing the code.
- i've read complaints about it being slow, and it seems to be slow just at the CLI.
My major hang ups with Symfony2:
- there's practically no documentation for it. Symfony1.x? sure..but not symfony2
- there's also little support. the BB on their site is like 80% spam.
- went to install it on a local dev enviroment haven't been able to even get that running (see my first hang up)
this project will be fairly complex and go beyond the basic CRUD operations. it isn't under a super-tight timeline, but there is one. ~3 months for milestone1 which is basically a calendar, some financial organization stuff (not transactions with financial institutions, just personal finance organization type stuff), and a project manager/cms.
also, i'm open to using other frameworks, but symfony2 seems to be the best right now. if symfony2 had RoR's support/documentation/tutorials/etc it would be a no brainer.
i'm really interested in hearing what the stackoverflowverse has to say on the matter. im constantly impressed with the quality of the answers/replies on this site.
some other sub-questions (that are in my head right now):
- if you recommend a different php framework, why?
- what are you biggest gripes with any of the options mentioned?
i know CakePHP is the closest to RoR, but i've been reading that the models are a bit wonky (Many to many relationships and such).
right now, i'm leaning towards RoR. Simply put, i really want to learn it and it could do the job. i just don't know ruby and i've ready a lot of good about symfony2.
any advice you could offer will be greatly appreciated. thanks!
Personally, I'd recommend that if you're starting a new project which happens to be the largest project you've ever had to do then you should stick with what you know best. This happens to be PHP.
I've used Ruby or Rails. In fact, we have some production apps at our company that use RoR. The best way I learnt RoR was to work on small projects. I would never have considered to choose a programming language which I'm not familiar with and then on top of that learn a new framework to start coding a big project.
As for Symfony2, we started using it a couple of weeks ago. Symfony2 is an excellent framework and looks very promising. It's clean, nicely decoupled and fast. However, we ran into too many bugs/headaches/inconsistencies in Symfony2 to continue using it. We will start working on it again once it has matured and the documentation grows (lots of the docs are now out of date). Hopefully, they'll release some sort of Jobeet tutorial but for Symfony2.
Moving on to CakePHP. CakePHPs code base is old. In fact, it works fine on PHP 4.3.2. It doesn't take advantage of all the goodness that PHP5 has to offer (absract classes, interfaces, private & protected properties, exceptions, magic methods, annotations, pass objects by reference etc.) CakePHPs database abstraction layer, whilst it has had improvements, is not incredibly efficient once your database structures becomes too complex (many joins for example) it crumbles quite badly.
Moving on to Symfony 1.4 which I've used for many large projects
I enjoy using because:
PHP5
Event system
Dependency Injection
Caching system
Forms (nice integration into Doctrine 2) In fact, this is my favourite feature.
Many plugins (sfGuard for user management, for example)
Twig (nice templating language)
Highly configurable
Scalable (although not as fast as Symfony2)
A lot of documentation (Jobeet tutorial is great)
If PHP is for the moment your forte and you need to start working on a large project then start using a PHP based framework as you know the language syntax and functions the best.
Move onto RoR when you have a small project to do.
Just my 2 cents.
Best of luck.
To me Symfony2 has been great so far. Documentation is scarce compared to Symfony1.x but it's much easier to get started in Sf2 and, with things being very explicit, requires less knowledge of how the framework works internally.
There's an app/check.php script that will warn you of any dependency needed to run it, and support mostly happens in their mailing list which is very active (didn't even know there was a BB). Some components, like Twig, also have their own lists.
This is an old topic but things have changed a bit and I would recommend Symfony2. Their current documentation is great (symfony.com) and its much easier to learn for newbies. I did try RoR but with symfony I just got into it much quicker.
I'm amazed of how no one has mentioned the super rich GEM community for Ruby and therefore for Ruby on Rails, there is simply just so much functionality out there, so many people working on some many MIT/open source projects. To me, community is what drives me to go choose one framework over another. The amount of configurations and different template engines, there is just so much out there for ruby on rails.
For a comparison chart check this out:
http://vschart.com/compare/doctrine-php/vs/ruby-on-rails
At the end of the day it all boils down to whatever you know, but do not overlook the community and the functionality that has been written for you already, free of charge...
I'll echo solarc's comments about Symfony 2. I used it for a couple small projects, and am starting something more ambitious with it this week. I would like to see a complete Jobeet-style tutorial, but the main documentation is good enough to get started with IMHO. I'm giving that a thorough read, and have learned a few things that I missed using the documentation as a simple reference.
Finding bundles was my biggest frustration, but the documentation mentions knpbundles.com, and that seems like an excellent resource.
I have some community running Drupal 6. Drupal 6 have great numbers of modules for what I need, plus word "Community plumbing".
I've tried PHP frameworks like Yii, but I dont like PHP-CLI, because I feel that not well integrated with the PHP itself. So, I stay with Drupal 6 with lots of hacks.
But Drupal now become more "CMS", more "Enterprise" (just like lots of Java CMS).
With Drupal 7, out of the box, it easier to make a newspaper site, but to me, it more difficult to tailored to my needs, it more magic, and also slower.
The word "Community plumbing" has been replaced with "Open Source CMS", with statement "Use Drupal to build everything from personal blogs to enterprise applications". This is scares me as community-based application developer.
Django looks promising, but Rails have much more open source kick-ass app avaiable.
I dont know anything about Drupal 8. I dont know what to do for my next development.
It sounds like you are looking to move from a CMS to a framework. I am not going to give advise on frameworks here, since there are numerous topics on SO that cover this already.
A few things you should realize, coming from Drupal, moving to a (RAD)framework are the following:
Drupal is not OO, has its own ways of using PHP (hooks, template overrides) and such. Expect the experience to be very different. Your Drupal-gained-knowledge may come in handy, but is often of little use in framework-land where OO is the alpha and omega. :)
Drupal takes a lot from your hands. By installing some module, you have a new feature. With frameworks you are all on your own in this. You should select a framework that works with gems, packages or modules itself if you want to stand on shoulders of others peoples work. The main difference between these libraries and Drupal modules, is that you will have to implement and integrate the libs yourself. I consider that a very good thing, since it makes no assumptions up front and allows you to build exactly what you had in mind, yet having the same experience as Drupal-modules: many things are already done for you.
You know PHP. You probably don't know Python or Ruby as well. That means PHP-based frameworks have an advantage for you. But read various posts on SO about the downsides of PHP used in Frameworks to see some reasons why learning a new language and environemnt is not all that bad.
All in all, I think you will be surprised byt the increase in development-efficiency when coming from Drupal into a framework.
Make your own CMS in 'just PHP' and go back to being happy and having fun coding all day long :)
More people than you have noticed this behavior of leaving developers that have supported a system for years and years with a take it or leave it option.
It seems all the big companies can do with a product is make it 'bigger'. More convoluted, automated, with more layers of code and less modularity - all in the aim to make 'the ultimate megaglobular ultrauniversecorporate site'. Almost as if small clients with 'just a website' don't exist. Enterprise products belong in the enterprise domain. When you upgrade a non-'do the mightiest world-spanning web site/application' system, you shouldn't get a 'do the mightiest world-spanning web site/application'system.
The bigger system may be able to do more things and be more scalable to large systems, but they leave behind no small, accurate tool to do small and medium jobs quickly and with ease. Also: "Documentation is not scalable" (c) H. Erlandsson. To even find the doItAll() function or even know it exists, you have to wade through increasingly huge documentation. To then learn how to use it correctly, if you don't know all the component the function builds on, you have learn the behavior of many subsystems to understand how to apply some terse declaration to your problem.
The ultimate something can be several refined gems, and not an asteroid-size cluster of crystals.
Was a bit tricky to read out exactly what you're asking, hope I read you right. I can recommend some programming system gems, but they are not in the web dev domain, maybe others will know a few :)
I am looking to start developing a relatively simple web application that will pull data from various sources and normalizing it. A user can also enter the data directly into the site. I anticipate hitting scale, if successful. Is it worth putting in the time now to use scalable or distributed technologies or just start with a LAMP stack? Framework or not? Any thoughts, suggestions, or comments would help.
Disregard my vague description of the idea, I'd love to share once I get further along.
Later. I can't remember who said it (might have been SO's Jeff Atwood) but it rings true: your first problem is getting other people to care about your work. Worry about scale when they do.
Definitely go with a well structured framework for your own sanity though. Even if it doesn't end up with thousands of users, you'll want to add features as time goes on. Maintaining an expanding codebase without good structure quickly becomes fairly horrible (been there, done that, lost the client).
btw, if you're tempted to write your own framework, be aware that it is a lot of work. My company has an in-house one we're quite proud of, but it's taken 3-4 years to mature.
Is it worth putting in the time now to use scalable or distributed technologies or just start with a LAMP stack?
A LAMP stack is scalable. Apache provides many, many alternatives.
Framework or not?
Always use the highest-powered framework you can find. Write as little code as possible. Get something in front of people as soon as you can.
Focus on what's important: Get something to work.
If you don't have something that works, scalability doesn't matter, does it?
Then read up on optimization. http://c2.com/cgi/wiki?RulesOfOptimization is very helpful.
Rule 1. Don't.
Rule 2. Don't yet.
Rule 3. Profile before Optimizing.
Until you have a working application, you don't know what -- specific -- thing limits your scalability.
Don't assume. Measure.
That means build something that people actually use. Scale comes later.
Absolutely do it later. Scaling pains is a good problem to have, it means people like your project enough to stress the hardware it's running on.
The last company I worked at started fairly small with PHP and the very very first versions of CakePHP that came out (when it was still in beta). Some of the code was dirty, the admin tool was a mess (code-wise), and sure it could have been done better from the start. But do you know what? They got it out the door before their competitors did, and became extremely successful.
When I came on board they were starting to hit the limits of their current potential scalability, and that is when they decided to start looking at CDN's, lighttpd caching techniques, and other ways to clean up the code and make things run smoother when under heavy load. I don't work for them anymore but it was a good experience in growing an architecture beyond what it was originally scoped at.
I can tell you right now if they had tried to do the scalability and optimizations before selling content and getting a website live - they would never have grown to the size they are now. The company is www.beatport.com if you're interested in who I'm talking about (To re-iterate, I'm not trying to advertise them as I am no longer affiliated with them, but it stands as a good case study and it's easier for people to understand what I'm talking about when they see their website).
Personally, after working with Ruby and Rails (and understanding the separation!) for a couple of years, and having experience with PHP at Beatport - I can confidently say that I never want to work with PHP code again =p
Funny to ask "scale now or later?" and label it "ruby on rails".
Actually, Ruby on Rails was created by David Heinemeier Hansson, who has a whole chapter in his book labeled "Scale later" :))
http://gettingreal.37signals.com/ch04_Scale_Later.php
I agree with the earlier respondents -- make it useful, make it work and get people motivated to use it first. I also agree that you should pick off-the shelf components (of which there are many) rather than roll your own, as much as possible. At the same time, make sure that you choose components for your infrastructure that you know to be scalable so that you can go there when you need to, without having to re-write major chunks of your application.
As the Product Manager for Berkeley DB, I've seen countess cases of developers who decided "Oh, we'll just write that to a flat file" or "I can write my own simple B-tree function" or "Database XYZ is 'good enough', I don't have to worry about concurrency or scalability until later". The problem with that approach is that a) you're re-inventing the wheel (and forgoing what others have learned the hard way already) and b) you're ignoring the fact that you'll have to deal with scalability at some point and going with a 'good enough' solution.
Good luck in your implementation.
In my next rails project I'm going to need blogging functionality. I'm wondering whether anyone has any good suggestions, or should I just roll my own? (Probably not in 15 minutes)
I think the most important feature will be to display code samples elegantly.
How's your free time?
Five years, that's how long that little idea took. Plus 2 years of adding bells and whistles. And that, folks, is why I'm giving in and using a blog host. Because I have lots of ideas, lots of things to say and to explore, but only a few dozen years left at best. I can't afford to go chasing every 5-year idea that springs to mind. After due consideration of the crap web frameworks and crap blog packages out there, I decided that I don't want to spend my next 5 years implementing my vision for a decent self-publishing system. Someone else can do it.
http://steve-yegge.blogspot.com/2006/03/blog-or-get-off-pot.html
It's a classic build-versus-buy (or, in this case, download for free) decision isn't it?
Write up the feature set of what you are looking for.
Survey the offerings out there to see how close a fit you have.
For the one or two products that is the closest fit, evaluate whether or not it would be less effort to write your own solution or customize the offering to do what you need.
If all you need is a blog site, then this is a no-brainer. Use WordPress and that's it.
If there are other features for this app and blogging is just one of them, then consider writing an app around WordPress. It is just a PHP application using MySql after all.
If WordPress has features or does things that you don't want, then maybe you do need to roll your own.
If the most important feature for this site is that it is to be written in RoR, then roll your own or find a RoR based blogging app as WordPress is not written in RoR. I haven't really done the homework on this but I would imagine that getting PHP and RoR to share session state would be a time consuming hack.
Rolling your own blog is a great project (and quite fun too!), but for practical usage, using something pre-made is going to be more secure, have more cool features, etc. etc. Unless you're incredibly dedicated, you'll probably end up cutting corners and end up with something that isn't quite what you want.
Despite being a Rails guy myself, I'm a huge fan of Wordpress. If you're looking for Rails-based blog engines, I've had luck with Mephisto, although the documentation leaves something to be desired. Radiant CMS is another CMS/Blog system that might be worth looking at.
A lot of Ruby/Rails developers have actually gone the route of using static website/blog generators. This has a few advantages. First, the pages are static HTML with no dependency on a database. This means they can be served by your front-end Web server (Apache, Nginx, etc.) faster than if they were to go through Mongrel, Thin or Phusion Passenger. Secondly, the pages will be easier for search engines to index. Finally, and probably most importantly, you can easily version control your posts using Git (or your favorite SCM)
I switched my blog over to a static model after development on Mephisto seemed to stall. I am using Tom Preston-Werner's Jekyll and Disqus for the comments. Works great. Give it a try!
If you are just looking for a project, then building your own blog engine is a good start.
Personally, though I have been a full-time Rails developer for the past 3 years, I still use and recommend Wordpress for myself and others.
If the project is to write a blog, don't roll your own. There are plenty solutions out there that will solve this problem for you while you worry about pumping out great content.
You will end up spending to much time futzing with the little things that don't really matter.
Probably there are tons of those.
For example, Rastafari, or Enkiblog.
In my next rails project I'm going to
need blogging functionality. I'm
wondering whether anyone has any good
suggestions, or should I just role my
own? (Probably not in 15 minutes)
I wouldn't recommend rolling your own blog system. You should look into using Radiant CMS with a blog extension.
I think the most important feature will be to display code samples elegantly.
For this I can recommend looking into SyntaxHighlighter.
All depends on your goal:
If it is for learning purposes and it's for fun, code it from scratch. Also, try to add new functionality that you will not find in current blogging platforms. For example, make in a way that is easy for a developer to blog tutorials or screencasts.
If it's for a client or just to blog, use wordpress. You can have your site in ruby and then link to wordpress. Think about it, how many human hours are behind wordpress so for you to match that you will need to work full time on it for 8 years.
Wordpress will work out of the box and then periodically you can tweak it, depending on future needs.
I agree, for fun and learning, code from scratch. But consider coding something people really need and don't already have. Innovate.
There are so many excellent blog platforms out there, and some (like Wordpress) have active developer communities writing hundreds of useful and powerful plugins. And that includes some excellent support for code samples.
No need to reinvent the wheel.
Let's say that you have to implement some functionality that is not trivial (it will take at least 1 work week). You have a SDK/API/library that contains (numerous) code samples demonstrating the usage of the part of the SDK for implementing that functionality.
How do you approach learning all the samples, extract the necessary information, techniques, etc. in order to use them to implement the 'real thing'. The key questions are:
Do you use some tool for diagramming of the control flow, the interactions between the functions from the SDK, and the sample itself? Which kind of diagrams do you find useful? (I was thinking that the UML sequence diagram can be quite useful together with the debugger in this case).
How do you keep the relevant and often interrelated information about SDK/API function calls, the general structure and calls order in the sample programs that have to be used as a reference - mind maps, some plain text notes, added comments in the samples code, some refactoring of the sample code to suit your personal coding style in order to make the learning easier?
Personally I use the prototyping approach. Keep development to manageable iterations. In the beginning, those iterations are really small. As part of this, don't be afraid to throw code away and start again (everytime I say that somewhere a project manager has a heart attack).
If your particular task can't easily or reasonably be divided into really small starting tasks then start with some substitute until you get going.
You want to keep it as simple as you can (the proverbial "Hello world") just to familiarize yourself with building, deploying, debugging, what error messages look like, the simple things that can and do go wrong in the beginning, etc.
I don't go as far as using a diagramming tool sorry (I barely see the point in that for my job).
As soon as you start trying things you'll get the hang of it, even if in the beginning you have no idea of what's going on and why what you're doing works (or doesn't).
I usually compile and modify the examples, making them fit something that I need to do myself. I tend to do this while using and annotating the corresponding documents. Being a bit old school, the tool I usually use for diagramming is a pencil, or for the really complex stuff two or more colored pens.
I am by no means a seasoned programmer. In fact, I am learning C++ and I've been studying the language primarily from books. When I try to stray from the books (which happens a lot because I want to start contributing to programs like LibreOffice), for example, I find myself being lost. Furthermore, when I'm using functionality of the library, my implementations are wrong because I don't really understand how the library was created and/or why things need to be done that way. When I look at sample source code, I see how something is done, but I don't understand why it's done that way which leads to poor design of my programs. And as a result, I'm constantly guessing at how to do something and dealing with errors as I encounter them. Very unproductive and frustrating.
Going back to my book comment, two books which I have ready from cover to cover more than once are Ivor Horton's Beginning Visual C++ 2010 and Starting Out with C++: Early Objects (7th Edition). What I really loved about Ivor Horton's book is that it contained thorough explanation of why something needs to be done a certain way. For example, before any Windows programming began, lots of explanation about how Windows works was given first. Understanding how and why things work a certain way really helps in how I develop software.
So to contribute my two pennies towards answering your question. I think the best approach is to pick up well written books and sit down and begin learning about that library, API, SDK, whatever in a structured approach that offers real-world examples along with explanations as to how and why things are implemented as they are.
I don't know if I totally missed your question, but I don't think I did.
Cheers!
This was my first post on this site. Don't rip me too hard. (: