473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

php vs python

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
67 2169
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
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
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
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
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
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
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
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
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
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
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
..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
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
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
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
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
Flaming Thunder is teh awesome! :P
Jun 27 '08 #67
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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.