why would you use php though
[editline]6th March 2012[/editline]
serious question. [b][i]what[/i][/b] does PHP offer besides the abundance of cheap and nasty shared hosting?
[QUOTE=swift and shift;35017749]why would you use php though
[editline]6th March 2012[/editline]
serious question. [b][i]what[/i][/b] does PHP offer besides the abundance of cheap and nasty shared hosting?[/QUOTE]
I use it for the C Style coding
[QUOTE=commander204;35017819]I use it for the C Style coding[/QUOTE]
that is not a valid reason
[editline]6th March 2012[/editline]
mainly because the only thing that's 'c-style' about php is { and }
[QUOTE=swift and shift;35018137]that is not a valid reason
[editline]6th March 2012[/editline]
mainly because the only thing that's 'c-style' about php is { and }[/QUOTE]
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"?
[QUOTE=swift and shift;35018263]my guess is that you only prefer it because you haven't tried anything better[/QUOTE]
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?
Working on a webadmin system for a gaming community.
[thumb]http://noob.hu/2012/03/06/apache_log.png[/thumb]
[thumb]http://noob.hu/2012/03/06/server.png[/thumb]
[QUOTE=Dragory;35019551]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"?[/QUOTE]
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.
[QUOTE=jaybuz;35018903]PHP is alright for simple shit no doubt but anything more and you're just making more work for yourself. Fishsticks[/QUOTE]
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.
[QUOTE=Crhem van der B;35020160]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?[/QUOTE]
Yes, because you haven't tried ruby :3
And did you try a Python framework?
I tried that Google AppEngine thingy, which was recommended [B]here[/B] as "an ok start if you're completely new to Python's web related stuff" (not an actual quote).
[QUOTE=Crhem van der B;35022307]I tried that Google AppEngine thingy, which was recommended [B]here[/B] as "an ok start if you're completely new to Python's web related stuff" (not an actual quote).[/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
[editline]6th March 2012[/editline]
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.
[QUOTE=swift and shift;35017749]why would you use php though
[editline]6th March 2012[/editline]
serious question. [b][i]what[/i][/b] does PHP offer besides the abundance of cheap and nasty shared hosting?[/QUOTE]
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: [url]http://blog.motane.lu/2009/01/02/multithreading-in-php/):[/url]
[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;
}
}
?>
[/php]
[editline]6th March 2012[/editline]
[QUOTE=swift and shift;35017749]why would you use php though
[editline]6th March 2012[/editline]
serious question. [b][i]what[/i][/b] does PHP offer besides the abundance of cheap and nasty shared hosting?[/QUOTE]
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).
[QUOTE=Fizzadar;35023136]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).[/QUOTE]
[url]http://guides.rubyonrails.org/[/url]
[url]http://api.rubyonrails.org/[/url]
[url]http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2[/url]
Currently I'm working on 2 web projects: [URL="http://hacktechonline.com"]HackTech Online[/URL] and [URL="http://sellmycode.net"]SellMyCode[/URL].
HackTech is an online hacker simulation game, and SellMyCode is a website where you can buy and sell source code for software :)
SellMyCode:
[IMG]http://sellmycode.net/sellmycode.png[/IMG]
HackTech Online:
[video=youtube;rkzHhyeBmvc]http://www.youtube.com/watch?v=rkzHhyeBmvc[/video]
[QUOTE=Catdaemon;35021766]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.[/QUOTE]
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 [b]very[/b] 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.
[editline]6th March 2012[/editline]
[QUOTE=Fizzadar;35023136]
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).[/QUOTE]
PHP has the [b]most[/b] 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:
[B]do_something[/B] ( [i]void[/i] )
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.
[QUOTE=Crhem van der B;35022307]I tried that Google AppEngine thingy, which was recommended [B]here[/B] as "an ok start if you're completely new to Python's web related stuff" (not an actual quote).[/QUOTE]
Google AppEngine uses [url=http://webpy.org/]web.py[/url] 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?
[b]EDIT:[/b] Wait, why am I asking this here and not the question thread... oh well.
[QUOTE=Dragory;35027491]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?
[b]EDIT:[/b] Wait, why am I asking this here and not the question thread... oh well.[/QUOTE]
RoR is a framework for web apps. You can download it [url=http://rubyonrails.org/download]here[/url] or alternatively (my host and probably others) webhosters offer RoR already just check around your cPanel.
For starting I really liked [url]http://railsforzombies.org/[/url] 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.
[QUOTE=toaster468;35027723]RoR is a framework for web apps. You can download it [url=http://rubyonrails.org/download]here[/url] or alternatively (my host and probably others) webhosters offer RoR already just check around your cPanel.
For starting I really liked [url]http://railsforzombies.org/[/url] 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.[/QUOTE]
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.
[QUOTE=inconspicious;35008591][img]http://puu.sh/jzMk[/img]
I've ditched the unnecessary borders and backgrounds and warmed it up a little.
I think it looks better, but there is still something little off.[/QUOTE]
Can I have that background image? It looks really nice.
[QUOTE=Dragory;35027766]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.[/QUOTE]
I use [url=http://modrails.com]phusion passenger[/url] which makes deploying any rack based app as easy as deploying php.
[QUOTE=swift and shift;35030642]I use [url=http://modrails.com]phusion passenger[/url] which makes deploying any rack based app as easy as deploying php.[/QUOTE]
What a terrible website.
[QUOTE=Jelly;35031445]What a terrible website.[/QUOTE]
The only bad part is the logo
[editline]7th March 2012[/editline]
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
[img]http://s.tdoyle.me//gem-20120306-230345.png[/img]
I see this thread turning into a Ruby development discussion thread in the near future
Sorry, you need to Log In to post a reply to this thread.