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).
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!
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
As a web developer, is it worth me learning the programming language C? Will I ever need to use it? I am currently using PHP and Ruby on Rails.
The unending pain of getting C programs to actually work reliably will teach you a lot about why PHP is a more civilized way to write software.
And yes, you'll use it eventually.
Some day you'll run across a problem ill-suited to PHP or Ruby. You'll be able to fall back to C and look like a hero because you know something more than other folks.
Not really. If anything, learn C because it is fun, and a great language to help you learn more about system internals. Working on web development is very high-level, and you won't get much chance to really get in-depth with the system. Using C can help you better understand how instructions are executed at a low level, how memory management works, and how to create a lot of the things that PHP / Ruby have built in.
Joel Spolsky urges computer science students to learn C:
"Advice for Computer Science College Students" (January 2005)
Learning Latin has it's benefits for understanding the structure of modern derived languages; so in that vein, I say why not?
I've found it very useful knowing C as a web developer. For example, one web app I've written includes a photo gallery. It stores the photos outside of the webroot so that it can check the user's permissions before showing the actual images.
Eventually, I discovered that the overhead for displaying a page full of image thumbnails was incredibly high using the web app in PHP. So, I rewrote the actual photo display code in C as a cgi program, which reduced the overhead to almost nothing.
I don't think learning ANY new language is ever a "bad" idea. Specifically to C, it can only give you a better understanding of how the languages you are using run "underneath the hood".
As others have stated you may not use C, but there are still a number of important concepts relevant to computers and computer science. Some insights can be gained from such classic texts as C Programming Language, by Kernighan and Ritchie.
This includes
Example of very good documentation and writing style in explaining a language in a brief document. You'll find that the complete language is explained in a book not much more than 100 pages. Compare this with some of the tombs of books sold today which position themselves as teaching a language and yet are often more than rehashed API manuals.
Understanding pointers, memory management, arrays and character indexes. All good information which aligns with core computer subjects; albeit low level, but a worthy piece of information for an professional programmer.
Its an easy quick reference book. Again you won't break an arm lifting it and yet gain a lot of knowledge from it.
In general C is useful for those occasions when you really do have to get closer to the machine or need to extend a language through use of a C-API.
Firstly, you have to define "web developer." Are you building websites or web-based software? While both of these tasks easily can fall under the category of "web development," they are somewhat different in terms of the skills set you need to be successful at it.
You're more likely to run into background processing and file/operating system interaction with software than "just" a website, and thus increasing the probability of using a low-level language like C.
Having said that, will you ever use it? Unlikely. High-level languages have been introduced by the dozens to tackle web development. From a web development point of view, if you're having to resort to C, it's most likely because you don't have the necessary skills in more suitable languages. Remember the massive amount of sites and software solutions of varying sizes that run fine on PHP and Rails.
Is it worth learning? Maybe. If you feel like you need hardcore programming skills to complement your web development skills and you have time to spare; go for it. If not, don't. You're probably better off getting really good at Ruby/Rails instead.
Speaking from my own experience, insofar as going from Python to C (and back again, woo!): Yes - learn it.
If you haven't already, learn fundamental, low level data structures; learn them well.
Learn what really makes an HTTP post tick, maybe write some low level debugging tools for yourself and others. It's amazing at how "under the hood" you can get in web development, when you can write an apache module. (Huzzah, bucket brigade!)
Learn the in's and out's of setjmp/longjmp, and perhaps come out with a better understanding of exception handling - that is, how it really works under the hood - in higher level languages.
You might never find yourself writing a line of C code for web development, but if you learn the language well, you'll be giving yourself an edge, all the same. Just be sure not to cut your toes off with it. (:
You'll probably never have to use it, so if you just aim at "usability" just forget it. However, learning C is a good way to get a grasp on the fundamentals of programing. You'll probably gain a much deeper understanding of PHP and RoR for free.
Bug generally, if you feel confident in your languages, no -- it's not worth the price ;).
Although I don't use C anymore, I find it useful to be able to talk to other programmers in their language. You may not have the expertise to solve a particular problem yourself, but you can talk intelligently to someone who can.
The same goes the other way, of course.
And, as pointed out above, C is the foundation of just about every other language that has come after it.
Learning a new language is always a pleasant experience and have a positive impact on the way you program.
Are you going to use C in web development. The answer is, most likely, no. Unless you are going to code a PHP extension or a custom web server.
Its always good to learn a new language , since you are already using Ruby and Rails framework . Knowledge about C programming will come handy when you are trying to learn in depth about Ruby scripting language , Since Matz Ruby Interpreter or MRI is written in C . And also most of the Web servers are written in C and C++ programming language .
Once you have an Idea how Web Servers works , you have an edge in creating a scalable applications , and will also able to analyze plus and minus of the Web Servers above which you are deploying your application.
"Be Jack of all you can be Master at any programming language and at any point of time in your Career" ....:)
Learning more languages is always a good idea. C is great, because a ton of languages are officially or unofficially based on it, and knowing what happens at a lower level can only help.
OTOH, to really advance your knowledge, I'd suggest learning a language that is as drastically different from what you know as possible - Erlang, LISP, Haskell, Smalltalk...
I'll put it this way. C is nuts. It was written in a time before people thought in entirely object-oriented ways. It will frustrate the crap out of you. Its hard to understand AFTER learning things the way you know them now.
But it is immensely helpful in understanding how everything else runs. Its a great language to help you transition to other languages because most modern languages inherit from or are built on it (syntax, data constructs, etc).
Moreover, both Ruby/Rails and PHP are based heavily in C. A lot of supporting libraries are written in C for those languages. Its crazy fast because it's compiled and is quite a bit lower-level, has a much smaller API than either PHP or Ruby/Rails.
I would definitely recommend learning it, even if its just for the fun of learning a new language. My prof always told me: "If you can give me a manual and a project worth working on, and I'll learn any language." So if you can find those two things, go for it!
I say, I say, I say:
Yes... but just a bit.
Just least some very basics: strings, pointer manipulation...
Even if you never actually use it, you'll get much better understanding about performance issues in higher lever languages. Consider strings we're working with all the time:
links are hard by Joel Spolsky
If you learn there is a great chance of achieving success, otherwise there will be no doubt.
Learning languages is never a bad thing. But as a web developer I think your time would be better spent honing on another technology. I've delved in Rails, and Java, but think if I really wanted to learn something new as a web developer, I'd be all over Django, google app engine, javascript, silverlight, flash ... and a handful of other technologies before I even thought about c.
In my opinion, for someone who writes software that runs on a computer, learning C is like learning Latin or Greek for a scholar of anthropology or literary science.
A significant body of the work that has been achieved in software development today has been done in C and that is what you really want to learn: it's not so much about writing your software in C, it's about being able to understand. Both what is possible and what has been done. Were everything comes from and also why we are moving more and more away from C in many areas.
Happy Segfaults! ;-)
The opportunity cost of learning C is high - you can learn something practical instead.
If you are a web developer and wish to continue to be one, it would probably make more sense for you to learn something more applicable to your field: Ruby and figure out how Ruby On Rails works, Python and how Django works, C# and how the MSFT MVC works. Or Flex. Or JavaScript and mooTools/JQuery.
While you can get a lot of basic computer science concepts out of learning C, you will probably never have to touch it. When/if you do, you'll learn it then.
If you wish to learn computer science ( not just slightly lower-level programming ), you can try Project Euler or some algorithms, operating systems, etc literature.
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.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have little (<1 year professional) experience with
Perl
Groovy/Java
I have limited (<2 year professional)
C
I have decent experience (>= 6 years professional) with
PHP
SQL
I have hobby experience with
C++/DX9 (some simple windows games/demos)
Obj-C (a few iphone app's)
ASM (http://www.amazon.com/Assembly-Language-Intel-Based-Computers-5th/dp/0132383101/ref=sr_1_1?ie=UTF8&s=books&qid=1263401280&sr=8-1) - I stopped when it got too windows specific.
So my question is what language can I next approach (on my free time) to give me some new insight to programming and problem solving in general - I was looking at maybe LISP - something which would be very foreign to me. I want to tackle something very, very different from the languages listed above.
EDIT: I think I'll investigate Haskell - thanks for the feedback! and maybe possibly Erlang, and I really liked Adrian Kosmaczewski's idea about a Mac App for snow leopard.
Haskell, followed shortly by Python.
try a functional programming language
F#
Lisp
Haskell
Two very different programming languages you could try are Haskell and Prolog.
Haskell is a pure functional language, where you have functions that take other functions as arguments and modifies them. It freshes up your mind ;-)
Prolog is a logical language, where you specify a set of conditions that should be true and then prolog can find legal solutions. The language have been used for research in artificial intelligence.
I also vote for functional languages:
Erlang is interesting because it's a growing language, explicitly targeting to parallel programming;
LINQ, which uses functional programming concepts to extend .NET languages into doing some really cool things;
JavaScript - it's fun it's not in your list, but it's the worrrrrrrld's most misunderstood language as Crockford would say, but it's also the worrrrrrld's most deployed functional language ever.
Since you know ObjC already, try creating a Mac app for Snow Leopard using blocks and Grand Central Dispatch... that might also stretch your mind a bit :)
Given that the free lunch is over, jumping into this paradigm is a good investment, IMHO.
Hope this helps!
Ruby. Ruby is great, and from there you can learn about Rails, which is an amazing framework.
Prolog, to learn logical programming.
That will probably teach you a lot, but I mean it as a hobby, since I personally do not know any non-educational applications.
Haskell, or Erlang, for functional programming.
Is this for academic or professional development? If the latter, look at the areas you would like to work in, and see what languages they are asking for. They will most probably be mainstream such as C++, C# or Ada for example (depending on the domain), but if this is for academic interest some of the more esoteric languages might be of interest Eiffel, Forth, Smalltalk and all those mentioned by others.
For professional development, you may be becoming a jack-of-all-trades, master-of-none, and I suggest that you might think more vertically and consider studying design and modelling languages such as the UML, and associated analysis/design methodologies and patterns. These skills are portable across languages, and choice of language should always take second place to a good specification and design.
I'd say if you're interested in a new and very "different" language and are considering several options, you should check out the community first. See how active the newsgroups are, if the people seem nice and have a good vibe. Investigate if popular projects in that language tend to be on topics that intrigue you.
Haskell seems like a good option. Functional languages are important and show a different side to problem solving. I've been looking at Erlang but haven't written anything in it yet, so I can't speak about it on any level besides shared curiosity.
link | flag
add comment
Psssst... over here! Shhhhh! Don't draw no attention! We clear? Are you sure no one followed you?
So you wanna "completely change the way you look at programming", eh? People probably tellin' you the way to get mind expansion is to go to CS school—functional programming, or something sissy like that. Yeah I know what I said...with the bullcrap about "community"...that was to get the moderation police off my back, dude!
Fact is I got your "mind expansion" right here...the crack cocaine of programming: [Rebol]
First time's free. But if anyone asks where you got that from, it wasn't me! We never met...I don't exist. You got that!??
:P
Clojure. You won't regret it
Javascript and python.
Javascript is the most misunderstood language in the world. But don't take Crockford advice. Embrace it with its defects. Don't work around them. Just be aware of them.
For example, dont' go closure for the object creation. embrace prototype-based inheritance. It's cool.
Based on your CV, I would recommend tackling Python as it will give you a good opportunity to work on some CS fundamentals like OOP and functional programming. Python is a good general purpose language to have in your toolbox that is mature, can be used for a wide variety of applications (web, utilities, scripts, servers, etc) and is pretty easy to learn and become productive with in a short time.
LISP and FORTH are good choices for serious mindstretching.
If you seriously want to stretch yourself, get a copy of Abelson & Sussman's "Structure and Interpretation of Computer Programs", and a copy of the MIT Scheme system, and start working through the book. Scheme is a dialect of LISP (but you probably knew that already.) (On this subject, pull down a copy of course 6.001 from Open Courseware at MIT.)
If you want to learn a different mindset, that will serve you in good stead in interesting ways, Google and snarf down a copy of Leo Brodie's classic "Starting FORTH", and pick up a FORTH interpreter to play with. (The book is written for polyFORTH, which is no longer available from FORTH, Inc., and FORTH systems are not common these days.) Then read "Thinking FORTH", from the same author.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
As you probably know, Derek Sivers is the guy who created CD Baby and eventually sold it for some big bucks. He wrote it in PHP originally and then down the road set about rewriting it in Rails. His troubles are the stuff of legend:
7 reasons I switched back to PHP after 2 years on Rails
That article came out in 2007 but being newly infatuated with Rails, I'm wondering whether anything has changed to make Rails more of a wise bet in the meantime, or should I stick with my good old ugly PHP girlfriend?
Does anyone agree that Rails does not offer any significant advantages over PHP?
Austin Ziegler wrote an interesting response to that article:
On Derek Siver’s Return to PHP…
The gist of it is:
Derek chose the technology for the wrong reasons. He chose it partially
based on the hype of Rails, but he
envisioned it as a silver bullet that
would magically make his application
better just because it’s in Rails.
Rails didn’t fit Derek’s application model for CD Baby, and
Derek’s application model is more
important than the technology to be
used, since it represents a business
he understands well.
He ignored his existing experts for the new technology. Neither he nor his
employees knew Ruby aside, perhaps,
from playing around with it. This
wasn’t a technology that was deemed to
be appropriate from experience; this
was a technology deemed appropriate by
management (sorry Derek, you might
still be getting your hands dirty with
code, but you’re still management).
Derek approached the project as a whole-environment ground-up rewrite
with a One Big Day deployment, without
considering ways to phase it in over
time. It’s almost always possible to
find interface points where you can
replace one broken piece at a time.
Ultimately, this is what the Rails
folks wouldshould tell you anyway:
replace one area at a time, each with
a different codebase. Interface them
as REST-ful services. Don’t make them
depend on a single database schema.
Re-writing an existing site is almost always a bad idea. It's hard to put your heart into retreading an old wheel. I worked on a rewrite of a site from CGIs to a Java app server and saw several programmers quit because of it. For one, they preferred their old way of doing things and did not want to learn Java. Secondly, I believe they did not have the enthusiasm to re-write a ton of legacy code that they had been maintaining reluctantly to begin with. Far better to try Rails out on a new task and see how it fares. At least then you are putting it on an even footing with PHP in the psychological motivation sweepstakes.
I have experience with PHP & Ruby + Ruby on Rails (earned money using both, but not a lot).
The Ruby library is much better. PHP's library is a collection of functions in a global namespace with inconsistent names and argument order. strpos vs str_repeat. strpos's first argument is the big string and the second argument is the string to find. explode's first argument is the string to split by and the second argument is the big string. This was a big problem for me. I had to look up a lot of things when using PHP, but not when using Ruby. I can remember things because they're consistent. The names of the methods make argument order clear. Another: PHP's strlen($str) vs count($arr) while in Ruby it's just anything.length.
Ruby the language is better than PHP. It has closures, good OO, nice syntax (this is subjective, but you need a lot less punctuation in Ruby, and that's what I get wrong most often).
That's my experience. Try both and see what works for you.
The best answer will be the author's himself. He seems to make another comeback to RoR!:
Foreword
My former company (CD Baby) was one of
the first to loudly switch to Ruby on
Rails, and then even more loudly
switch back to PHP (Google me to read
about the drama). This book by Michael
Hartl came so highly recommended that
I had to try it, and Ruby on Rails
Tutorial is what I used to switch back
to Rails again.
http://railstutorial.org/book
And skimming his own site, indeed, proves his return to RoR:
Instead of trying to teach everyone my unique PHP framework, all
projects will standardize on Rails 3.
http://thoughts.pro/
The guys who changed from Rails to PHP just by following the renowned article of his, now it is your time to come back to Rails, again!
I read that post from Derek Silvers. There is something weird about it. He tells the tale of a project that got out of control, dragged on for months, and eventually had to be abandoned. He blames this on the Rails framework. Yet he never says what it was about Rails that caused the project to fail. The article would be far more credible if he offered some solid information, but he doesn't mention even one specific place where Rails let him down. The closest he comes is to say that their "needs" (?) clashed with Rails's preferences (which ones? How?)
Meanwhile, people all over the world (including myself) are implementing complex Web applications in reasonable amounts of time using Ruby on Rails.
Given the lack of detail, or really any specific technical information at all, in Derek's piece, it could easily be that the project failed for any number of reasons having nothing to do with Rails.
The original question was "should I heed Derek Silvers' warnings about migrating from PHP to Rails?" My answer would be no, his "warnings" amount to a vague anecdote with zero supporting evidence. It is perfectly safe to ignore them.
Should you reimplement a PHP app in Rails? That's another question. There is no blanket answer to that one. It depends entirely on circumstances.
Luke Crawford's recent post about Muxtape offers another perspective.
I spent my first 4 years as a web developer using PHP, and it was fun at the time, but as I began to realize how severely inefficient it was I started looking elsewhere. I’d abandoned my traditional computer science background for the web and its greater design possibilities, but because of this I knew there was a better way. PHP developers shouldn’t be ridiculed as much as they often are because, frankly, it enables people without a more rigorous background to accomplish amazingly technical things. This should satisfy nerds but usually is turned into some kind of weak ‘machismo’ thing instead. Anyways, this dissatisfaction began in late 2004 and Ruby on Rails was brand-new, stable, and addressed every limitation I’d confronted with my old homegrown PHP MVC framework. I’ve exclusively done Rails work ever since.
In any case, it would be hard to defend the categorical statement "Rails does not offer any significant advantages over PHP."
PHP is a great tool to solve certain problems. Rails is a great tool to solve certain problems.
As both an active Rails and PHP developer (with experience going back to 2000), I strongly disagree with the statement.
I maintain that Ruby offers significant advantages over PHP, and Rails is a better framework than anything in the PHP world. A lot of this has to do with the language itself - Ruby can do things that PHP just simply cannot. Once you grok the elegance of meta-programming, a whole new level of expressiveness opens up to you.
Disclaimer: I am by no means a Ruby or Rails expert.
As someone who's been in the industry for nigh on 15 years I see several warning signs that make me nervous about Ruby on Rails specifically. I'm going to ignore the language here because a language is a language. Ruby is a modern language with closures, exceptions, OO, etc. Some criticize it with regards to performance. These issues are largely irrelevant in that they don't impact real world performance (if it takes 300ms to download and display a Web page, who cares that the serverside codes takes 10, 20 or even 30ms to run?) and transitory in that they are fixed in later versions (as seems to be the case with Ruby 1.9).
Ruby on Rails is a closed, heavyweight stack. I mean this as an observation not an accusation. It is tightly integrated (including with Prototype) much like JBoss Seam in the Java world (being integrated tightly with JBoss/Hibernate and yes I know recent releases and articles have tackled the issue of using it with, say, Glassfish and another JPA provider)
This can be both a good thing and a bad thing. J2EE, for example, being a fairly open stack was the cause for much innovation in the software industry in the last decade as almost every piece of it (notably EJB) was replaced by different projects that could be slotted together. And of course it was, if not the birthplace for Spring, it was certainly the incubator.
On the other hand you have more closed stacks like .Net where their closed nature allows for rapid innovation, a model Microsoft has (generally) excelled at. In a few short years DirextX went from being a joke to completely trouncing OpenGL as a games development platform because any closed system can evolve that much faster than an open standards system. That's just how it works.
The other relevant point I'll mention is that in recent years there has been a move towards ORMs ("object-relational mapping") in Java, .Net and elsewhere and this is part of the impetus behind Rails. I've commented on this previously, for example "Using an ORM or plain SQL?" and I won't reiterate those points in their entirety.
As most of you would know there is a mismatch between the object and relational worlds that ORMs have sought to bridge. In the last year or two I've dealt with this mainly through Java (JPA specifically).
Now when you bridge between two things that don't match you end up with "leaky abstractions" (as Joel put it):
All non-trivial abstractions, to some
degree, are leaky.
Now what I'll add is this: there is an inverse relationship between the complexity of the abstraction and how leaky the abstraction is. Case in point: ibatis. Ibatis is an extremely lightweight yet powerful persistence framework for Java and one I'm a huge fan of. It wraps SQL in external files and on top of that puts many modern ORM behaviour, such as:
Lazy-loading of relationships;
Result mapping;
Grouping of results to multiple levels (something JPA can't do); and
Discriminated types (ie the type is determined the data).
I would estimate that ibatis has 90-95% of the functionality of Hibernate with the only complexity overhead being runtime bytecode enhancement for the lazy loading via cglib (JPA does it the same way) with the only downside that you have to write your own queries (and I don't consider that a serious downside but opnions will vary).
Compare that to a JPA provider that relies on instrumentation, load-time weaving and non-standard class loaders to implemennt that extra 5-10% functionality (and the abstraction is still leaky).
So there is a law of diminishing returns when it comes to making things less leaky. At some point you're better off investing in a bilge pump than you are in fixing every leak in the boat.
Bringing this back to Rails: the leaky abstraction argument is my biggest problem with the Rails philosophy.
What also rings alarm bells for me is the comments you get in posts like On Derek Siver’s Return to PHP… is:
"Derek chose the technology for the wrong reasons.": wait... isn't RoR either a general-purpose Web application framework or a pretty close facsimile? That being the case, why can't you do a site like CDbaby in it?
"Rails didn’t fit Derek’s application model for CD Baby": How so?
"He ignored his existing experts for the new technology.": wait... didn't he hire an expert?
"sorry Derek, you might still be getting your hands dirty with code, but you’re still management": I agree with the comment that this quote is "asinine" and will add that its misleading, irrelevant and arguably a strawman;
"Derek approached the project as a whole-environment ground-up rewrite with a One Big Day deployment": arguably not advisable but if you're willing to spend the time and money on it, I don't see it as a reason why you can't do the site in RoR.
Now 5-7 years ago when EJB was hyped up you got criticisms of it based on lots of things and you'd get stalwart defenders arguing:
"Application X didn't fit the EJB model";
"They didn't understand how EJB works";
"EJB is not for all applications" (they'd rather concede defeat on this one than face the more glaring issue that it's not really appropriate let alone a good idea for, well, just about anything);
etc.
So the anti-Ruby posts (and especially their rebuttals) all sound very familiar to me.
It's worth mentioning the year old rant "Rails is a Ghetto" by Zed Shaw, which is a 6000 odd word rant ("conflagration" is probably a better word) against Rails. Some notable quotes:
This is exactly what makes Rails a
ghetto. A bunch of half-trained former
PHP morons who never bother to sit
down and really learn the computer
science they were too good to study in
college.
and
Notice how it took me a few seconds to
reply. This one single statement
basically means that we all got duped.
The main Rails application that DHH
created required restarting _400
times/day. That’s a production
application that can’t stay up for
more than 4 minutes on average.
and (on memory leaks):
That’s one more reason Rails is ghetto
as hell. Important patches like the
above go largely ignored by the
Japanese developers, and while they
are very nice guys, the above just
smacks of amateur hour.
and
The best part about the whole thing is
there’s potentially 10 new web
frameworks that can take on Rails.
Hell, Mongrel spawned or helped 5 of
those. My favorite of those frameworks
is Merb which is literally “Mongrel
plus Erb” but now it uses Erubis
mostly. What I love about Merb is that
it proved you could make a fast thread
safe Ruby web framework with all the
same ideas as Rails and using most of
the Rails gear at the same time.
However, the joke is that before Merb
the Rails Core morons would scream up
and down you can’t make Rails thread
safe. Ezra however proved them all
wrong by just writing a better Rails
than Rails and all thanks to Mongrel
being so easy to hack and work with.
and:
Ruby on Rails has become full of
people like Koz, with Koz the most
senior of the wannabe smarties. Koz
got lucky at best and injected his
shitty coding into a good project,
messed it up, and then latched on to
security as the way to get more
control. Of course he doesn’t actually
know anything about secure coding
which is why his code seems to have
lots of the bugs (go check out the
date parsing shit. Clue: months don’t
always have 30 days).
And, well it goes on.
So I guess I can sum it up this way: Rails smells bad.
Rails is a good framework, but sometimes migrations are bad ideas.
I prefer to start from scratch, you can't be "translating" PHP code into the Rails context. It just can't be done, mostly because of the Ruby language itself and the MVC pattern.
I'd rewrite it in Rails, but if you love PHP, go with PHP. Don't care about what other people say, do whatever suits you.
In business, time is money - and sometimes you have to go the path of least resistance. No environment, language, framework, etc. is perfect. Learn and use what you want to and keep it movin' homeboys!!!!