By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 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 #1
Share this Question
Share on Google+
67 Replies


P: n/a
notbob wrote:
I
persevere because it's more fun/challenging than video games

This is the crux of the matter from where I'm sitting. If the purpose of
learning a programming language is fun, then the primary relevant question
is:

Is it more fun to code in Python or PHP?

The answer is a no-brainer for me. It seems to me that Python is designed
from the ground up with my enjoyment in mind. Your Fun May Vary :-)
Jeffrey
Jun 27 '08 #2

P: n/a
On May 21, 4:10 pm, notbob <not...@nothome.comwrote:
Sometimes it seems overwhelming, but I
persevere because it's more fun/challenging than video games, which bore me
to tears.
Ha, exactly the opposite here.
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?
If you just want to write a simple blog, PHP is probably good enough.
It's undeniably easier to jump into web programming with PHP--
partially because of it's widespread support and straightforward
usage, partially because Python web solutions tend to aim for
separability of content and presenation which raises the bar for
entry--and that could easily outweigh your concerns over quality of
the language.

(Incidentally: if you didn't want to start a religious war, it would
have been better if you had posted it separately to the two groups.
Lots of flamewars start by one person posting a cutdown not intended
for the ears of the other group.)
Carl Banks
Jun 27 '08 #3

P: n/a
On 2008-05-21, Michael Vilain <vi****@NOspamcop.netwrote:
your site. They may even have a blogging package you can administer
entries without any programming.

What's your end-goal here? If you can't program, you may be better off
with a package or tool that does all the heavy lifting for you.
I said I didn't want to do that, but that's not entirely true. I figured
I'd use one of the CMSs while learning how it works, much like linux. I
hate doing something without knowing why. Windows and Dreamweaver are good
examples. Nope. I want to get under the hood.

nb
Jun 27 '08 #4

P: n/a
On 2008-05-21, Carl Banks <pa************@gmail.comwrote:
If you just want to write a simple blog, PHP is probably good enough.
It's undeniably easier to jump into web programming with PHP--
partially because of it's widespread support and straightforward
usage, partially because Python web solutions tend to aim for
separability of content and presenation which raises the bar for
entry--and that could easily outweigh your concerns over quality of
the language.

(Incidentally: if you didn't want to start a religious war, it would
have been better if you had posted it separately to the two groups.
Lots of flamewars start by one person posting a cutdown not intended
for the ears of the other group.)
Yeah, but years of usenet have taught me how to navigate the battlefield.
Your top paragraph above is the kind of advice I'm looking for. Thank you.

nb
Jun 27 '08 #5

P: n/a
On 2008-05-21, Damon Getsman <dg******@amirehab.netwrote:
My suggestion, if you want to keep that gray meat sparking, is to go
with only html & php. You could have the php dumping your entries
into date/time named textfiles on there when you're writing, and when
someone is reading, it just orders them sequentially by the date &
time in their filenames.

Then again, you learn the HTML+PHP+MySQL thing and you've got a skill
that you can market on Craigslist to a bunch of people for $20/hr
+. :)
That certainly couldn't hurt. Thank you for your advice.

nb
Jun 27 '08 #6

P: n/a
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.
Jun 27 '08 #7

P: n/a
On May 21, 11:10*pm, notbob <not...@nothome.comwrote:
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 fasteror
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, butI
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
By the way anything goes to you..
Jun 27 '08 #8

P: n/a
On May 22, 6:10 am, notbob <not...@nothome.comwrote:
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?
Python has 71 built in functions (in 2.5). Atwood's list of PHP built
ins beginning with 'a' is 124 functions long.

There's a clear reason why people say Python "fits your brain" :)
Jun 27 '08 #9

P: n/a
notbob wrote:
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
Check out the Pylons blog tutorial. You will have a simple blog up and running
in less than 30 minutes and have a platform to extend it with as much
functionality as you want later on.

Larry Bates

Pylons blog tutorial:

http://wiki.pylonshq.com/display/pyl...+a+Pylons+Blog
Jun 27 '08 #10

P: n/a
NC
On May 21, 1:10 pm, notbob <not...@nothome.comwrote:
>
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.
Here's a simple computation to consider... WordPress' codebase is
approximately a megabyte of PHP code and megabyte of JavaScript code.
Assuming that the average line of that code is 50 characters long, you
are looking at 20,000 lines of code in PHP and as many in JavaScript.
Based on the notion that the average developer out there writes 100
lines a day, either you're in for a two-year project or your product
is going to have seriously reduced functionality compared to something
that's been freely available for years. What's your choice?
Then I run across that blog, Coding Horror, and start reading
articles like this:

http://www.codinghorror.com/blog/archives/001119.html
You should read what some computer scientists write about SQL... :)
Now what?
Nothing. Everyone is entitled to their opinion. You are free to form
your own.
I've taken basic basic and basic C, but am barely literate
in html.
Maybe that (and some JavaScript) is something to work on first before
delving into server-side programming?
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?
The quickest way to blog functionality is an account on a blogging
service... :)
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?
If the purpose is to keep the brain sparking, it doesn't matter what
you learn as long as you're enjoying the process. You might as well
take up Japanese while you're at it...

Cheers,
NC
Jun 27 '08 #11

P: n/a
Damon Getsman <dg******@amirehab.netwrote:
PHP has great support for accessing a MySQL database,
Actually I'd say PHP's mysql support is lacking a very important
feature. mysql_query() doesn't support parameters (or placeholders,
usually '?') which means that unless you use
mysql_real_escape_string() on all user input you are leaving yourself
wide open for SQL injection attacks.

With all the other non-PHP mysql programming I've done you use
parameters for all user input and you don't have to worry.

It is not a big deal, but I've had it drummed into me to always use
parameters for user input and I was really suprised PHP didn't have
them.

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jun 27 '08 #12

P: n/a
On 2008-05-22, Larry Bates <la*********@websafe.com`wrote:
Check out the Pylons blog tutorial. You will have a simple blog up and running
in less than 30 minutes and have a platform to extend it with as much
functionality as you want later on.

Larry Bates

Pylons blog tutorial:

http://wiki.pylonshq.com/display/pyl...+a+Pylons+Blog
Thnx, Larry. FYI: the above page doesn't exist:

"The page you were trying to reach does not exist. You may want to try a
search, or browse the site to find the page you were looking for."

.....but, there's a link to a pylons cookbook, which I will explore.

nb
Jun 27 '08 #13

P: n/a
On 2008-05-21, Paul Rubin <httpwrote:
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.
Good advice. Thank you.

nb
Jun 27 '08 #14

P: n/a
On May 21, 3:10*pm, notbob <not...@nothome.comwrote:
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 fasteror
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, butI
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
TurboGears and Django are pretty cool Python web application
frameworks. I would recommend looking at them too.

Mike
Jun 27 '08 #15

P: n/a
PHP can do that. There are also a number of templating engines
available. The nice thing about PHP is you have a choice.
i just meant that php is sort of invented to combine html and code, so if
you use python instead you should use a templating engine. but i suppose
it's useful for php too.
Jun 27 '08 #16

P: n/a
..oO(Nick Craig-Wood)
>Damon Getsman <dg******@amirehab.netwrote:
>PHP has great support for accessing a MySQL database,

Actually I'd say PHP's mysql support is lacking a very important
feature. mysql_query() doesn't support parameters (or placeholders,
usually '?')
Where were you the last couple of years? It's lacking a lot more
features, but that's not the fault of the MySQL extension, which is
quite old. Meanwhile we have the improved MySQL extension and PDO.
>It is not a big deal, but I've had it drummed into me to always use
parameters for user input and I was really suprised PHP didn't have
them.
PHP supports them since _years_, you just have to choose the right
database interface.

Micha
Jun 27 '08 #17

P: n/a
notbob wrote:
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
Personally, I believe PHP would get you more productive more quickly for
a blog, but it is a potentially brain damaging language in terms of
really getting your juices flowing with programming. It is not a
general purpose language and suffers from all the limitations of of a
tool designed for one job. If you are interested in programming and the
blog is your path to that, stick with Python! In particular, immerse
yourself in mod_python or look at a framework like Django or Pylons --
the learning curve is steep for any of these technologies but they are a
full meal compared to saltine cracker and water of PHP.
Jun 27 '08 #18

P: n/a
Andrew Lee schreef:
notbob wrote:
>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

Personally, I believe PHP would get you more productive more quickly for
a blog, but it is a potentially brain damaging language in terms of
really getting your juices flowing with programming. It is not a
general purpose language and suffers from all the limitations of of a
tool designed for one job. If you are interested in programming and the
blog is your path to that, stick with Python! In particular, immerse
yourself in mod_python or look at a framework like Django or Pylons --
the learning curve is steep for any of these technologies but they are a
full meal compared to saltine cracker and water of PHP.
Some statement Andrew.
Care to clarify that a little?
I don't know much Python (aside from a little in ZOPE), but I did a lot
of Java, Perl, VB/ASP (juck), and a little C before I learned PHP.
I stopped using all in favor of PHP.

If your statement says PHP is abused a lot, yes. Because it is
relatively easy to learn for new programmers, a lot of bad PHP coders
exist.
But I saw them too in Java/Perl/etc.
And I am sure you can find them too coding Python.

It is perfectly possible to write clean good code in PHP.

Why do you say it 'tastes less' then Python?
I don't want to start a religious war, but am curious.
Who knows, maybe I'll dump PHP and start using Python after your
answer. ;-)

Regards,
Erwin Moller
Jun 27 '08 #19

P: n/a
inhahe wrote:
>PHP can do that. There are also a number of templating engines
available. The nice thing about PHP is you have a choice.

i just meant that php is sort of invented to combine html and code, so if
you use python instead you should use a templating engine. but i suppose
it's useful for php too.

Not at all. With PHP, it's possible to do so, but not required. With
Python, OTOH, you pretty much have to use a templating engine.

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

P: n/a
Andrew Lee wrote:
notbob wrote:
>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

Personally, I believe PHP would get you more productive more quickly for
a blog, but it is a potentially brain damaging language in terms of
really getting your juices flowing with programming. It is not a
general purpose language and suffers from all the limitations of of a
tool designed for one job. If you are interested in programming and the
blog is your path to that, stick with Python! In particular, immerse
yourself in mod_python or look at a framework like Django or Pylons --
the learning curve is steep for any of these technologies but they are a
full meal compared to saltine cracker and water of PHP.
And what job is that? I have a lot of batch scripts written in PHP, for
instance.

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

P: n/a
..oO(Andrew Lee)
>Personally, I believe PHP would get you more productive more quickly for
a blog, but it is a potentially brain damaging language in terms of
really getting your juices flowing with programming. It is not a
general purpose language
Please elaborate.
>and suffers from all the limitations of of a
tool designed for one job.
Please elaborate.

And what "one" job are you talking about? There are many things possible
with PHP: web apps, shell scripts, daemons, GUI apps ...
>If you are interested in programming and the
blog is your path to that, stick with Python!
<flame>Where whitespace is more important than the code.</flame>

Seriously, it's just a question of personal taste and preferences. In
terms of capabilities there's absolutely no difference between PHP and
Python. You need a good understanding of programming in general for
both, the rest is just syntax and the available standard libraries.
>In particular, immerse
yourself in mod_python or look at a framework like Django or Pylons --
the learning curve is steep for any of these technologies but they are a
full meal compared to saltine cracker and water of PHP.
If you don't like PHP, that's perfectly OK. But you should accept that
it's only a tool and just as good as the one who uses it. For me and
many others it's a quite good language, we're able to write clean and
efficient code with it in a rather short time.

PHP is much more than just crackers and water. Of course you should know
how to cook.

Micha
Jun 27 '08 #22

P: n/a
Erwin Moller
<Si******************************************@spam yourself.comwrote:
Why do you say it 'tastes less' then Python?
I don't want to start a religious war, but am curious.
Who knows, maybe I'll dump PHP and start using Python after your
answer. ;-)
I may not be a good person to answer this since I don't know PHP: I don't
have any religious objection to it, but I just never found it intuitive in
the way I found Python fits my mindset.

On those rare occasions when I've helped someone who wanted advice I've
found that my Python oriented viewpoint can be quite hard to translate to
PHP. For example I'd suggest 'oh you just encode that as utf8' only to be
told that there's no easy way to do that (have just Google'd it looks like
there is now a way to do that but with a big red warning about it being
EXPERIMENTAL and only use at your own risk).

(Looking at the example given for unicode_encode it appears to depend for
its working on a global setting which isn't included in the example. I may
have misunderstood the example but if I read that correctly its a good
example of why PHP doesn't fit my brain.)

Anyway Google should find you plenty of articles comparing the languages.
I'd say you use whichever feels right to you. I would also suggest you
should try Python at least a bit (but since I don't intend to do the same
for PHP you may not count my advice for much).

I found these pretty quickly:

http://python.about.com/od/gettingst...ispython_4.htm
http://wiki.w4py.org/python-vs-php.html
--
Duncan Booth http://kupuguy.blogspot.com
Jun 27 '08 #23

P: n/a
..oO(Duncan Booth)
>On those rare occasions when I've helped someone who wanted advice I've
found that my Python oriented viewpoint can be quite hard to translate to
PHP. For example I'd suggest 'oh you just encode that as utf8' only to be
told that there's no easy way to do that (have just Google'd it looks like
there is now a way to do that but with a big red warning about it being
EXPERIMENTAL and only use at your own risk).

(Looking at the example given for unicode_encode it appears to depend for
its working on a global setting which isn't included in the example. I may
have misunderstood the example but if I read that correctly its a good
example of why PHP doesn't fit my brain.)
The only little problem is that PHP doesn't have native Unicode support
yet, which will change with PHP 6. But of course you can still use UTF-8
without any trouble, I do it all the time. You just have to keep in mind
that many string functions still work on bytes, not on characters, but
this can almost always be solved with the Multibyte extension. Apart
from that there's no problem with PHP and UTF-8. It's also easily
possible to convert between various encodings using the iconv extension.

Micha
Jun 27 '08 #24

P: n/a
Michael Fesser <ne*****@gmx.dewrote:
.oO(Duncan Booth)
>>On those rare occasions when I've helped someone who wanted advice
I've found that my Python oriented viewpoint can be quite hard to
translate to PHP. For example I'd suggest 'oh you just encode that as
utf8' only to be told that there's no easy way to do that (have just
Google'd it looks like there is now a way to do that but with a big
red warning about it being EXPERIMENTAL and only use at your own
risk).

(Looking at the example given for unicode_encode it appears to depend
for its working on a global setting which isn't included in the
example. I may have misunderstood the example but if I read that
correctly its a good example of why PHP doesn't fit my brain.)

The only little problem is that PHP doesn't have native Unicode
support yet, which will change with PHP 6. But of course you can still
use UTF-8 without any trouble, I do it all the time. You just have to
keep in mind that many string functions still work on bytes, not on
characters, but this can almost always be solved with the Multibyte
extension. Apart from that there's no problem with PHP and UTF-8. It's
also easily possible to convert between various encodings using the
iconv extension.
As I remember it the problem was that the data was stored in a database
in latin-1 but the HTML page had to be in utf-8 (because the rest of the
server and therefore all the page skins were already in utf-8). In
python that would be a trivial conversion but I was told that in PHP it
wasn't.

Also it was PHP4 and as I understand it updating to a more recent
version was non-trivial. Of course sometimes updating Python code to a
newer version is also non-trivial: Zope in particular is very version
specific but in most cases anything written in pure Python will be
compatible with more recent versions.

But one small example isn't really the point. It's that the whole way
Python works seems *to me* to make sense and (mostly) fits together
cleanly and consistently. YMMV

--
Duncan Booth http://kupuguy.blogspot.com
Jun 27 '08 #25

P: n/a
..oO(Duncan Booth)
>Michael Fesser <ne*****@gmx.dewrote:
>The only little problem is that PHP doesn't have native Unicode
support yet, which will change with PHP 6. But of course you can still
use UTF-8 without any trouble, I do it all the time. You just have to
keep in mind that many string functions still work on bytes, not on
characters, but this can almost always be solved with the Multibyte
extension. Apart from that there's no problem with PHP and UTF-8. It's
also easily possible to convert between various encodings using the
iconv extension.
As I remember it the problem was that the data was stored in a database
in latin-1 but the HTML page had to be in utf-8 (because the rest of the
server and therefore all the page skins were already in utf-8). In
python that would be a trivial conversion but I was told that in PHP it
wasn't.
It would have been trivial in PHP as well, assuming the DB was MySQL,
which could have done this conversion automatically when sending the
data to the script.
>But one small example isn't really the point. It's that the whole way
Python works seems *to me* to make sense and (mostly) fits together
cleanly and consistently. YMMV
Fair enough. The nature of PHP as being a grown language has its
advantages, but also a lot of drawbacks, which are hard to solve.

Micha
Jun 27 '08 #26

P: n/a
Michael Fesser <ne*****@gmx.dewrites:
you don't like PHP, that's perfectly OK. But you should accept that
it's only a tool and just as good as the one who uses it. For me and
many others it's a quite good language, we're able to write clean and
efficient code with it in a rather short time.
I'm sure that anyone who is competent enough can write clean code in
any language (in the case of PHP, I am only familiar with one
significant example: I use and have written a few simple extensions
for mediawiki, and I find it quite easy to understand and navigate the
code).

However, while I feel that most languages are quite neutral about
this, I find that Python *encourages* me to write better code. In
other words, Python is not only a tool, it's also a lovely language.

Languages are a bit like shoes. You probably wouldn't want to wear the pair
I'm most comfortable in!

--
Arnaud
Jun 27 '08 #27

P: n/a
Lie
On May 22, 12:28*pm, NC <n...@iname.comwrote:
On May 21, 1:10 pm, notbob <not...@nothome.comwrote:
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.

Here's a simple computation to consider... *WordPress' codebase is
approximately a megabyte of PHP code and megabyte of JavaScript code.
Assuming that the average line of that code is 50 characters long, you
are looking at 20,000 lines of code in PHP and as many in JavaScript.
Based on the notion that the average developer out there writes 100
lines a day, either you're in for a two-year project or your product
is going to have seriously reduced functionality compared to something
that's been freely available for years. *What's your choice?
Nope, the core functionality of a blogging software could be
replicated in just a few lines of PHP codes, in the range of tens to
hundreds of lines. If you're creating your own blogging software, you
wouldn't seriously think you'd recreate all those things such as
pingbacks, commenting system, etc, etc, etc. No, you'd start with some
basic core functionalities: a few simple server side includes only.
Jun 27 '08 #28

P: n/a
Lie
On May 22, 3:10*am, notbob <not...@nothome.comwrote:
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 fasteror
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, butI
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
My advice? Mix a bit of both. PHP's pros is it's tight integration
with HTML, it's really easy to slip small, short PHP snippets here and
there. Server side includes for example, is a short one-liner, in
python it would involve reading the original file, finding where and
what to slip, then reading the include file then concatenates the
files then send it to the requester, or you could setup an engine for
you which might take some time and patience.

On the other hand, python is a general-purpose language, and is a
better designed language. Writing the blog back-end in Python is
probably easier than in PHP while writing the interface-related codes
is probably easier in PHP. You might also consider calling python code
from the PHP.
Jun 27 '08 #29

P: n/a
Lie wrote:
On May 22, 12:28 pm, NC <n...@iname.comwrote:
>On May 21, 1:10 pm, notbob <not...@nothome.comwrote:
>>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.
Here's a simple computation to consider... WordPress' codebase is
approximately a megabyte of PHP code and megabyte of JavaScript code.
Assuming that the average line of that code is 50 characters long, you
are looking at 20,000 lines of code in PHP and as many in JavaScript.
Based on the notion that the average developer out there writes 100
lines a day, either you're in for a two-year project or your product
is going to have seriously reduced functionality compared to something
that's been freely available for years. What's your choice?

Nope, the core functionality of a blogging software could be
replicated in just a few lines of PHP codes, in the range of tens to
hundreds of lines. If you're creating your own blogging software, you
wouldn't seriously think you'd recreate all those things such as
pingbacks, commenting system, etc, etc, etc. No, you'd start with some
basic core functionalities: a few simple server side includes only.
As he said - it's either a two man-year project or your product is going
to have seriously reduced functionality. It looks like you are opting
for the latter.

Also, you still need to write the server-side includes. But they won't
do nearly enough for everything WordPress does.

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

P: n/a
Jerry Stuckle wrote:
Lie wrote:
On May 22, 12:28 pm, NC <n...@iname.comwrote:
On May 21, 1:10 pm, notbob <not...@nothome.comwrote:
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.
Here's a simple computation to consider... *WordPress' codebase is
approximately a megabyte of PHP code and megabyte of JavaScript code.
Assuming that the average line of that code is 50 characters long, you
are looking at 20,000 lines of code in PHP and as many in JavaScript.
Based on the notion that the average developer out there writes 100
lines a day, either you're in for a two-year project or your product
is going to have seriously reduced functionality compared to something
that's been freely available for years. *What's your choice?
Nope, the core functionality of a blogging software could be
replicated in just a few lines of PHP codes, in the range of tens to
hundreds of lines. If you're creating your own blogging software, you
wouldn't seriously think you'd recreate all those things such as
pingbacks, commenting system, etc, etc, etc. No, you'd start with some
basic core functionalities: a few simple server side includes only.

As he said - it's either a two man-year project or your product is going
to have seriously reduced functionality. *It looks like you are opting
for the latter.

Also, you still need to write the server-side includes. *But they won't
do nearly enough for everything WordPress does.
If the OP wants to learn the guts of the blog or to implement the blog
from scratch, Python/Django would be a better choice than PHP. The
reason is that he can reuse and customize existing high quality
components for all these auth/auth, admin, comments, etc, etc, etc.
Another reason is that Python and Django encourage very clean design
while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
PHP wrapped in spaghetti HTML". 2 man/year in PHP == 2 man/week in
Python/Django.

And there are Python/Django blog applications that already do almost
everything (and maybe more) that WordPress does. http://byteflow.su/
is one of them (IMHO the most promising).

Ivan

Jun 27 '08 #31

P: n/a
Ivan Illarionov wrote:
Jerry Stuckle wrote:
>Lie wrote:
>>On May 22, 12:28 pm, NC <n...@iname.comwrote:
On May 21, 1:10 pm, notbob <not...@nothome.comwrote:
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.
Here's a simple computation to consider... WordPress' codebase is
approximately a megabyte of PHP code and megabyte of JavaScript code.
Assuming that the average line of that code is 50 characters long, you
are looking at 20,000 lines of code in PHP and as many in JavaScript.
Based on the notion that the average developer out there writes 100
lines a day, either you're in for a two-year project or your product
is going to have seriously reduced functionality compared to something
that's been freely available for years. What's your choice?
Nope, the core functionality of a blogging software could be
replicated in just a few lines of PHP codes, in the range of tens to
hundreds of lines. If you're creating your own blogging software, you
wouldn't seriously think you'd recreate all those things such as
pingbacks, commenting system, etc, etc, etc. No, you'd start with some
basic core functionalities: a few simple server side includes only.
As he said - it's either a two man-year project or your product is going
to have seriously reduced functionality. It looks like you are opting
for the latter.

Also, you still need to write the server-side includes. But they won't
do nearly enough for everything WordPress does.

If the OP wants to learn the guts of the blog or to implement the blog
from scratch, Python/Django would be a better choice than PHP. The
reason is that he can reuse and customize existing high quality
components for all these auth/auth, admin, comments, etc, etc, etc.
Another reason is that Python and Django encourage very clean design
while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
PHP wrapped in spaghetti HTML". 2 man/year in PHP == 2 man/week in
Python/Django.
You can do the same in PHP. And PHP doesn't create spaghetti code -
programmers do. Good programmers write good code in any language. Poor
programmers write lousy code - in any language.

And I'd love to see you write WordPress in 2 weeks in Python. That's
about 2K LOC. Can't be done with the same functionality - unless you
have some 50K lines.

It's going to be very close to the same 2 man years that PHP takes.
And there are Python/Django blog applications that already do almost
everything (and maybe more) that WordPress does. http://byteflow.su/
is one of them (IMHO the most promising).

Ivan
And there are many CMS's written in PHP which do much more than
WordPress does. Drupal, Joomla and Mambo come to mind.

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

P: n/a
NC
On May 25, 11:46 am, Ivan Illarionov <ivan.illario...@gmail.com>
wrote:
>
If the OP wants to learn the guts of the blog or to implement
the blog from scratch, Python/Django would be a better choice
than PHP. The reason is that he can reuse and customize existing
high quality components for all these auth/auth, admin, comments,
etc, etc, etc.
You are comparing apples to oranges... There are application
frameworks
for PHP as well (CakePHP and Symfony come to mind). CakePHP, if
memory
serves, actually has a development of a blog described in its
tutorial...
Another reason is that Python and Django encourage very clean design
while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
PHP wrapped in spaghetti HTML".
It's absolutely the same thing with PHP frameworks...
2 man/year in PHP == 2 man/week in Python/Django.
This, I daresay, is an exaggeration... Let's take your own example:
And there are Python/Django blog applications that already do almost
everything (and maybe more) that WordPress does.http://byteflow.su/
is one of them (IMHO the most promising).
A quick look at the revision log:

http://byteflow.su/log/

reveals that the initial commit of 60 or so files has been done on
08/14/07
(10 months ago), a second developer came on board 12/01/07 (seven+
months ago),
a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
(also
six+ months ago). There are at least nine discernible contributors
overall.
Say what you will, but it still looks an awful lot like like two man-
years,
Django or no Django...

Cheers,
NC
Jun 27 '08 #33

P: n/a
On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
[...]
A quick look at the revision log:

http://byteflow.su/log/

reveals that the initial commit of 60 or so files has been done on
08/14/07
(10 months ago), a second developer came on board 12/01/07 (seven+
months ago),
a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
(also
six+ months ago). There are at least nine discernible contributors
overall.
Say what you will, but it still looks an awful lot like like two man-
years,
Django or no Django...
I bet that if they did this with PHP framework they where far from where
they are now.

I didn't say that it's not possible to write good code in PHP, I said
that Python and Django encourage cleaner code more than PHP and PHP
frameworks do.

IMHO Python language is better designed and this influences everything
written in it.

Yes, it's possible to write something clean in PHP but it would require a
lot more work.

Ivan
Jun 27 '08 #34

P: n/a
Ivan Illarionov wrote:
On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
[...]
>A quick look at the revision log:

http://byteflow.su/log/

reveals that the initial commit of 60 or so files has been done on
08/14/07
(10 months ago), a second developer came on board 12/01/07 (seven+
months ago),
a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
(also
six+ months ago). There are at least nine discernible contributors
overall.
Say what you will, but it still looks an awful lot like like two man-
years,
Django or no Django...

I bet that if they did this with PHP framework they where far from where
they are now.
Yep, I'd bet they would be much further along.
I didn't say that it's not possible to write good code in PHP, I said
that Python and Django encourage cleaner code more than PHP and PHP
frameworks do.
I repeat. The language has nothing to do with it. Good programmers
write good code. Lousy programmers write bad code.
IMHO Python language is better designed and this influences everything
written in it.
A lot of people don't share the opinion that it is "better designed".
Yes, it's possible to write something clean in PHP but it would require a
lot more work.
Not at all. I do it every day.

And BTW - yes, I write Python, also. But I find I can write better,
faster code in PHP.

Do you write PHP?
Ivan


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

P: n/a
On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
Not at all. I do it every day.

And BTW - yes, I write Python, also. But I find I can write better,
faster code in PHP.
I find I can write better code in Python. Maybe it's just a matter of
personal preference?
Do you write PHP?
I did. And I hated it very much. I hated it so much that even I had few
Python scripts that generated PHP for me when it was possible.

Jun 27 '08 #36

P: n/a
NC
On May 25, 1:55 pm, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
A quick look at the revision log:
http://byteflow.su/log/
reveals that the initial commit of 60 or so files has been done
on 08/14/07 (10 months ago), a second developer came on board
12/01/07 (seven+ months ago), a third one, on 01/04/08 (six+
months ago), a fourth one, on 01/16/08 (also six+ months ago).
There are at least nine discernible contributors overall. Say
what you will, but it still looks an awful lot like like two
man-years, Django or no Django...

I bet that if they did this with PHP framework they where far
from where they are now.
The question is, which way? :) Jerry Stuckle, with whom I
wholeheartedly argue about half the time we post to the same threads
and argue bitterly the other half of the time, thinks they would be
ahead of where they are now... :)
I didn't say that it's not possible to write good code in PHP,
Indeed you didn't. You did, however, say that development in Python/
Django is inherently faster than development in PHP (your exact words
were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
50-fold difference). This claim has just been obliterated using the
example you (not I) provided; my estimate of two man-years for
developing WordPress turns out to be fairly close to what has actually
gone into the development of Byteflow. In other words, so far we have
discovered no evidence of Python's (or PHP's, to be fair) superiority
in terms of developer's productivity.
IMHO Python language is better designed
That is indeed a matter of opinion. You like (among other things)
immutable strings, the off-side rule, the idea that everything is an
object, and the fine distinction between mutable lists and immutable
tuples, and I have no problem with you liking these features, as long
as you agree that other people may have reasons to like the
alternatives better.
Yes, it's possible to write something clean in PHP but it
would require a lot more work.
In my opinion, it wouldn't, and in my experience, it doesn't. All you
need is to actually put a designer in charge of design. Additionally,
there are situations (rapid prototyping, for example) when
maintainability (the requirement behind the "clean code") is simply
not a concern.

Cheers,
NC
Jun 27 '08 #37

P: n/a
On Sun, 25 May 2008 16:23:12 -0700, NC wrote:
>I didn't say that it's not possible to write good code in PHP,

Indeed you didn't. You did, however, say that development in Python/
Django is inherently faster than development in PHP (your exact words
were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
50-fold difference). This claim has just been obliterated using the
example you (not I) provided; my estimate of two man-years for
developing WordPress turns out to be fairly close to what has actually
gone into the development of Byteflow. In other words, so far we have
discovered no evidence of Python's (or PHP's, to be fair) superiority in
terms of developer's productivity.
In this case (excellent blogging tool), yes, I agree.
>IMHO Python language is better designed

That is indeed a matter of opinion. You like (among other things)
immutable strings, the off-side rule, the idea that everything is an
object, and the fine distinction between mutable lists and immutable
tuples, and I have no problem with you liking these features, as long as
you agree that other people may have reasons to like the alternatives
better.
I agree. We like different things and it's good.
>Yes, it's possible to write something clean in PHP but it would require
a lot more work.

In my opinion, it wouldn't, and in my experience, it doesn't. All you
need is to actually put a designer in charge of design. Additionally,
there are situations (rapid prototyping, for example) when
maintainability (the requirement behind the "clean code") is simply not
a concern.
It's hard to me to write good PHP. I feel happy programming in Python and
I felt very unhappy when I had to program in PHP. I'm glad that you have
a different experience.

Ivan

Jun 27 '08 #38

P: n/a
Ivan Illarionov wrote:
On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
>Not at all. I do it every day.

And BTW - yes, I write Python, also. But I find I can write better,
faster code in PHP.

I find I can write better code in Python. Maybe it's just a matter of
personal preference?
>Do you write PHP?
I did. And I hated it very much. I hated it so much that even I had few
Python scripts that generated PHP for me when it was possible.
So you really don't write PHP. Enough said.

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

P: n/a
Ivan Illarionov wrote:
On Sun, 25 May 2008 16:23:12 -0700, NC wrote:
>>I didn't say that it's not possible to write good code in PHP,
Indeed you didn't. You did, however, say that development in Python/
Django is inherently faster than development in PHP (your exact words
were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
50-fold difference). This claim has just been obliterated using the
example you (not I) provided; my estimate of two man-years for
developing WordPress turns out to be fairly close to what has actually
gone into the development of Byteflow. In other words, so far we have
discovered no evidence of Python's (or PHP's, to be fair) superiority in
terms of developer's productivity.

In this case (excellent blogging tool), yes, I agree.
>>IMHO Python language is better designed
That is indeed a matter of opinion. You like (among other things)
immutable strings, the off-side rule, the idea that everything is an
object, and the fine distinction between mutable lists and immutable
tuples, and I have no problem with you liking these features, as long as
you agree that other people may have reasons to like the alternatives
better.

I agree. We like different things and it's good.
>>Yes, it's possible to write something clean in PHP but it would require
a lot more work.
In my opinion, it wouldn't, and in my experience, it doesn't. All you
need is to actually put a designer in charge of design. Additionally,
there are situations (rapid prototyping, for example) when
maintainability (the requirement behind the "clean code") is simply not
a concern.

It's hard to me to write good PHP. I feel happy programming in Python and
I felt very unhappy when I had to program in PHP. I'm glad that you have
a different experience.

Ivan
It's very easy for me to write good code in PHP. I can say the same for
a number of other good programmers I know.

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

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

P: n/a
Jerry Stuckle wrote:
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.

Ivan
Jun 27 '08 #41

P: n/a
Ivan Illarionov wrote:
Jerry Stuckle wrote:
>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.

Ivan
Not for a good programmer it isn't. I've known a few good programmers
in my 40+ years of programming. I've known a lot more poor programmers
who think they're good.

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

P: n/a
On Sun, 25 May 2008 20:53:28 -0400, Jerry Stuckle wrote:
Ivan Illarionov wrote:
>Jerry Stuckle wrote:
>>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.

Ivan

Not for a good programmer it isn't. I've known a few good programmers
in my 40+ years of programming. I've known a lot more poor programmers
who think they're good.
I can't argue with your experience. I don't think that I'm good
programmer. I want to be better. And I hope that when I'll have 48+ years
experience I won't have to use it as argumentum ad hominem.
Jun 27 '08 #43

P: n/a
Ivan Illarionov wrote:
On Sun, 25 May 2008 20:53:28 -0400, Jerry Stuckle wrote:
>Ivan Illarionov wrote:
>>Jerry Stuckle wrote:

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.

Ivan
Not for a good programmer it isn't. I've known a few good programmers
in my 40+ years of programming. I've known a lot more poor programmers
who think they're good.

I can't argue with your experience. I don't think that I'm good
programmer. I want to be better. And I hope that when I'll have 48+ years
experience I won't have to use it as argumentum ad hominem.
No ad hominems on my part. I said nothing about you or your abilities.
I spoke only of programmers I have known, both good and poor.

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.

If you take exception to that, then I'm sorry for you.

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

P: n/a
I V
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.

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.
Jun 27 '08 #45

P: n/a
Jerry Stuckle skrev:
Ivan Illarionov wrote:
I repeat. The language has nothing to do with it. Good programmers
write good code. Lousy programmers write bad code.
That is simply not true!

The languag has a lot to do with what you can do in any given time.

You can write good code in a bad language. But it will take lot more
time. And so it will not be done.

Your argument, if it was true, would mean that I could just as well
write a blog in c or even assembler, and still write optimal code.
php is a terrible language and I cringe whenever I have to use it. In
fact I have turned down many jobs because they were written in php. It
is simply to frustrating.
--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Jun 27 '08 #46

P: n/a
On Mon, 26 May 2008 10:11:22 +0200, Max M wrote:
Jerry Stuckle skrev:
>Ivan Illarionov wrote:
>I repeat. The language has nothing to do with it. Good programmers
write good code. Lousy programmers write bad code.

That is simply not true!

The languag has a lot to do with what you can do in any given time.

You can write good code in a bad language. But it will take lot more
time. And so it will not be done.

Your argument, if it was true, would mean that I could just as well
write a blog in c or even assembler, and still write optimal code.
php is a terrible language and I cringe whenever I have to use it. In
fact I have turned down many jobs because they were written in php. It
is simply to frustrating.
I want to cite Paul Graham on this topic:

"it's all based on one unspoken assumption, and that assumption turns out
to be false. The pointy-haired boss believes that all programming
languages are pretty much equivalent. If that were true, he would be
right on target. If languages are all equivalent, sure, use whatever
language everyone else is using.

But all languages are not equivalent, and I think I can prove this to you
without even getting into the differences between them. If you asked the
pointy-haired boss in 1992 what language software should be written in,
he would have answered with as little hesitation as he does today.
Software should be written in C++. But if languages are all equivalent,
why should the pointy-haired boss's opinion ever change? In fact, why
should the developers of Java have even bothered to create a new language?

Presumably, if you create a new language, it's because you think it's
better in some way than what people already had. And in fact, Gosling
makes it clear in the first Java white paper that Java was designed to
fix some problems with C++. So there you have it: languages are not all
equivalent. If you follow the trail through the pointy-haired boss's
brain to Java and then back through Java's history to its origins, you
end up holding an idea that contradicts the assumption you started with.

So, who's right? James Gosling, or the pointy-haired boss? Not
surprisingly, Gosling is right. Some languages are better, for certain
problems, than others. And you know, that raises some interesting
questions. Java was designed to be better, for certain problems, than C+
+. What problems? When is Java better and when is C++? Are there
situations where other languages are better than either of them?"
and so on at
http://www.paulgraham.com/icad.html

I tend to share PG's opinions on the subject (though I think that Python
is superior to Lisp :-).

The argument that "the language has nothing to do with it" is an old
pointy-haired boss argument. I doubt that a person who think this way can
be a really good programmer.

Ivan
Jun 27 '08 #47

P: n/a
..oO(Ivan Illarionov)
>On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
>Not at all. I do it every day.

And BTW - yes, I write Python, also. But I find I can write better,
faster code in PHP.

I find I can write better code in Python. Maybe it's just a matter of
personal preference?
Exactly.
>Do you write PHP?
I did. And I hated it very much.
See, for me it's the other way round. I really hate Python syntax.
I only touch it for scripting Paint Shop Pro or if some third-party
Python script lacks proper documentation and I have to wade through
the sources to find the informations I need.

So where does this leave us? Nowhere. A language is just a tool and a
tool is just as good as the one who uses it. This was said often enough.

If you hate PHP, that's OK, but it doesn't make PHP a bad or even
inferior language.

Micha
Jun 27 '08 #48

P: n/a
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
Jun 27 '08 #49

P: n/a
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.

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

67 Replies

This discussion thread is closed

Replies have been disabled for this discussion.