By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

php vs python

P: n/a
I'm not posting this just to initiate some religious flame war, though it's
the perfect subject to do so. No, I actaully want some serious advice about
these two languages and since I think usenet is the best arena to find it,
here ya' go.

So, here's my delimna: I want to start a blog. Yeah, who doesn't. Yet, I
want learn the guts of it instead of just booting up some wordwank or
whatever. I started to learn python, but heard php was easier or faster or
more like shell scripting or... fill in the blank. Anyway, so I change over
to learning php. Then I run across that blog, Coding Horror, and start
reading articles like this:

http://www.codinghorror.com/blog/archives/001119.html

Now what? Go back to python. Soldier on with php? What do I know? Not
much. I can setup mysql and apache,, but don't know how to use 'em, really.
I use emacs and run slackware and can fumble my way through bash scripts,
but I can't really write them or do lisp. I've taken basic basic and basic
C, but am barely literate in html. Sometimes it seems overwhelming, but I
persevere because it's more fun/challenging than video games, which bore me
to tears.

Well, that's my actual question, then. Is php really so bad I'm just
wasting my time? Or is it really the quickest way to blog functionality?
Would I be better served in the long run learning python, which claims to be
easy as pie to learn/program (still looks hard to me). I admit I'm no code
geek. But, I'm not completely brain dead, either, and I need something to
keep my geezer brain sparking. What say ye?

nb
Jun 27 '08
Share this Question
Share on Google+
67 Replies


P: n/a
I V wrote:
On Sun, 25 May 2008 21:41:09 -0400, Jerry Stuckle wrote:
>The the good programmers are able to adapt to the language and make the
most of whatever language they're using. The result is good code. OTOH,
poor programmers I have known have found all kinds of excuses - from the
language itself to lack of requirements, to anything else they can
blame, except the real root of the problem.

That's true - but I wonder if there might not be differences at the
margins. Some languages (and, which is not quite the same but not easy to
fully distinguish either, the communities around some languages) may
encourage mediocre programmers to produce slightly more or less mediocre
programs.

Some features of Python (the one that really stands out for me is not
default-initializing variables on first use; the comparatively clean
standard library might be another), and some features of the Python
community (which, IME, has more members more explicitly committed to
writing clean code) I think do make Python a better environment for us
mediocre programmers.
If you set PHP to show notices, it will tell you of such cases.
However, the way I learned good programming practice was talking with
other programmers, and trying different languages. I think if you have
a real desire to write good code, and work at it, you can accomplish
your task, regardless of the language.

However, there is definitely a prevalent amount of poorly written PHP
on the Web, so it can be easy for a newcomer to pick up some bad
practices. This isn't a fault of the design of the language, though.
But maybe I'm wrong - I've never been paid to write Python programs,
whereas I have been paid to write PHP, so I might just be projecting my
frustrations with work onto the language. I've also not used PHP5 much in
anger, which does look to be a lot nicer than earlier versions.
Yeah, PHP5 is awesome, and PHP4 is dead/dying.

--
Curtis
Jun 27 '08 #51

P: n/a
Jerry Stuckle wrote:
Curtis wrote:
>Paul Rubin wrote:
>>notbob <no****@nothome.comwrites:
Well, that's my actual question, then. Is php really so bad I'm just
wasting my time? Or is it really the quickest way to blog
functionality?

php is very easy to get started with and some big sites have been
written in it. There is lots of low cost php hosting available. It
is not as good a language as Python. However, Python's advantages are
strongest in more complex projects. For simple stuff, php is frankly
less hassle just because of its wide deployment and that extensive
function library that the blog post your quoted described as a bad
thing. Python's libraries are not bad, but php's are more intensely
focused on web apps and includes what you need as part of the standard
build. With Python, if you want a database adapter or web template
framework, you have to choose between a bunch of different ones and
download and configure it which often involves head scratching when
the auto-install stuff hits some quirk of your system. With php, it's
all right there when you flip the switch.

Knowing lots of languages is good for you. php is probably your
quickest route to getting a rudimentary web app running. Python
is a longer term project. Do both.

PHP is more than capable for handling large projects, not just small
scripting jobs. However, Paul's right about PHP being more driven
toward web development, where as Python may be better for different
types of apps.

Even then, I think your first reply was best, it just comes down to
what you have more fun writing. Both languages are equally capable of
getting the job done.

--
Curtis

Not true. PHP is quite capable of writing large, non-web based
projects. While it's non-browser based display capabilities are
somewhat lacking (although there are third party libraries which help a
lot), I've written some pretty complicated batch scripts in the past.
Yeah, I see I may have spoken too soon. When I think about it, the PHP
extensions available do cover a lot of ground. I've played around with
php-gtk in the past, but nothing major.

To clarify: what I meant to say is that php is especially well suited
for web development, I didn't mean that it wasn't capable of doing
non-web based development.

--
Curtis
Jun 27 '08 #52

P: n/a
Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>As I've said before - good programmers can write good code in any
language.
Yes, they can. But it may be harder to do for them in one language and
easier in another.
It's obvious lie. If you have clear mind and you know language you're using,
there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good code, it's
as easy as writing bad code. And yes, I do see the difference.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jun 27 '08 #53

P: n/a
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>>As I've said before - good programmers can write good code in any
language.
>Yes, they can. But it may be harder to do for them in one language and
easier in another.

It's obvious lie. If you have clear mind and you know language you're
using, there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good code,
it's as easy as writing bad code. And yes, I do see the difference.
No. Language does matter.
Jun 27 '08 #54

P: n/a
On Wed, 28 May 2008 01:32:24 +0000, Ivan Illarionov wrote:
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>>>As I've said before - good programmers can write good code in any
language.
>>Yes, they can. But it may be harder to do for them in one language and
easier in another.

It's obvious lie. If you have clear mind and you know language you're
using, there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good code,
it's as easy as writing bad code. And yes, I do see the difference.

No. Language does matter.
I want to add
TROLL WARNING:
this message is cross-posted between comp.lang.python and comp.lang.php
Let's stop.
Jun 27 '08 #55

P: n/a
Ivan Illarionov wrote:
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>>>As I've said before - good programmers can write good code in any
language.
Yes, they can. But it may be harder to do for them in one language and
easier in another.
It's obvious lie. If you have clear mind and you know language you're
using, there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good code,
it's as easy as writing bad code. And yes, I do see the difference.

No. Language does matter.
Not for a good programmer. Only for half-assed ones.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '08 #56

P: n/a
On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote:
Ivan Illarionov wrote:
>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>>Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,

As I've said before - good programmers can write good code in any
language.
Yes, they can. But it may be harder to do for them in one language
and easier in another.
It's obvious lie. If you have clear mind and you know language you're
using, there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good
code, it's as easy as writing bad code. And yes, I do see the
difference.

No. Language does matter.

Not for a good programmer. Only for half-assed ones.
No. Language does matter
Jun 27 '08 #57

P: n/a
Ivan Illarionov wrote:
On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote:
>Ivan Illarionov wrote:
>>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:

Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,

>As I've said before - good programmers can write good code in any
>language.
Yes, they can. But it may be harder to do for them in one language
and easier in another.
It's obvious lie. If you have clear mind and you know language you're
using, there are absolutely NOTHING can deny you to write clear code.
Even using forth postfix notation, I have no problem writing good
code, it's as easy as writing bad code. And yes, I do see the
difference.
No. Language does matter.
Not for a good programmer. Only for half-assed ones.

No. Language does matter
Only to half-assed programmers. Good programmers can write good code in
any language they know.

Ever seen good assembler? It can be done - really! Also fortran,
cobol, forth... the list goes on.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '08 #58

P: n/a
On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote:
Ivan Illarionov wrote:
>On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote:
>>Ivan Illarionov wrote:
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:

Greetings, Ivan Illarionov.
In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>
>>As I've said before - good programmers can write good code in any
>>language.
>Yes, they can. But it may be harder to do for them in one language
>and easier in another.
It's obvious lie. If you have clear mind and you know language
you're using, there are absolutely NOTHING can deny you to write
clear code. Even using forth postfix notation, I have no problem
writing good code, it's as easy as writing bad code. And yes, I do
see the difference.
No. Language does matter.
Not for a good programmer. Only for half-assed ones.

No. Language does matter

Only to half-assed programmers. Good programmers can write good code in
any language they know.

Ever seen good assembler? It can be done - really! Also fortran,
cobol, forth... the list goes on.
Yeah,
mov eax, Jerry
mov killfile, eax
Jun 27 '08 #59

P: n/a
Ivan Illarionov wrote:
On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote:
>Ivan Illarionov wrote:
>>On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote:

Ivan Illarionov wrote:
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>
>Greetings, Ivan Illarionov.
>In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>>
>>>As I've said before - good programmers can write good code in any
>>>language.
>>Yes, they can. But it may be harder to do for them in one language
>>and easier in another.
>It's obvious lie. If you have clear mind and you know language
>you're using, there are absolutely NOTHING can deny you to write
>clear code. Even using forth postfix notation, I have no problem
>writing good code, it's as easy as writing bad code. And yes, I do
>see the difference.
No. Language does matter.
Not for a good programmer. Only for half-assed ones.
No. Language does matter
Only to half-assed programmers. Good programmers can write good code in
any language they know.

Ever seen good assembler? It can be done - really! Also fortran,
cobol, forth... the list goes on.

Yeah,
mov eax, Jerry
mov killfile, eax
Stoopid troll. But we already know you can't write good code. No
surprise there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '08 #60

P: n/a
Ivan Illarionov <iv*************@gmail.comwrote:
>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>In reply to Your message dated Monday, May 26, 2008, 04:47:00,
>>>As I've said before - good programmers can write good code in any
language.
>>Yes, they can. But it may be harder to do for them in one language and
easier in another.
...
No. Language does matter.
A good programmer keeps many tools in his toolbox, and understands which
tools provide the best service for the problem at hand.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jun 27 '08 #61

P: n/a
..oO(Ivan Illarionov)
>No. Language does matter.
And the weather.

If you know how to program, you can write good code in any language if
you're familiar enough with it. Many people write good code in PHP, and
many write total crap in C/C++. It's almost never about the language,
but about the programmer.

Micha
Jun 27 '08 #62

P: n/a
On May 28, 1:42 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ivan Illarionov)
No. Language does matter.

And the weather.

If you know how to program, you can write good code in any language if
you're familiar enough with it. Many people write good code in PHP, and
many write total crap in C/C++. It's almost never about the language,
but about the programmer.

Micha
I'd like to see someone coming from an OO programming background write
good Haskell, Pure Functional Programming code even with a high level
of OO experience. Language matters.
Jun 27 '08 #63

P: n/a
On Wed, 28 May 2008 06:04:54 +0000, Tim Roberts wrote:
Ivan Illarionov <iv*************@gmail.comwrote:
>>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote:
>>In reply to Your message dated Monday, May 26, 2008, 04:47:00,

As I've said before - good programmers can write good code in any
language.

Yes, they can. But it may be harder to do for them in one language
and easier in another.
...
No. Language does matter.

A good programmer keeps many tools in his toolbox, and understands which
tools provide the best service for the problem at hand.
Agree, I keep Python, C and x86 assembly in my toolbox. And this toolbox
is perfect.

Actually, even PHP has its place in my toolbox, but, *only when I can't
use Python*, eg Sourceforge.net servers don't have good Python support
and PHP starts to make sense.

Language matters.

Ivan
Jun 27 '08 #64

P: n/a
co*********@gmail.com wrote:
On May 28, 1:42 pm, Michael Fesser <neti...@gmx.dewrote:
>.oO(Ivan Illarionov)
>>No. Language does matter.
And the weather.

If you know how to program, you can write good code in any language if
you're familiar enough with it. Many people write good code in PHP, and
many write total crap in C/C++. It's almost never about the language,
but about the programmer.

Micha

I'd like to see someone coming from an OO programming background write
good Haskell, Pure Functional Programming code even with a high level
of OO experience. Language matters.
Actually, I think it would be easier than a functional programmer
converting to an OO paradigm.

And the caveat was *if you're familiar enough with it*.

A good OO programmer could easily write good functional code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '08 #65

P: n/a
Jerry Stuckle <js*******@attglobal.netwrites:
A good OO programmer could easily write good functional code.
Over on #haskell there's a general belief that learning Haskell is
easier for nonprogrammers than it is for OO programmers, since the OO
programmers first have to unlearn what they previously knew.
Jun 27 '08 #66

P: n/a
Flaming Thunder is teh awesome! :P
Jun 27 '08 #67

P: n/a
A good OO programmer could easily write good functional code.

You are aware that functional programming is *not* procedural or imperative
programming?

http://en.wikipedia.org/wiki/Functional_programming

OO is *heavily* depending on state and state modification. I've seen OO
programmers weep over functional programming assignments. Which is not to
say that FP is in any sense bad - au contraire, knowing it is important
because it is a different school of thought that's very valuable to know
of. And Python allows for many of the FP concepts to be used. See map,
filter and other HOFs.

Diez
Jun 27 '08 #68

67 Replies

This discussion thread is closed

Replies have been disabled for this discussion.