Related
I don't mean to be controversial. Close if you see fit. But I've got to choose the best way to update my Intranet that's in Classic ASP. I've looked at umpteen framework, still looking and learning, but undecided. I know that PHP is still being updated and is a fine language, but I was thinking. If I wanted a framework couldn't I create and MVC framework with Classic ASP? I'm sure I probably could but that's not the point. I thought...I could do this or I could create pages with PHP with no framework and where would I be? Right back with the same predicament with Classic ASP, only a different language. This makes me think that PHP could be "dangerous" in my enviornment where everyone may not understand or "believe" in MVC. PHP would lend itself to the cowboy coding and mixing of layers quite easily. After all it's pretty easy to fire up notepad and just code without having to worry about layers and layers of "stuff."
My question: Is this true of all the platforms and languages? Are there any that are designed in such away that it would be pretty hard to fall back into the evil ways? The only thing I can see is one, ASP.NET MVC. It'd be pretty hard to start in that and end up not using it. Java EE 6. I don't know. I know Java has been pretty MVCish from long ago.
Thank you for any thoughts. I don't need to be lectured on MVC goodness. That's not my point. I just had an observation and wanted thoughts on how to keep my project MVC.
Just for the record. Nowadays, Classic ASP also have a lot of Frameworks including MVC ones like ASP Xtreme Evolution, Ajaxed, Troika.ASP and a lot more. There are good things in Classic ASP just like in any other language, as there are terrible things written in Java, Ruby, Python and probably in all languages. Before throwing yourself into a new enviroment, I would recommend you to read ASP a misinterpreted technology to notice that Classic ASP has a lot of good parts, including the Javascript ones!
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a heavy web dev background with PHP. My reasons for learning a functional programming languages are:
to improve my programming skills. It was heavily suggested that learning a FPL helps. this has high priority because I want to be better and better.
learn a general purpose programming language to solve tasks like scripting (OS scripting, text manipulation etc..)
to be used as an alternative for PHP in web development.
Also which has the better community support, tutorials and books and the better web application framework?
Feel free to suggest other languages.
For functional languages, learn both Scala and Clojure. You'll learn new ways of thinking from both of them. Go learn some Reia and Erlang while your at it too.
Seriously, the more languages you have under your belt, the better off you'll be as a programmer regardless of the language you end up using.
Rant: "What language should I learn?" questions are getting tiresome. The answers should be the same every time, yet no one gives the correct sage advice. Instead, everyone spreads FUD and suggests that the language they happen to use for their day job is the one you should learn. Poppycock.
I've tried both Scala and Clojure recently, based on similar motivations. Here's what I found:
Scala is enormously versatile and powerful; Scala lets you define types with great precision and it allows you to define DSLs that are terse and clean. Scala has a lot of cool constructs that one wishes Java had, including a bunch of functional extensions. But when it came right down to it, I ended up coding imperative Java in the Scala language because the complexity of all that cool stuff overwhelmed me.
I did some Lisp back in University, and always had a hankering to get back to it again. Some really cool cutting-edge stuff is done by very smart people in Lisp, and in very few lines. I wanted to be one of those smart people, or at least try to be like them. But I never really understood Scheme, and I missed my "infinite supply of libraries" from Java. I couldn't see myself writing a GUI in Scheme, and had trouble envisioning a Web application.
Then I tried Clojure and it seemed like everything clicked into place. Clojure was intentionally made more outsider-friendly: There is an attempt to cut down on the parentheses and to use different parenthetical punctuation for different situations. Treating things like arrays, text and XML as sequences, combined with a powerful set of sequence functions, made a lot of problems quite simple, as does the support for arrays and hashmaps. It's (intentionally) like functional Java. The functional mindeset takes a bit of getting used to, but nowhere did I find it as approachable or as enjoyable as in Clojure. My code hardly needs loops any more, yet it's more clear about where it's looping/sequencing, and more concise. I can do mutable state if I really need to, but I have to be explicit about it; in exchange, that state is protected by Clojure's concurrency mechanisms. Concurrency, then, becomes almost a no-brainer, sometimes my code executes safely in parallel with no conscious effort of my own.
Not coming from Java, this will not seem very useful to you, but Clojure can do anything that Java can, including fully compatible .class files. Most importantly, it can interface with all Java libraries, and that ability alone will make PHP seem like a toy language to you.
My suggestion is to learn JavaScript.
I mean, really learn it.
Here's what a self-professed Clojure advocate has to say about Scala. Make up your own mind, of course, but you may find his perspective useful.
Scala Vs Clojure — Let’s get down to business
Scala vs Clojure — Round 2: Concurrency!
You may also be interested in what he has to say about PHP vs Clojure.
That's a very difficult call. Personally, I think Scala is more useful as a general language for web developers. There are many web frameworks for it, or adapted to it. On the very quick&dirty side, for instance, there's Play. On the full-fledged with excellent Comet support side, there's Lift.
But you talked about learning to program in a functional style. In that regard, there is no way Scala can compete with Clojure. Scala can be used in a functional style, but it makes sure you don't have to. With Clojure, on the other hand, doing anything but functional style is painful.
So, if you want an alternative to PHP, I'd bet on Scala. If you want to really learn functional programming, Clojure.
Finally, let me state that I do not think Clojure isn't a general purpose language, or that it can't be used for web development. I just think Scala is more on both regards.
Get a bag of cement, harden up and Learn You a Haskell, for Great Good!
It's purely functional, so you cannot fall off the ship.
It's general-purpose with loads of libraries (including a web application stack), and no VM startup time penalty (JVM languages are not great for OS scripting and the like, since you have to start the JVM every time).
Jumping form PHP to Scala or Clojure is going to be a huge culture shock. PHP is very focused on quick/dirty getting things done (or 90% clean with the last 10% dirty (-:), whereas functional programming languages force a certain correctness and abstractness onto your thinking. Before you get to Scala or Clojure, you're going to want something inbetween. If it was me, I'd
Pick my final target as Clojure, since (as I understand it) you get the entire Java standard library with Clojure, making it immediately more useful than something pure like Scala
I'd spend some time building something in Java, just to get a feel for a strongly typed OO language. I picked Java over C# (or even ZendFramework style PHP) because it will prove useful once you arrive at Clojure. Google Web Tools might be a good place to start with this. It's kind of web development, but very very Java like and not at all PHP/HTML like.
Spend some time looking at the guts of jQuery, and either develop your own jQuery module or add a core feature. This will get you used to the functional way of thinking, while applying it to a problem you're familiar with.
Final bit of advice: Try to embrace the common methods of the language/platform you've chosen. Don't try to bring your style of PHP coding to either language. Although it will seem easier at first and let you get some kind of results, you'll miss the point of the exercise, which is to think differently and more broadly about problems.
Good luck!
If you are looking for a good alternative for PHP, I suggest Python and Ruby. If you need a Functional language with good support for web development - learn Erlang. Here are some projects/frameworks that will help you create highly scalable web applications in Erlang:
Yaws - An Erlang webserver particularly well suited for dynamic-content webapplications. (Also see this Apache vs Yaws benchmark)
Erlyweb - A component-oriented web development framework written in Erlang and designed to work with Yaws.
Erlang Web - The Erlang Web is an open source framework for applications based on HTTP protocols, giving the developer better control of content management.
Nitrogen - An event-driven web framework for Erlang.
It is also one of the few languages that is specifically designed for building fault-tolerant, distributed software.
While it gets less press coverage than Clojure and Scala, I'd really recommend you to take a look at Fantom: http://fantom.org/
It's like the best of all both worlds and really should deserve more attention.
I'm a new convert to Clojure. It's making me expand my mind but it's approachable enough to be fun and productive. I'm a happy customer.
But
PHP and Clojure live in different universes. I've had some introductory dabbling in FP languages, and a few false starts into other Lisps before embracing Clojure. For a less experienced developer coming straight from PHP, Clojure might be too much of a culture shock.
As a reasonable compromise between the two, and a language that is scripty enough to let you approach FP on a gradient rather than a plunge, I recommend Ruby. Ruby is modern, clean and elegant. In its JRuby incarnation, it's even fast. Learning Ruby and playing with Rails is enjoyable and instructive.
Though Scala is my favorite language for now, i think it's not the best choice to learn FP. It's mainly OOPL with good support of FP. I would suggest to start from Haskell to quickly dive into FP. You will learn how the following concepts of FP work (which are not just supported, but enforced and ubiquitous in Haskell):
1) powerful static type system with type inference
2) lazy evaluation
3) side-effect free computing
After dynamically-typed "pragmatic" PHP and pure functional "academic" Haskell you will have quite full picture of programming languages landscape.
My $.02 is to check out Perl. I may sound like a geezer, but keep in mind that Perl has CPAN (http://cpan.org) and many very, very helpful online resources.
Ruby is probably the most "functional" mainstream language that's also good for scripting. Python is a close second, but ruby's habit of implicitly returning the result of the last expression in a function/block is the tiebreaker for me.
Both have excellent web frameworks (Rails and Django, respectively), and both will definitely broaden your horizons after programming PHP. At the same time they will allow a lot of opportunity for incremental learning.
Neither of them use S-expressions and both allow imperative programming, so there won't be anything to force you to give up the imperative style cold turkey.
Finally the much-lamented TCL is basically Scheme as a scripting and extension language. I'm not sure where it's at these days, but the ArsDigita Community System was written in TCL.
Web development depends ENTIRELY on: First, the quality of the web-framework and second the tools for development. I do not know why you want to move to functional languages for programming web applications.
Python allows some functional constructs for programming and it has frameworks and tools. Lua allows the same level of functional programming and it does not have either high quality frameworks for web development or tools, however its simplicity/primal-nature is its elegance.
Now as a puritan I'd say look at haskell, but that is counter-productive :D,. You my friend are looking for Python. I have not evaluated Ruby, but it might have some functional constructs.
May not appear so fancy, but I strongly suggest JavaScript.
A lot of years ago I was strong at PHP development, but then switched over to Java, C#, C, Objective-C. During my Java time I stepped deeply into JavaScript and did some pretty cool things with it. Someone I know developed an entire client-side temporary lightweight DBMS. Just have a look at Ext.js what they do with JavaScript. It's so underestimated, but doesn't deserve it. I suggest you google for "Douglas Crockford Video". At Yahoo he has created several excellent presentations about JavaScript, also I suggest you get the book "Javascript - The Good Parts" from Douglas Crockford, and "JavaScript - The Definitive Guide". Both the best JavaScript books available. And you'll be amazed what's possible and what a beautiful language it actually is. In fact, you can do AI with it, it has Lambda, there's actually nothing really "cooler" than that! What a pitty it's only used for clientside scripting. Few people know JavaScript can be used for serverside programming as well, but that's really rare / not well documented.
And thanks to Adobe Air you can bring JavaScript to the Desktop.
It would be an optimal addition to your PHP knowledge. It's always good to do related stuff. You can be the best Web Developer, or the best Desktop Software Architekt. But our brains are too slow to grasp all proffession needed nowadays to be the Guru in multiple directions. Beeing the Guru is essential for success, I think. Some friends of mine just do one thing: Beeing the Guru. They study their entire life one small subject and are extremely successful. They earn 5 times as much as any I-can-do-it-all-but-know-just-5%-in-this-topic-Developer in a quarter of the time only.
So I also suggest: Write a 600 pages PHP book before you forget your PHP knowledge while doing something totally different.
I did forget almost everything I knew about PHP and JavaScript, but in those early days I definitely was one of the expert guys who showed others a lot of stuff. Now it's a pain I have to ask so many basics again to recall them in my tiny brain. By writing your book, you'll recall your PHP expertise very fast even after a few years of doing something different, because it's your book, fitting your brain, from your brain. And you'll not loose your PHP-expert status even after several years of doing something else.
Good luck.
I tried Scala and found it a bit much (huge amount of operators that you have to recall how to use). But that could just be me. I've heard that Clojure is more functionally pure and closer to Lisp, but haven't checked it out.
F# is Microsoft's take on functional languages, you may want to check it out. I hear it has been used for several projects in industry.
I would suggest learning languages that have frameworks beyond the web front end such as Java EE (Java EE[JSP/JSF] + Java) or .NET (ASP.NET + C#, etc.). That would give you a bit more leeway with your career options, and you would be able to connect server components to a web front end with (relative) ease.
I'm reading The Pragmatic Programmer and I'm on the section where the authors suggest that we learn a new language every year. I'm currently a PHP developer and I'm wondering, what should I learn next?
I'm looking for a language that will help me improve my skills and help me with my daily tasks. Something useful.
Any suggestions?
[Edit]
Awesome answers guys! Thanks.
I'm still contemplating your answers and I'm leaning on studying Python or a functional prgoramming language as you guys have suggested (maybe Lisp).
Going for the option of learning something new, rather than something a bit like what you have done before.
C++ or C
A low level language that requires manual memory management and teaches you how things work at a lower level. Good community base and is one of the languages that a programmer should learn.
I would suggest one of these over assembly as although assembly is even lower level it is pain to produce a project. Learning a language like C or C++ will have the bonus of allowing you to learn assembly very fast if you ever want to do it, as there are relatively few new concepts compared to going from Java to assembly.
Haskell
A purely functional language that totally changes the way you look at some problems. It takes a lot of effort lean if you are already used to a imperative style of writing code.
It has the great advantage of teaching you the joys of recursion, and even if you are never payed to write a line of Haskell it should impact the code you write in other languages, allowing you to see better and cleaner solutions.
Java or C#
If you don't use PHP in an Object Oriented way (Not just using classes, but features like inheritance as well), then these languages force you to write in a OO style. I wouldn't recommend these if you are happy with OO programming.
Python and Ruby seem to be a relatively painless transition to/from PHP.
I'd go for Java or C#, so you learn something that is not another scripting language.
JavaScript.
And I mean really learn it, not just "enough to get by" the way the trend seems to be. I've seen otherwise-great (on the server side) web developers that can waste 2 days on a trivial JavaScript problem because they don't understand it at all.
I don't think there is a language that a developer will come across more often than JavaScript, and when you need to use it, you need to use it: you won't have the freedom of picking some other language to run on the clients browser. The good news is that it shouldn't take very long to grasp when compared to some other programming languages.
A good place to start is with JavaScript:The World's Most Misunderstood Programming Language
I believe it would be strongly beneficial for you to try and pick up on one of the popular functional programming languages as they require a completely different mindset and methodology for solving problems. They really allow for you to program elegant yet minimalistic solutions to difficult problems. Some of the more common languages include:
Erlang
Haskell
Lisp
Whilst I agree learning a new language is a good idea - make sure you are learning them and not just collecting them. For example - I come from a Java background and I keep catching myself writing in other languages in the way I'd write something in Java and not taking advantage of the new language's facilities. I'm sure you wont - but just be aware that it's a natural thing to do so keep an eye out for if you start doing the same!
As for which I'd learn; I'd second learning Ruby (plus optionally Rails if you want to do web apps) - it's a very nice language and quite an easy transition from PHP. The "Pickaxe" book from pragmatic programmers is a good place to start.
If you have access to a Mac - I very much recommend learning Objective-C and Cocoa. I certainly learnt a lot by studying these - I think more than any others I felt that understanding these made me a better all round developer. As for books - start with Kochan's "Programming in Objective-C" for the language side, then progress on to Hillegas' "Cocoa Programming for Mac OSX" for the GUI side.
Good luck!
I started off learning PHP after C. Then I discovered Perl and I never looked at PHP again. The reasons? Perl, like PHP, was dynamically typed, but far more modular. The Camel book about Perl was a delight to read. Running a Perl script from the command line was far quicker than PHP which needed all possible libraries loaded - Perl permitted me to choose what extra functionality I wanted at run-time keeping simple scripts light-weight. The Perl community is relatively advanced compared to other languages. The Perl language lets you program in a variety of styles, from procedural, to OO.
Functional languages seem to be gaining interest I'm planning on looking at F# primarily because I'm working with the Microsoft stack most at the moment.
I'd also recommend looking at topics that aren't language specific such as improving OO skills, using design patterns, and anything else that helps refine your skills as a developer to make you more of a craftsman rather than collecting languages that you won't get to use on substantial project and therefore will never really master.
Python + Django if you want to stay in scripting.
C if you want to understand how it works behind the scene.
C (as in C, not C++) would be my suggestion. It will instantly make you appreciate just what interpreted or higher level languages actually do for you (or save you from, depending).
It is also the first logical stepping stone to C++, though I know a lot of people who just dived into C++. Learning C first will (as above) either make you appreciate, or hate C++ even more.
To be a really well rounded programmer, you need to deal with managing types on your own, as well as managing memory without the safety net of a garbage collector. It used to be that those two were prerequisites for being a programmer at all.
Besides, think of all the fun you could have writing your own PHP extensions :)
This could turn into a debate.
My suggestion is to learn a new language that has something to do with your existing skills.
My "first language" was C, which brought me to C++ and Visual C. When I took on consultant jobs I enter the realm of PHP.
Starting from here, I am collecting skills in Javascript and jQuery, since they are tightly coupled with PHP. (DOM, CSS, and HTML aren't languages, so they don't count here.)
Or maybe you want to take another direction and go for SQL.
Choices is yours and crossroads are everywhere.
Not sure if you are programming PHP under the MVC model? But if you are not that is another good methodology to learn.
Examples: Zend or CakePHP
It totally depends on what you want to do. I don't think anyone can say what you should learn next, but rather share you with our experiences that will help you make your mind. After all, the decision for your next language should be based what what kind of applications you want to develop (desktop, mobile, web, etc).
I'll share you with my experience. I used to be a PHP programmer and I faced the same question, what do I want to concentrate on. I ended up to learn Java and I've been happy with my choice. Here are some of the reasons why I think it was a good choice
Java is a widely used language in the corporate world. This means that with good Java skills you'll be likely to find (more easily) a (better) job, more so than with Python or Ruby skills (disclaimer: this can of course vary between regions and countries, this was the case in my area)
I had done lots of web sites and applications with PHP and I've loved the web as an environment. Still, I felt that PHP wasn't quite the language to create full blown enterprise applications - that was something I also wanted to do - to be part of making large enterprise applications. Luckily, with tools like GWT or Vaadin I've been able to create enterprise applications which run in the web environment - all in Java. That was like a win-win for me, I was able to create large software for the web.
Java has forced me to think more Object Oriented, something I've benefited when writing PHP as well.
Java is multi-platform, so it is easy to write applications for linux/mac/windows or even for mobile devices (Java ME)
My two cents.
It depends on your motivation for learning the language.
If you want to learn a new language to do your day-to-day work more effectively I would suggest Python or Ruby. They are popular languages that are both highly productive to work in, and can be applied to a wide range of programming tasks. As someone else has pointed out there are versions for both the JVM (Jython and JRuby) and for .Net (IronPython & IronRuby) so if you want to learn either of those platforms they are a good way to start. They are also both easy to learn and fun to use. My preference is for Python, but that is probably because I have been using it for many years.
If you want to increase your employment options then go with the most popular languages used in business - this means either Java or C#.
If you want to expand your mind then I suggest a version of Lisp. I recommend Clojure - it is a dialect of Lisp that runs on the JVM and gives access to all the Java libraries. There is an excellent introductory book in the Pragmatic Programmers' bookshelf.
JavaScript (preferably through jQuery and Ext.js)
RegExp (preg_match flavour)
SQL (MySQL, PostgreSQL, SQLite dialects)
XSLT (and XML)
Each is very different. Each serves different purpose and each is very useful for PHP web developer.
If you want to try something different I'd go with
ActionScript (great opportunities)
C# (great IDE)
Python (complex ideas, misleadingly simple syntax)
Rebol (fun of having strange constructs work flawlessly on first guess)
Lisp.
(Or some other functional language.)
I coded in PHP for years and then took a (functional) Lisp class. It was four weeks of wtf %#f pain and then pure joy. Understanding functional programming, and especially recursion, really gives you and edge when coding PHP (or any other solution-oriented business language).
I am a capable programmer and I write software for a living. I am taking up a new project to build a website that has a bunch of forms that perform CRUD operations on a database and some multimedia. I am very familiar with PHP and Python and have written some websites in them. I have written some rake tasks and a few ruby scripts that run in production, but I never wrote any websites in ruby. I am considering using Rails, but I have the following questions. It would be great to know the answers to any/all of these:
The project should be done in a month and is very time sensitive. Is 1 month enough for learning with and building a website in RoR?
Writing direct SQL queries is one of my strengths and I would like to use it. I heard that RoR is a pain to use if I am writing SQL queries directly. Is this true? Or can I just say execute a query, give me the results (as a list or dictionary) and then I will tell you how to render them?
I have heard that RoR does joins in memory and doesn't use the facilities offered by the database. Is this correct?
I need to create a website that displays a lot of Images, videos and Java applets. Would RoR hinder my ability to do this?
I am OK using a PHP framework. Is this a bad idea? If not, which PHP framework is closest to Rails in terms of programming convenience.
Answering your questions in order:
You could certainly learn Rails in that time. It's enough time to build a Web site too, but whether it's enough time for you to build your Web site is a different question. I would personally not want to try such a thing on a tight deadline.
You can write your own SQL queries, but there's little point to using Rails if you are going to work around all of its features.
Joins are normally done as part of the database queries generated by ActiveRecord.
Using ROR is pretty much orthogonal to having images, videos, etc. on a page.
I haven't used it, but CakePHP aims to be quite Railsy. Zend and CodeIgniter are more popular and I'm told better by people who have used all three, though.
The project should be done in a month
and is very time sensitive. Is 1 month
enough for learning with and building
a website in RoR?
Given the experience you describe I imagine one month to learn and build a simple-ish app (especially if it is CRUD based) should be enough. If there is a significant level of complexity I would be loath to learn a new technology and deliver a complicated site in one month.
Writing direct SQL
queries is one of my strengths and I
would like to use it. I heard that RoR
is a pain to use if I am writing SQL
queries directly. Is this true? Or can
I just say execute a query, give me
the results (as a list or dictionary)
and then I will tell you how to render
them?
The rails way is to use the ActiveRecord object mapppings it gives you (and mostly these work very well) It is also very easy to write direct SQL if that is what you want to do
ModelName.find_by_sql('your query')
is how you do that
I have heard that RoR does joins
in memory and doesn't use the
facilities offered by the database. Is
this correct?
ActiveRecord does a lot for you, but wherever performance is an issue, as above you can write your own SQL to leverage the advantages of the database.
I need to create a
website that displays a lot of Images,
videos and Java applets. Would RoR
hinder my ability to do this?
I don't see why it should. There are lots of gems and plugins out there which help with this sort of functionality, so it may well be the case that a lot of code could already be written for you.
I am OK
using a PHP framework. Is this a bad
idea? If not, which PHP framework is
closest to Rails in terms of
programming convenience.
I'll let a PHP expert answer this bit.
The project should be done in a month and is very time sensitive. Is 1 month enough for learning with and building a website in RoR?
If it's time-sensitive, stick with what you know.. That said, Rails has lots of plugins to handle things like image-uploads which may save you a lot of time. Rails has "scaffold generators" which create basic CRUD applications in a single command:
./script/generate scaffold title:text description:text when:datetime
..will generate the controllers/views to create/edit/delete items. You can then easily wrap nicer looking HTML around it, add authentication (via restful_authentication), and you may have your completed application in a few hours..
Writing direct SQL queries is one of my strengths and I would like to use it. I heard that RoR is a pain to use if I am writing SQL queries directly. Is this true? Or can I just say execute a query, give me the results (as a list or dictionary) and then I will tell you how to render them?
There's very few situation where you'd need to write SQL with ActiveRecord, but you can. RoR is still Ruby code, so you can always use a MySQL library and do away with ActiveRecord if you really need to write raw SQL (but, again, you almost certainly don't)
I have heard that RoR does joins in memory and doesn't use the facilities offered by the database. Is this correct?
There's no reason ActiveRecord cannot perform JOIN's via SQL queries, the ActiveRecord::Associations::ClassMethods mentions associations being performed via JOIN's.
Besides, even if it does do JOINs through memory, it's worked perfectly well for however long Rails has been around..
I need to create a website that displays a lot of Images, videos and Java applets. Would RoR hinder my ability to do this?
No. They're all just bits of HTML, which Rails can output as easily as any other framework.
I am OK using a PHP framework. Is this a bad idea? If not, which PHP framework is closest to Rails in terms of programming convenience.
Absolutely. If you don't go with Rails, use a PHP framework!
I would recommend against choosing a framework based on "how close to Rails" it is. PHP isn't Ruby. Trying to "port" (in a manner) a framework to a different language rarely works as well as writing a framework for that language.
As I commented on Chuck's answer, "CodeIgniter and Zend are good PHP web-frameworks. CakePHP is a good Ruby on Rails imitation"..
I found CodeIgniter felt much more like PHP (in a good way), it's documentation is also my favourite of any project I've used!
The Zend Framework is very modular, you can drop bits of Zend into an existing PHP app, or use it's MVC routing system.
CakePHP seems to be trying to make PHP act like Ruby, rather than making a framework that fits nicely with PHP.
All that said, the reason you use Ruby on Rails is the community (and thus all the plugins and stuff that revolve around it).
For example, paperclip plugin makes it extremely easy to an image-upload form (along with thumbnailing). To use it you add (to your model):
has_attached_file :photo, :styles => {:thumb=> "100x100#", :small => "150x150>" }
Then in your view, where you want the upload form to be, add:
<% form_for :user, :html => { :multipart => true } do |f| %>
<%= f.file_field :photo%>
<% end %>
That's it.
What I would recommend is spend a day making something simple in Rails. There's countless great tutorials (Railscasts are a good, random, example) and plenty of books on it. See if you like it, if not try CodeIgniter, Zend or CakePHP (or Django, or Merb, or.... Just don't spend the whole month trying frameworks!)
As you have some Python experience have you had a look at Django?
Rails is great for CRUD stuff.
1 - If you're already familiar with Ruby and MVC, a month should be fine. If not, there's a lot to learn.
2 - Rails will let you execute SQL queries, but it's really set up to take advantage of ActiveRecord.
3 - Rails is designed to switch between database types, so ActiveRecord does a lot on its own. Look into ActiveRecord Associations for more info.
4 - Never tried Java applets, but the rest work fine.
5 - If you're more comfortable with a PHP framework it's not a bad idea at all. There are even a few that try to replicate a lot of Rails features, such as CodeIgniter.
Check out RailsGuides for a better idea about all this.
I am OK using a PHP framework. Is this
a bad idea? If not, which PHP
framework is closest to Rails in terms
of programming convenience.
I guess CakePHP is close to RoR for a PHP framework.
I have not tried Rails myself, but wonder if it is a convenience. As far as Ive read (like the guy who spent 2 years making Rails do something it should not) when you need to do something more complex you apparently have to fight and hack the framework.
There are other frameworks for Ruby, PHP and Python. I suggest you look around a bit more before you decide.
If you want to code in PHP you could try Symfony with Zend Framework.
The project should be done in a month and is very time sensitive. Is 1 month enough for learning with and building a website in RoR?
It could be, but it could also make things unnecessarily harder on you. I usually wait for a project with a relaxed timeline to try and learn a new technology. If time is of the essense, bust out your favorite language and get it done.
Writing direct SQL queries is one of my strengths and I would like to use it. I heard that RoR is a pain to use if I am writing SQL queries directly. Is this true? Or can I just say execute a query, give me the results (as a list or dictionary) and then I will tell you how to render them?
I am not a Rails developer, but I do know it uses ActiveRecord. I am sure, however, that there is also a way to make it execute raw queries as most ORM do. Right there however you're going against the grain of what the framework wants you do and you may run into problems.
I have heard that RoR does joins in memory and doesn't use the facilities offered by the database. Is this correct?
Anything that abstracts out things for you, particularly database relationships, is going to be far from efficient. Worrying about it beforehand is usually not necessary, and once your application is finished it is common practice to then identify any particular slow queries and redo them by hand if necessary.
I need to create a website that displays a lot of Images, videos and Java applets. Would RoR hinder my ability to do this?
I have no idea why it would.
I am OK using a PHP framework. Is this a bad idea? If not, which PHP framework is closest to Rails in terms of programming convenience.
CakePHP is by far the closest framework to RoR. It borrows from a lot of its ideas. I have used it with some success in the past. CodeIgniter, while not related to Rails, is also terrific if you want something lightweight that won't force you to do anything its way.
http://www.doctrine-project.org/
I've had great success with the doctrine ORM : if you are writing object oriented php then this does the object->database record mapping for you. AFAIK this is one of the plusses to the django / rails framework.
So this links up the oop/database functionality like this:
$foo = new User(); // makes a new 'transitory' user object
$foo->name = 'bob'; // works like you'd expect
$foo->save(); // but this pushes it into the database.
//(There's a 'name' column in the 'User' table already: set up when Doctrine initializes).
& if you want a framework, it's a part of symfony now.
It's very motivating to have a real project to learn a new technology or approach, but it is possible to take on too much. It'll take 5 times longer than you'd take in the technology you know. Which can be okay - the learning, and the results might be worth it. But doesn't sound like this is appropriate here.
Rails is a great framework, but learning that framework and becoming more familiar with constructs specific to Ruby might be a bit much to do simultaneously with a one month deadline.
To step into a web application framework, I would recommend using a PHP framework if you are already familiar with PHP. While not a port, CakePHP is very much similar to Rails. It is modeled after Rails, and is my favorite PHP framework. symfony is a solid framework, but if you're looking for something more Rails-esque I recommend you try CakePHP.
If you're not already married to using Rails or something like it, I would recommend the Zend Framework. It is by far the most comprehensive web application framework available for PHP.
All of these frameworks will allow you to do all of the things you mentioned. It might be easier to think of them as a select group of building blocks than a comprehensive operating system for your website that you extend with plug-ins. That would be more similar to a CMS like ExpressionEngine. You can do anything with these frameworks, they're simply code bases for you to draw from to make developing web applications less tedious.
The Akelos framework is a PHP framework that purports being a port of Rails, so you might also be interested in that.
As for writing SQL queries, it's possible with any PHP framework, but the idea behind these frameworks is convention over configuration. Each has its own ORM scheme to abstract SQL queries away from the developers. While this might be due to the fact that many web developers, at least in my experience, are terrified of SQL, as someone who also likes writing SQL, I do appreciate the massive amounts of time that an ORM framework can save. Again, when the application is developed it's pretty much standard practice to profile the ORM's performance and look for areas to improve. Rapid-prototyping is a huge part of web application frameworks, so tools like this might actually be a hindrance to you. Like others have said, using one of these frameworks might end up being pointless if you're just going to work around their facilities.
Should you decide not to use one of these, PHP has a plethora of mature projects that will help you build an application, but seeking these out and learning how to implement them may take a great deal longer than learning a framework.
IMO a month is very tight to learn and launch in a month ( I'm assuming you're not full time though ) and you wouldn't be full time if you're learning as well. You know how it is when you get deeper.
About a month ago I faced the same dilemma between RoR and MVC. After a few weeks (learning at night ) I learned enough about RoR framework but ruby language was very new to me, the client wanted delivery and I was still in the "playground/sandbox" phase
So, because I know c# and the .net framework well and I can find resources quickly I have since open for MVC and within 2 weeks I've delivered something to the client.
So in my experience, learn RoR give it a week. If you're finding it takes more than say 40 hours to get going with the actual application, then stick with PHP and do RoR when you have more time and less time restraints.
Goodluck either way though!!
If you're comfortable with Model View Controller stucture then Ruby on Rails isn't too hard to learn. I myself came from PHP's Zend Framework to Ruby on Rails and really found it a relief. I like the whole idea of convention over configuration that Rails uses. It keeps your application (and all future applications) well structured, which in my option is extremely important and time saving.
At this time I've been programming in Ruby with Rails for maybe about 6-7 months and I'm really enjoying it. Clean code, VERY fast development, it's really incredible. Especially with the generator files and database migrations.
As for RoR being a pain when writing raw queries, I'm not sure, I never even have to write them but you sure can with a simple method. That shouldn't be a problem.
Once I started developing web applications in Ruby on Rails, I did not want to go back to PHP. Purely because I'm pretty much in love with how Rails works, the conventions, rapid development, clean code, consistent structure etc etc etc. But these days I now and then still get asked by clients to develop a web application with PHP. But in my eyes, if I went back in to Zend Framework I'd probably really get stressed as I find it extremely inefficient. (That might be my own fault, I'm not sure, but in my eyes, compared to Rails, meh). I discovered the PHP Framework "CakePHP". This framework is as far as I know the closest thing to Rails and I currently use it to develop PHP applications. It's pretty straightforward and works great. It also has a VERY nice thing called the "cookbook" on their website which helps you get up and running very quickly. So if you were to choose a PHP framework I would personally go with CakePHP just because its the closest thing to Rails.
The only thing I myself am a little annoyed about with Rails is that it requires a certain version of Rails to be installed, and that version must be compatible with a specific version of Ruby. You'll need to get the hang of Gems, Plugins (which aren't hard to understand, to be honest). But along with deployment, if you're running Apache 2+ then you need Passenger. Also to be safe you will want to freeze your gems and that kind of stuff to avoid conflicts with the servers specifications and installed utilities.
There's a lot more to learn than just the language and the framework when it comes to Ruby on Rails. PHP is pretty simple, just upload and it works. So you might want to look in to that as well before developing the application.
I think Rails is great, and it would be my first choice for such a project, but if you are in fact under a tight deadline and you are starting from square one with Rails, just don't do it. Go with what you know. PHP might not be the greatest, but it's a very serviceable language.
Despite what people might say, Rails does have a non-trivial learning curve, especially if you are not familiar with MVC. There's definitely a "Rails Way" to do things, and coming from most other frameworks, it takes a while to grok.
I think if you try to rush and learn Rails, you're just going to get frustrated, and I'm afraid this would taint your impression of it. Instead, try learning it in your spare time, or on a project with a more relaxed timeline. I think you'll get a lot more out of it this way.
I think adding the complexity of rewriting what you already know in a month - on a time sensitive project is a bad idea. Using any framework/tools you are unfamiliar with is probably a bad choice on any "time sensitive" project.
That being said the Zend_Framework for php is pretty solid with its form abstractions. I found an easier time moving to ZF than RoR - I tried both at the same time.
The documentation for ZF is fair - reading the actual code of the library is still my best source for documentation though. It isn't that tough to learn or start up - and if you don't mind IRC / stackoverflowing questions you should be able to learn it pretty fast.
Don't board the Rails train just because it looks cool. I know it's what everyone is talking about these days but to be honest, it's really not that special and you'd be better off using a framework written in a language you are comfortable with. If you are really good at SQL then it would take longer to learn how to use ActiveRecord than to just write the queries by hand, and ActiveRecord is basically half of Rails, which kind of defeats the purpose of using the framework. So based on the background info you provided, I'd say go with a PHP framework like CodeIgniter (haven't used it myself but I heard it's great, sounds like what you need).
The project should be done in a month
and is very time sensitive. Is 1 month
enough for learning with and building
a website in RoR?
As its been said before, stick with what you know if the deadline is short.
I am OK using a PHP framework. Is this
a bad idea? If not, which PHP
framework is closest to Rails in terms
of programming convenience.
CakePHP is very ruby like and I have been told that its a good stepping stone for PHP programmers to get in to Ruby and MVC.
use php + Zend Framework it's have all features of ror and more faster
ror is very slow, very expensive, and require powerful server
* The project should be done in a month and is very time sensitive. Is 1 month enough for learning with and building a website in RoR?
it's enough to learn Zend Framework
* Writing direct SQL queries is one of my strengths and I would like to use it. I heard that RoR is a pain to use if I am writing SQL queries directly. Is this true? Or can I just say execute a query, give me the results (as a list or dictionary) and then I will tell you how to render them?
should to writing SQL queries directly, ror make very slow and unoptimization queries
* I am OK using a PHP framework. Is this a bad idea? If not, which PHP framework is closest to Rails in terms of programming convenience.
all you need is mvc framework, I offer you take Zend Framework
For 1 month project use what you know better! Until now I have used Qcodo and Qcubed, but you generate your interface only from the database. Any PHP framework uses DSL. I love Python as language but never used. I was looking Ruby On Rails yesterday and it seems pretty nice. RoR has provided a new way to write agile web applications, but now there is grails too. Grails is written in Groovy, runs over the JVM and is dynamic language. The strengh of Grails is that can use any Java code and framework but with the simplicity of a dynamic language. With Grails you can do the same things of Rails and even more.
My advice, use what you know better, meanwhile learn Grails, this is what I am doing now.
Is 1 month
enough for learning with and building
a website in RoR?
Yes.
Writing direct SQL queries is one of
my strengths and I would like to use
it. I heard that RoR is a pain to use
if I am writing SQL queries directly.
Is this true? Or can I just say
execute a query, give me the results
(as a list or dictionary) and then I
will tell you how to render them?
Writing raw sql with Rails is not any more difficult than doing it with PHP. The object returned will be a hash of column-name/value pairs. The only problem may come if you decide to start using ActiveRecord which returns an ActiveRecord object (not a plain hash)
I have heard that RoR does joins in
memory and doesn't use the facilities
offered by the database. Is this
correct?
If you use raw sql, Rails shouldn't interfere with it.
I need to create a website that
displays a lot of Images, videos and
Java applets. Would RoR hinder my
ability to do this?
No.
I am OK using a PHP framework. Is this
a bad idea? If not, which PHP
framework is closest to Rails in terms
of programming convenience.
IDK.
I really like using ActiveRecord, but if you prefer raw sql, Rails can still be worth using. You'll get good url handling, a lot of built-in security, nice MVC architecture, and a nifty templating system, all while writing Ruby, which for many, has been a good experience.
Nice thread - some great comments in here everyone. This has been useful to me.
Just want to know what is better way to get start developing faccebook app?Any tutorial recommnedation?And which is better to start up -php or rails?
From my experience, there is a much better support focus on PHP than on anything else. That said, there'd be no point learning PHP just to take advantage of the superior support.
Two other general points:
The official support community is really awful. The community has no expert voices and the FB staff only interject when their reputation is at stake. Your best friend is Google and your ability to extrapolate from tutorials.
The FB style of interaction doesn't really lend itself to an MVC framework. One might still save you time, but I find they get under my feet. If you need convincing on this point, may I refer you to the many cases where JSON responses are required or where FBML needs to be 'set' for the profile.
The Facebook platform isn't a whole lot of fun and your users won't thank you for your work. But it's a massive audience and a very useful learning experience.
Good luck!
Btw, you can also use ASP.NET, in which case here is how to get started:
http://www.stevetrefethen.com/wiki/Facebook%20application%20development%20in%20ASP.NET.ashx
The link includes a VS.NET starter kit which makes it very easy to get started quickly.
Start with their docs: http://developer.facebook.com/get_started.php?tab=tutorial
There are libraries floating around for lots of different languages and frameworks so I say: whatever you're happiest with is where you should start.
I've seen pretty complete FB wrapper libraries for both PHP and Ruby. Which one you should choose really depends on which language/framework you're more comfortable with.
I will say that when I was evaluating Ruby libraries recently, Facebooker seemed to be superior in terms of active development and tutorial content on the web. (Be sure to use the Facebooker project on GitHub, not the deprecated one on RubyForge.)
Can I put a shout out for Ruby On Rails with the Koala gem?
I have built a Facebook app in the last two months learning Ruby On Rails from scratch (the last programming of any kind I did was mathematical modeling for my Physics degree project in 1995 in Fortran!).
Ruby On Rails was very simple to pick up and there is a ton of help out there. There are also lots of work already done for you in the way of Ruby Gems. For Facebook I looked through them all and I found Koala the easiest to use, personally.
http://github.com/arsduo/koala/
Re: Ruby on Rails vs. PHP - whichever you're currently competent in. If neither, whichever you'd like to become competent in. Both can do what you want.
Use the Get Started tutorial on developers.facebook.com. This will suggest you use the sample code button which will give you some PHP to list your friends.
Then you can start playing with the PHP using the wiki for reference to the FQL and FBML.
PHP will be easier to start with as there are lots of samples in PHP. Rails may have advantages in the long term though.