This is a great PHP framework: http://laravel.com/3
This is a great PHP framework: http://laravel.com/3
why would you use php though
Edited:
serious question. what does PHP offer besides the abundance of cheap and nasty shared hosting?
I use it for the C Style coding
that is not a valid reason
Edited:
mainly because the only thing that's 'c-style' about php is { and }
How is personal preference not a valid reason? In the end I will still use it, just because I know it and get things done in it.
my guess is that you only prefer it because you haven't tried anything better
So... its definitely worth installing a ruby interpreter onto my server and having a play around with it?
PHP is alright for simple shit no doubt but anything more and you're just making more work for yourself. Fishsticks
Each time there's an argument about PHP here no one comes up with anything major that's better in Ruby or worse in PHP, or why one should switch.
I've been thinking of trying Ruby myself, but I don't really see why PHP would be bad for even big projects. Something about every page load being an "instance of its own"?
I tried Python and C# ASP.NET and I still use PHP. I guess your explanation for that is that I'm a total idiot?
There are various platforms you can use for PHP, not all of them spawn an instance per page.
Mainly it's the whole "USE LINUX IT'S BETTER" thing. People find a cool new thing they like (in this case RoR) and then inform everyone that they should be using it. Notice how no PHP developers are telling people to stop using Ruby. That's not because Ruby is better, but because the PHP developers don't give a fuck and continue to use the tools that work for them.
I've worked with both and I can't say that's true. Ruby does some easy stuff for you but that's negated by its retard-tier toolchain.
Yes, because you haven't tried ruby :3
And did you try a Python framework?
I tried that Google AppEngine thingy, which was recommended here as "an ok start if you're completely new to Python's web related stuff" (not an actual quote).
Heroku can host python apps now IIRC, they seem pretty interesting, I tried deploying a ruby app the other day and it was pretty no-fuss
Edited:
In all honesty though, you should give ruby a try (either rails or sinatra). It's fucking fantastic and good for everything from a small automation script to a large website. And it manages to keep all that ability while still managing a beautiful and painless development experience, true coding zen.
I find the main difference between using PHP and other frameworks (and therefore generally languages) is that with PHP it's much more of a procedural programming task. You write everything from being passed the request to apache, to sending the response.
With other frameworks quite a lot of the work parsing what page to dispatch the request to etc is handled behind your back, so if you're new to the framework it's hard to get an idea of how everything works. This is especially true of things like Google Apps.
PHP is so easy to pick up and mess about with, there's no prior experience with the language required at all really.
The learning curve is so completely worth it though.
Just finished writing a quick & dirty php daemon class (makes use of: http://blog.motane.lu/2009/01/02/mul...ding-in-php/):
<?php /* file: app/lib/daemon.php desc: daemon class */ class mod_daemon { private $jobs = array(); private $threads = array(); private $dbfunc; private $threadfunc; private $maxthreads; private $threadtime; private $dbupdate; //construct public function __construct( $dbfunc, $threadfunc, $maxthreads = 10, $threadtime = 60, $dbupdate = 300 ) { $this->dbfunc = $dbfunc; $this->threadfunc = $threadfunc; $this->maxthreads = $maxthreads; $this->threadtime = $threadtime; $this->dbupdate = $dbupdate; } public function start() { //threads array & counter $threadcount = 0; //db update time $dbtime = $this->dbupdate; //loop time while( true ): //get new jobs if( count( $this->jobs ) <= 0 and $dbtime > $this->dbupdate ): //get jobs $j = call_user_func( $this->dbfunc ); foreach( $j as $job ): $this->jobs[] = $job; endforeach; //reset db timer $dbtime = 0; endif; //add threads until max reached while( count( $this->threads ) < $this->maxthreads and count( $this->jobs ) > 0 ): //get our job reset( $this->jobs ); $key = key( $this->jobs ); //create thread $this->threads[$threadcount] = array( 'thread' => new Thread( 'update' ), 'time' => 0, 'job' => $key ); //start thread $this->threads[$threadcount]['thread']->start( $this->jobs[$key] ); echo 'new thread spawned: #' . $threadcount . PHP_EOL; $threadcount++; //remove from job queue unset( $this->jobs[$key] ); endwhile; //loop all current threads, check if dead foreach( $this->threads as $key => $thread ): //update thread timer $this->threads[$key]['time']++; //thread dead? if( !$thread['thread']->isAlive() ): unset( $this->threads[$key] ); echo 'thread stopped: #' . $key . PHP_EOL; endif; //thread over times timer? if( $thread['time'] > $this->threadtime ): $thread['thread']->stop(); unset( $this->threads[$key] ); echo 'thread force-stopped: #' . $key . PHP_EOL; endif; endforeach; //end, sleep, update timers sleep( 1 ); $dbtime++; endwhile; } } ?>
Edited:
The best documentation & support.
True, a lot of the tutorials are poorly written/etc, but the reason PHP is so popular (and will continue to be) is because it's so insanely popular. And it can be surprisingly powerful (albeit sometimes slow).
Currently I'm working on 2 web projects: HackTech Online and SellMyCode.
HackTech is an online hacker simulation game, and SellMyCode is a website where you can buy and sell source code for software :)
SellMyCode:
HackTech Online:
I work with PHP every single day, on some very very large and expensive (read: millions) platforms. I'm also in the process of getting my Zend Certified Engineer certification. It works, it does its job, but it also requires a ton of extra work and bullshit on the side to keep it running smoothly, the inconsistent syntax and built-in libraries, glaring bugs and imaginative haphazardly-implemented features are grating on the developers, often holding them back with little ridiculous and nonsensical bullshit that wouldn't fly in the dozens of other common languages.
Do I like PHP? Yes, I have a ton of fun writing PHP myself. Do I recommend it? Not anymore, no. Even the common learning-curve argument has gone out the door - shared host support plays a big part, no doubt, but besides that there's very little on PHP's side in that aspect.
Is there a market for PHP? Yes, and for experienced developers its bound to get more profitable in the long-term. That said, you'll be stuck in a niche-market duct-taping legacy applications.
Is PHP good for you as a programmer? No, if you're a beginner, you'll come out the other end with bad habits and a very limited mindset (I'm still trying to fix that in some aspects, PHP being the first language I seriously worked with); if you're already experienced, you'll want to claw your face out.
Should you learn PHP eventually, if you don't already? It's useful for very quick and dirty scripts, much like you should learn perl or python for those quick scripts where bash doesn't cut it.
What does the PHP library environment look like? It's absolutely depressing, specially when you put it alongside ruby's, python's or javascript/node's.
What does the future hold for PHP? An increasingly enterprisey and misguided language, which is a shame considering PHP's best asset was being a decent hackety-hack tool for the web.
tl;dr: Save your time and energy, invest in a modern language that's healthy for you, become a better programmer in the process.
Edited:
PHP has the most documentation (don't quote me on that), but the signal-to-noise ratio is abysmal. Even the official documentation is often incomplete and peppered with gems like:
do_something ( void )
function to do something
Unofficial documentation/tutorials are more often than not uninformed or down-right ridiculous. And powerful? Of all the common languages we throw around, it's by far the most limited.
Google AppEngine uses web.py which really is pretty damn simple.
I still prefer Django. I find it much better.
Let's say I wanted to try using Ruby for web development - where would I start? Do I need a framework such as RoR or what? I tried Googling about it, but most of the resources talk about RoR - I guess I should try that, then?
EDIT: Wait, why am I asking this here and not the question thread... oh well.
RoR is a framework for web apps. You can download it here or alternatively (my host and probably others) webhosters offer RoR already just check around your cPanel.
For starting I really liked http://railsforzombies.org/ they take you through the creation of a micro-blogging website (iirc), they have a video part and at the end they have a test console and they ask you to solve problems based on the lesson (One part was getting all the users or something from an array, again iirc, I took it a while ago)
Also ruby is it's own language, RoR as noted above is only a framework.
Alright, thanks. I was just a bit confused, as PHP can easily be installed as it is so that web servers such as Apache can utilize it. Wasn't sure how it works with Ruby.
Can I have that background image? It looks really nice.
I use phusion passenger which makes deploying any rack based app as easy as deploying php.
What a terrible website.
The only bad part is the logo
Edited:
Working on my first rubygem, it pulls data from Google Play (using nokogiri). I've got no idea what the fuck I'm doing but check out this Awesome Print dump
![]()
I see this thread turning into a Ruby development discussion thread in the near future
needs more bootstrap
Yeah, only because the Ruby fanatics would have driven everyone else out.
Docs are my bible.
I am the doc
ITALIAN GIBBERISH
Making a site for a local bed and breakfast. Anyone got any suggestions on what font to use?
![]()
Try blurring the background photo a bit. It's a little busy in the middle and that makes it hard to read the text.
You could try changing the white background for the sidebar instead of using a line to separate it, and add more padding to it.