views:

563

answers:

13

I am stuck in a MySQL/Apache/PHP/JavaScript world.

in a fish bowl

Is it possible to stay inside that stack yet incorporate other languages and technologies to advantage and increase interest?

The idea is to still serve pages with PHP, but they might have been made with another technology or the JavaScript might have been built with a tool rather than by hand.

+2  A: 

Well, the best way to get out of that particular bowl, in my experience, is to dream up a small project that you're interested in and implement it from the ground up with a totally new technology. Unfortunately, most employers won't pay for that kind of thing; even though it makes you a better developer, and improves the bottom line by broadening your knowledge, it's not usually the kind of thing that a manager can itemize and allocate money for. This means you'll have to do it on your own time.

If you can carve out time, I would highly recommend Ruby on Rails. It's a great tinkering language, and it comes with great tools to "just get something on the page" and then specialize it from there. It also has a great example of good architecture for webapps in a highly dynamic language. Very good platform for "web 2.0" kind of stuff, if you'll excuse the buzzwords. It should be both new enough and familiar enough to pique your interest, I think.

Matt
I've got a neighbor who is a RR evangelist, but I'm too much around apache to get excited about Rails, in fact I'm more interested in the language, Ruby, than I am in the all the generate scripts. Still looking...
Don
@Don you can use http://modrails.com/ (Phusion Passenger) with Apache for Ruby on Rails applications in an Apache environment :) The Ruby language itself is in fact very interesting and you might as well look at Sinatra if you are interested in building small applications.
Patrick Daryll Glandien
+2  A: 

Developer Tools.

Choose a new language and/or platform and create some small application/system that will help you crank out, validate, improve, etc the PHP, MySQL and Javascript code that you need to produce to keep yourself fed and a roof over your head.

Alan Storm
Thanks, I'm lucky, still employed with some latitude, but the base is still PHP and I would like to link some new technology into that.
Don
+3  A: 

You could get some Java experience by using Google's GWT. It allows you to write javascript code using the Java language. The GWT compiler will compile your Java code down to highly optimized javascript. It has many more useful features as well.

Brad
Does this idea work with having a PHP root on the server? I would like something that can be incorporated into the existing stack.
Don
GWT creates javascript out of Java. It is independent of PHP. I am not sure what you mean by PHP root on the server. If it is true that your existing stack is javascript/php/mysql, then this will be your javascript part.
Brad
Yes, that is what I was asking. This sounds very interesting.
Don
+5  A: 

You could try Python or Perl, instead (or with) PHP. They should be fairly easy to integrate with your existing Apache/MySQL/PHP setup.

And you could always swap MySQL out for PostgreSQL. It too fits well into that world.

Atli
+3  A: 

Structure and Interpretation of Computer Programs, which is available online, is covering about every major programming concept, including functional and logic programming style, lazy evaluation, DSLs, concurrency, continuations, representing state and OOP. The programming language used in the book is scheme, a very abstract language with minimal syntax.

While you will probably not do any projects in scheme itself for money, the concepts you will learn apply to the whole field of programming. You will see MySQL/PHP/Javascript with different eyes. To me and other people it was the red pill of the matrix movie...

__mme__
I did Java before PHP. I switched when both were still in the awkward stage, Java 1.2 and PHP4. Now that I've got PHP5, I tend to treat it like Java with $'s (I heard that somewhere else.)
Don
Well, now that PHP 5.3 got lambda functions and closures, you could treat it like scheme without the parentheses :)
__mme__
Yes, it will be much easier to argue for upgrading to 5.3.
Don
+1  A: 

Step out of that set of technologies for a while, and pick up a functional language and play - Haskell if you want to stay in the open source world, or try F# in the .NET domain. Both have interactive interpreters (good for experimenting!) and have really stretched my mind coming from a largely PHP and Java background. It will give you a fresh perspective on your (L?)AMP work.

I hear second-hand that functional-style programming can be done in JS, but I know nothing about it. That might be another way to look at JS for you.

mmsmatt
I am intrigued by Scala, but would like a way to incorporate it into the PHP base that is already there (if it were Java it would be much more straightforward.)
Don
@mmsmatt: functions are values in JS, `function` is both a statement and an operator; other than that it's a pretty much conventional language without any special support for FP. `var bind1st = function (f, lhs) { return function (rhs) { return f(lhs, rhs); } }`
just somebody
+11  A: 

You should have a look at haXe, it is a quite unknown and new language, but it could perfectly fit you needs:

  • haXe compiles to PHP, JavaScript, nekoVM (small VM, could be used on the serverside), C++ sources, AVM 1 & AVM 2 (Flashplayer 6 - 10), but simply use the same language everywhere
  • for every platform you have an own API, but the general stuff could be used on every platform. This means you could write code that runs on server and client side (e.g. form validation in JavaScript and then on the server side again)
  • haXe language is a good mix of ActionScript 3, a little bit Java and a few thing from C and the ML-languages
  • the language itself offers really nice features you even won't have on all of the target platforms (strongly typed with type inference, typedefs, enums with optional constructor parameters and type parameters, conditional compilation, method and variable inlining, runtime type information, ruby-like "mixins")
  • a small con is lack of good documentation for some things, but the community is very helpful
  • a external package system haxelib (just like gem for Ruby)
  • the compiler is awesome fast, it is even used for code-completion. You could do variable and method inlining and it performs some nice optimisations.

If you are not afraid to learn something new you should take a few hours and give haXe a try.

Hippo
Yes,m this is really sounds interesting.
Don
+1 Sounds very interesting. Going straight to the top of my list of languages to check out!
Atli
My answer, +1 anyways
Willi
This is a neat idea, I would feel a little foolish re-writing my PHP framework in it, and compiling it back into PHP; but using it to write JavaScript, does sound appealing -- but then isn't that want GWT would do, too? I would vote for learning both approaches and then under the pressures of real work probably not getting it on with either right away!
Don
you could try to so called "extern classes" to re-use you php code. GWT is indeed cool, but does not give you the possibilities for the server side..
Hippo
+8  A: 

Instead of using a new technology why not use a current technology in a new scope? I'm using JavaScript since 6 years now, and I'm learning new wonderful features of this language on almost a weekly base. In fact, it's almost a full-featured functional programming language, and you can have fun with closures and prototypes (which is something that comes just recently in PHP 5.3).

Suggestion: Try server-side JavaScript.

There are several possibilities, for example the highly praised Node.js or the Firefox addon POW. You will get a complete new view to a language that you might mis-interpret as a "do some clicky stuff" kind of childrens' language.

Boldewyn
Cool, yes, JavaScript has always been an interesting language so to get to use it on the server would be very interesting.
Don
Since Opera does such a hype about Opera Unite, I'd like to advertise POW a little more, the same functionality as Unite, but around since 200(5|6).
Boldewyn
+1 for the mention of FP in javascript
just somebody
+2  A: 

A few things to consider:

  • Check out Facebook's Thrift
  • For really heavy operations, consider writing them in C and compiling them, and then calling them from PHP exec
  • Consider using a framework (Zend, Cake, jQuery, etc.) atop PHP/JS
philfreo
Thrift is definitely a go. It provides interfaces to stores built in other languages.
Ritesh M Nayak
+1  A: 

Try integrating some XSLT into your stack. It's complementary -- you keep on using your existing host languages (the XSL extension for PHP, or one of the JavaScript engines). XSL requires a very different way of thinking, and writing, your code.

It's not a full-blown functional language, but contains many of those concepts. And, it's a practical skill -- there's quite a bit of it floating around out there, and if you can deal with it, there's money to be made.

I'm currently maintaining a couple of ASP applications that make heavy use of it. I HATE it, but I'm glad I had to learn it. There's a sizeable community of people who LOVE it (they're crazy ;-) It would certainly meet your desire to try something different.

Val
Yes, isn't it true that some of the most diabolical things tend to have a way of being valuable to work through.
Don
A: 

Try PostgreSQL for a better SQL database. Very user-friendly, much more capable than MySQL.

Implement a PHP extension in C or C++ (Extension Writing Part I, Wrapping C++ Classes in a PHP Extension)

edit:

Try a different web server, like lighttpd, bozohttpd or mongoose

just somebody
+1  A: 

Definitely try PostgreSQL. I am just starting to get into it and I can't believe how much more than "data storage" you can do with a solid database.

Instead of programming your logic in the language - try using the database to handle your logic with stored procedures, functions, and views. Hey, they even support recursion!

Xeoncross
A: 

If you want to try a new technology, try a php MVC framework like CakePHP or Symfony

MVC is a very interesting style. I'm just discovering with django, which I'm loving. Which i also recommend if you want to get away from php and play with python. It's very easy, and django in particular has great documentation.

The.Anti.9
MVC forces one to break basic principles of OOP.
just somebody
I'd like to know how so?
The.Anti.9