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:
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?
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 :-)
On May 21, 4:10 pm, notbob <not...@nothome.com> wrote:
> 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.)
In my opinion, with the previous experience that you have in coding that you've mentioned, you're probably better off if you minimize the amount of new syntaxes you'll have to pick up. Standard technique for what you're trying to accomplish is more often than not Apache with the PHP and MySQL support built in. PHP has great support for accessing a MySQL database, which is where the script would store and load your entries (and/or other applicable data) from. Then again, you are really learning HTML, PHP, and MySQL at the same time, which can be a pain in the ass. There are some excellent books by O'Reilly and Associates on just that subject, though. They combine the PHP & MySQL into one book that'll get you started and able to handle that kind of task really quick. The HTML syntax is going to be separate, wherever you go. It'll be simple if you want it dumping text to the screen, and a pain in the ass if you want pretty formatting with designs and text that lays out just in a certain area.
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 +. :)
On 2008-05-21, Michael Vilain <vil...@NOspamcop.net> wrote:
> 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.
On 2008-05-21, Carl Banks <pavlovevide...@gmail.com> wrote:
> 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.
On 2008-05-21, Damon Getsman <dgets...@amirehab.net> wrote:
> 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.
notbob <not...@nothome.com> writes: > 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.
> 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:
> 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?
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:
> 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.
On May 21, 1:10 pm, notbob <not...@nothome.com> wrote:
> 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:
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...
Damon Getsman <dgets...@amirehab.net> wrote: > 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.
On 2008-05-22, Larry Bates <larry.ba...@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.
> 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.
In article <slrng3b383.iqd.n...@irishsea.home.craig-wood.com>, n...@craig-wood.com
(Nick Craig-Wood) wrote: > 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.
Use the MySQL Improved Extension - mysqli, not mysql
On Thu, 22 May 2008 10:30:07 -0500, Nick Craig-Wood wrote: > Damon Getsman <dgets...@amirehab.net> wrote: >> 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.
> 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:
> 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
TurboGears and Django are pretty cool Python web application frameworks. I would recommend looking at them too.
I don't like php. I tried it once and I had it sort a list, but the list was apparently too long for its sorting function because it just sorted the first so-many elements of it and left the rest in order, and didn't generate any error. I like a language that's actually determined by what you tell it to do. I hear it has a lot of security issues too. I'm not sure that php *runs* faster than python, having seen benchmarks, but it certainly loads faster. Maybe not so much of a difference once python25.dll is already in the cache though (speaking from a windows perspective). because when i load a program it can take a while but it's pretty quick if i'd just loaded one recently. but you don't necessarily have to load python for each page rendering anyway.
I like the Python language a lot better than php. but I just really like Python.
php mixes html and code out-of-the-box (sort of.. i guess it's more like a reversal of which one is explicit)... if you use Python you should look into a 'templating engine' like mako. i use cheetah, but mako is supposed to be better.
i think Python is the easiest language to learn, with the possible exception of qbasic (just because making multidimensional arrays in python isnt that obvious, although maybe it is using numpy, i've never tried it). Python isn't as easy as basic if you use/have to read the more advanced features, but those aren't even available in basic. so I find it a comfortable learning curve.
inhahe wrote: > I don't like php. I tried it once and I had it sort a list, but the list > was apparently too long for its sorting function because it just sorted the > first so-many elements of it and left the rest in order, and didn't generate > any error. I like a language that's actually determined by what you tell it > to do.
Then I suspect you had an error in your code. PHP's sort functions work fine.
> I hear it has a lot of security issues too.
The language has no security issues. Programmers have security issues - whether it be PHP, Python or any other language.
> I'm not sure that php > *runs* faster than python, having seen benchmarks, but it certainly loads > faster. Maybe not so much of a difference once python25.dll is already in > the cache though (speaking from a windows perspective). because when i load > a program it can take a while but it's pretty quick if i'd just loaded one > recently. but you don't necessarily have to load python for each page > rendering anyway.
> I like the Python language a lot better than php. but I just really like > Python.
I like PHP much better than Python. To each their own.
> php mixes html and code out-of-the-box (sort of.. i guess it's more like a > reversal of which one is explicit)... if you use Python you should look into > a 'templating engine' like mako. i use cheetah, but mako is supposed to be > better.
PHP can do that. There are also a number of templating engines available. The nice thing about PHP is you have a choice.
> i think Python is the easiest language to learn, with the possible exception > of qbasic (just because making multidimensional arrays in python isnt that > obvious, although maybe it is using numpy, i've never tried it). Python > isn't as easy as basic if you use/have to read the more advanced features, > but those aren't even available in basic. so I find it a comfortable > learning curve.
I found PHP easier to learn than Python. But that may be because I already have a strong C/C++ background.
There isn't anything wrong with Python. I just prefer PHP.
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ==================
> 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.
>Damon Getsman <dgets...@amirehab.net> wrote: >> 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.
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:
> 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.
> 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:
>> 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. ;-)
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. jstuck...@attglobal.net ==================
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:
>> 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. jstuck...@attglobal.net ==================