Re: Php vs Python gui (tkinter...) for small remote database app
Op 15-06-2021 om 19:14 schreef Grant Edwards: On 2021-06-15, Menno Holscher wrote: There is no difference regarding security concerns. I find that hard to believe given the long list of CVEs I've just had to sort through for even fairly recent versions of PHP. I just can't belive that Python has anywhere close to that many secruity issues. An excellent example. The "concerns" here are "Is this platform safe?" and "Does the supplier/community react promptly to security problems?". In case of PHP indeed the safety of the platform is a worry, however, apparently if there is a problem, action is taken. How does the Tkinter/TCL/TK software or the PyQt/Qt do in that respect? Just looking at the number of CVEs, is that enough? What if one of these stacks has few, but long outstanding security problems? Would that be better or worse than the situation for PHP? As an aside, I do not know the amount of CVEs PHP nor Python is receiving. When I search the NIST CVE database for the word Python I get 43 hits for the last 3 months. None of those are against the language or the CPython interpreter and only 1 against a Standard Library package or module (urllib3). A lot of the others are for web frameworks and extensions for those, as well as Tensorflow. So as you argue, it seems Python does really well as a secure development platform. -- Met vriendelijke groet / Kind regards Menno Hölscher -- https://mail.python.org/mailman/listinfo/python-list
Re: Php vs Python gui (tkinter...) for small remote database app
On 2021-06-15, Menno Holscher wrote: > There is no difference regarding security concerns. I find that hard to believe given the long list of CVEs I've just had to sort through for even fairly recent versions of PHP. I just can't belive that Python has anywhere close to that many secruity issues. -- Grant Edwards grant.b.edwardsYow! I'd like some JUNK at FOOD ... and then I want to gmail.combe ALONE -- -- https://mail.python.org/mailman/listinfo/python-list
Re: Php vs Python gui (tkinter...) for small remote database app
Op 14-06-2021 om 21:17 schreef Pascal B via Python-list: Hi, I would like to know if for a small app for instance that requires a connection to a remote server database if php is more suitable than Python mainly regarding security. Php requires one port for http and one port for the connection to the database open. If using Python with a tkinter gui, I understand a small app can connect to a database so only one port to the database would need to be accessed/open listening to connection. So I would need to worry less about security if using Python over Php for something small, like a small python app that I give over to users. Am I missing something in this assertion? There is no difference regarding security concerns. In the case of a PHP (or any web app for that matter) you indeed have to worry about the security of the connection to the browser. But, e.g. the access to the database is only in one place, on the server. If you use a Tkinter application, each user will have the access to the database at his/her own machine, causing other worries than connection security. The attack vector may be different, but the worries are no less or more in one of the solutions. First investigate what you need to be afraid of/worried about, do not make a decision on a simple criterion like the number of connections. -- Met vriendelijke groet / Kind regards Menno Hölscher -- https://mail.python.org/mailman/listinfo/python-list
Re: Php vs Python gui (tkinter...) for small remote database app
On Tue, Jun 15, 2021 at 08:39:51AM +1200, dn via Python-list wrote: > On 15/06/2021 07.17, Pascal B via Python-list wrote: > > Hi, > > I would like to know if for a small app for instance that requires a > > connection to a remote server database if php is more suitable than Python > > mainly regarding security. > > Php requires one port for http and one port for the connection to the > > database open. If using Python with a tkinter gui, I understand a small app > > can connect to a database so only one port to the database would need to be > > accessed/open listening to connection. So I would need to worry less about > > security if using Python over Php for something small, like a small python > > app that I give over to users. > > > > Am I missing something in this assertion? > > Yes - or maybe I'm missing the point of your question? > > There are two connections to consider: the database and the GUI. > > > Database: > [...] > > > GUI: > [...] > The (Internet-connected) world runs on TLS. If you wish to > secure/encrypt communications between application and server, this is > accepted by most. If you wish to 'secure' by reducing inter-connections, > then using tkinter and its tight-linkage to Python removes the need for > the (http) web-server. I would rather go with https-based "app", but not necessarily in PHP, if security is to be considered (albeit I am not sure if Python framework would do better). Nowadays, there should be a firewall and server sitting behind it (this is simple description, let us not put load balancing, many servers etc into the mix, or if firewall really helps). So, in case of http(s), there should be more tutorials and hints about doing this well. Browser would do the gui side, http server will talk to the database and to the world, but database itself is secured (hopefully) from outside access. I suspect it is easier to secure web server than db from various kind of 'kacks'. If you go with well rounded Python framework, you can count on its authors carefully thinking about various threats to apps written in it. Sorry, I cannot give any hints - see, I rather deteste browser based apps, so this advice goes against my own liking but one should be objective when giving advices... If you are truly new to this all, I suggest CGI, especially if you want to do some proof of concept prototype, quickly. CGI is quite easy to understand and as long as you are working out communications between your code and DB, I think it simplifies the job a lot. Later on, choose your framework and do the gui. If you go with tkinter, then you will have to do the job already done by authors of web server and web framework, you will have to rethink various problems they gave their thoughts to, but in much shorter time and on your own. -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home** ** directory. And then the C programmer became enlightened... ** ** ** ** Tomasz Rola mailto:tomasz_r...@bigfoot.com ** -- https://mail.python.org/mailman/listinfo/python-list
Re: Php vs Python gui (tkinter...) for small remote database app
On 15/06/2021 07.17, Pascal B via Python-list wrote: > Hi, > I would like to know if for a small app for instance that requires a > connection to a remote server database if php is more suitable than Python > mainly regarding security. > Php requires one port for http and one port for the connection to the > database open. If using Python with a tkinter gui, I understand a small app > can connect to a database so only one port to the database would need to be > accessed/open listening to connection. So I would need to worry less about > security if using Python over Php for something small, like a small python > app that I give over to users. > > Am I missing something in this assertion? Yes - or maybe I'm missing the point of your question? There are two connections to consider: the database and the GUI. Database: In each case, the programming-language must make a connection to the Database Management System. The API, the manner for doing-so may vary slightly between DBMS-es, but will not particularly between languages. Thus, if we talk about MySQL/MariaDB, the data which must be exchanged between language and DBMS is identical (even if the code, and appearance of the 'variables' differs). As far as security goes, the different DBMS-publishers have decided, in their wisdom, to select different IP-ports for communication with their products (see https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers). Please refer to (their, cf Python's) specific documentation to ascertain security and encryption options. GUI: There's a bit of 'chalk and cheese' in this question. PHP is built around HTML. HTML requires an HTTP server (ignoring the interpreter built-in to a web-browser). Thus, PHP or Python (likely Python plus Flask or some other framework) will need to connect to httpd/Apache/NGINX/etc, in similar fashion to the above. In this case, the choice of IP-port is more standard - 80 for http and 443 for https. Whereas tkinter is a module which can be import-ed into a Python program(me). There is no separate server. Thus no need for an IP-connection between application and front-end. The (Internet-connected) world runs on TLS. If you wish to secure/encrypt communications between application and server, this is accepted by most. If you wish to 'secure' by reducing inter-connections, then using tkinter and its tight-linkage to Python removes the need for the (http) web-server. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list
Php vs Python gui (tkinter...) for small remote database app
Hi, I would like to know if for a small app for instance that requires a connection to a remote server database if php is more suitable than Python mainly regarding security. Php requires one port for http and one port for the connection to the database open. If using Python with a tkinter gui, I understand a small app can connect to a database so only one port to the database would need to be accessed/open listening to connection. So I would need to worry less about security if using Python over Php for something small, like a small python app that I give over to users. Am I missing something in this assertion? -- https://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
2012/9/25 tejas.tank@gmail.com: On Thursday, 23 December 2004 03:33:36 UTC+5:30, (unknown) wrote: Anyone know which is faster? I'm a PHP programmer but considering getting into Python ... did searches on Google but didn't turn much up on this. Thanks! Stephen Here some helpful gudance. http://hentenaar.com/serendipity/index.php?/archives/27-Benchmark-PHP-vs.-Python-vs.-Perl-vs.-Ruby.html -- http://mail.python.org/mailman/listinfo/python-list Quite ancient versions of everything, would be interesting to see if things are different now.. Anyway you can switch to Python happily, it might not be faster but 99% of the times that's not an issue.. -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
How to configure python in apache2 ? So my html embedded code will works. -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
On 25/09/2012 11:22, Tejas wrote: How to configure python in apache2 ? So my html embedded code will works. Please follow the instructions that you'll find by searching the web. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
On Thursday, 23 December 2004 03:33:36 UTC+5:30, (unknown) wrote: Anyone know which is faster? I'm a PHP programmer but considering getting into Python ... did searches on Google but didn't turn much up on this. Thanks! Stephen Here some helpful gudance. http://hentenaar.com/serendipity/index.php?/archives/27-Benchmark-PHP-vs.-Python-vs.-Perl-vs.-Ruby.html -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think you are talking about something a little different than Arnaud. Ah, OK. Other old habits from people coming to Python are: using indexes where they are not needed, trivial getters and setters, putting *everything* into classes and every class into a module, and so on. Some of that is more political/policy than anything having to do with the language. Python likes to make it blatantly obvious that a lot of it is unnecessary, so it puts the control freak type of programmers on the defensive when, e.g., class variables and methods aren't private by default. (Guido's we're all conesenting adults here is of course a good response to this!) Another difference are internal versus external iterators. In Python you write the loop outside the iterable and pull the items out of it. In other languages (Ruby, Io, .) iterables do internal iteration and you give them a function where all item are pushed into one at a time. The Python method is -- IMO -- rather more powerful here, even if the whole protocol is somewhat less explciti than the Ruby/Io/etc. approach. What makes C++ a first class language? My somewhat arbitrary definition is something along the lines of a language with most all of the contemporary features expected of languages (e.g., old school procedural languages like C/Pascal/Fortran 77 don't count) that are targeting at writing everything from small utilities to programs of various sizes to full-blown operating systems. And did you quote first class for the same reason than I did? ;-) Probably... C++ is kinda like the McMaster-Carr catalog, whereas Python is a well-stocked hardware store with knowledgable salespeople. ---Joel -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Joel Koltner [EMAIL PROTECTED] writes: There's potentially a large difference between a good speaker of English/German/etc. vs. eloquent. I'd tend to agree with Jerry that if you can write good code in one language, you can in pretty much any other as well... but that doesn't imply you're necessarily eloquent in any languages. :-) Eloquence is nice, but eradicating bad code in this world is about a million times more important than attempting to move people from good code to eloquent code. This is wrong, because if you know well one language only, you tend to think that the principles that underpin it are universal. So you will try to shoehorn these principles into any other language you use. It's only when you have become reasonably proficient in a number of conceptually different languages that you start to build a picture of what a programming language is. I understand that there are some sane practices that are useful to know when programming in any language, but it is wrong to say that the skill of programming can be reduced to that, the rest being syntax. There is (hopefully!) a design behind the syntax, you have to understand it to use the language well. You may be great at building Turing machines. That doesn't make you a master of crafting lambda-expressions. To be Pythonic here, eloquent code would perhaps often have clear, clean list comprehensions used when good code would use a for loop but still be easy to follow as well and perfectly acceptable in the vast majority of cases. I find that eloquent Python speakers often tend to write a for loop when mere good ones will try to stick a list comprehension in! Regards -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Arnaud Delobelle [EMAIL PROTECTED] wrote: I find that eloquent Python speakers often tend to write a for loop when mere good ones will try to stick a list comprehension in! +1 QOTW -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
In article [EMAIL PROTECTED], Ethan Furman [EMAIL PROTECTED] wrote: Jerry Stuckle wrote: As I've said before - good programmers can write good code in any language. So... an eloquent speaker of English is also an eloquent speaker of Spanish/French/German? Oh, Bull. Computer languages are so narrow they are more like dialects of a single language. If you know English you can learn to speak to a Brit, Scot, or Aussie. That's more like it...if you really want to stretch the definition of a language. And it is a stretch. Anyone speak C? Sheeze. -- -- Lou Pecora -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Yeah I would agree that a decent (a few steps below good in my book) programmer should be able to have a decent handle on a new language, given some acclimatization time of course. The amount of time this period lasts varies on the language said programmer is learning, as well as the languages he knows. If they are far different (say going from object oriented to functional) it will take longer to learn. But it's not to say that after learning it, his code will be bad. Maybe not as good as experts, but not bad. But I would say the jump from not bad code to good code; or the jump from good code to great code are huge leaps. And in a badly designed language, it could be argued that even the best code is lacking. To say that language doesn't matter at all is extremely silly, otherwise we wouldn't have 5 million languages. Most languages are created, not just for the fun of it, but to solve something lacking in what is available elsewhere. (OK, there are a lot of languages people have created just because they are geeks, but most languages that people actually use are purposeful). Python was created to have something easier than perl and more powerful than bash to write shell scripts with and automate system administration tasks. PHP was created to enhance html with a powerful integrated server language that was easier than c but not alien to it. It was a replacement for cgi. For me, php is far too flat, making it pretty tough to navigate and get a handle on. If you know what you want to do, it probably has something to fit that task, but for exploring it's not fun. I rather enjoy python, where I can play around at the interpreter and try new things. PHP also is not very strict when it comes to types, even less strict than python, and in my newbieness that has caused me loads of problems. But I know people who swear by PHP, and I admit it has been used for many great sites, so it can't be that bad. Still, outside of the web sphere, it is a bit odd to use PHP. Not necesarily bad, just a bit odd. And there are situations that are a bit odd for python also (sound editing,etc). -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Arnaud Delobelle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is wrong, because if you know well one language only, you tend to think that the principles that underpin it are universal. So you will try to shoehorn these principles into any other language you use. Fair point, although I guess I was assuming the language you were good in was something that covers, say, 90% of contemporary programming practices, e.g., something like C++ : If you're truly good at C++ (and percentage-wise of all programmers, relatively few are), there are not many things that I'm aware of that are tremendously different in any other programming language. Function decorators from Java and some of the function programming stuff from Lisp, perhaps, but those are pretty small additions (well within the 10%). Perhaps I should reduce my claim to those good at programming in any first class language like C++ are generally going to write at least above-average code in any other language. :-) You may be great at building Turing machines. That doesn't make you a master of crafting lambda-expressions. Certainly the most important thing for any programmer to know is where his skills lie and where he should purposely keep things braindead simple because he's more likely to introduce bugs by trying to be eloquent. I find that eloquent Python speakers often tend to write a for loop when mere good ones will try to stick a list comprehension in! This is the trap I refer to above -- beginning programmers are far more likely to mis-use more sophisticated language features than experienced programmers are. Heck, you see entire languages like Java built around such premises, that it's better to have a simpler language that's harder to mis-use than a more sophisticated one that could be readily abused. C++ is perhaps the ultimate anything goes langauge -- tons of power and sophistication, very little nannying. Python has its own philosophy, of course, although at times it's somewhat arbitrary, e.g., for explicit is better than implicit -- sure, fine, but of course only applied to things that we haven't already decided should be implicit! Something like Python iterators are not at all explicit/obvious, for instance, to someone coming from, say, a Visual BASIC background... although I suppose they're still a lot simpler than, e.g., C++ scoping rules for name resolution. ---Joel -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Mon, 02 Jun 2008 18:21:26 -0700, Joel Koltner wrote: Arnaud Delobelle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is wrong, because if you know well one language only, you tend to think that the principles that underpin it are universal. So you will try to shoehorn these principles into any other language you use. Fair point, although I guess I was assuming the language you were good in was something that covers, say, 90% of contemporary programming practices, e.g., something like C++ : If you're truly good at C++ (and percentage-wise of all programmers, relatively few are), there are not many things that I'm aware of that are tremendously different in any other programming language. Function decorators from Java and some of the function programming stuff from Lisp, perhaps, but those are pretty small additions (well within the 10%). I think you are talking about something a little different than Arnaud. You are talking about the 10% that's new in another language that has to be learned additionally and Arnaud is talking about the stuff the programmer already knows about the old language that somewhat works in the new one but is all but optimal and thus has to be *unlearned*. From C++ to Python or Java this is RAII and deterministic destructors for instance. Other old habits from people coming to Python are: using indexes where they are not needed, trivial getters and setters, putting *everything* into classes and every class into a module, and so on. Another difference are internal versus external iterators. In Python you write the loop outside the iterable and pull the items out of it. In other languages (Ruby, Io, …) iterables do internal iteration and you give them a function where all item are pushed into one at a time. Perhaps I should reduce my claim to those good at programming in any first class language like C++ are generally going to write at least above-average code in any other language. :-) What makes C++ a first class language? And did you quote first class for the same reason than I did? ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ethan Furman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jerry Stuckle wrote: As I've said before - good programmers can write good code in any language. So... an eloquent speaker of English is also an eloquent speaker of Spanish/French/German? There's potentially a large difference between a good speaker of English/German/etc. vs. eloquent. I'd tend to agree with Jerry that if you can write good code in one language, you can in pretty much any other as well... but that doesn't imply you're necessarily eloquent in any languages. :-) Eloquence is nice, but eradicating bad code in this world is about a million times more important than attempting to move people from good code to eloquent code. To be Pythonic here, eloquent code would perhaps often have clear, clean list comprehensions used when good code would use a for loop but still be easy to follow as well and perfectly acceptable in the vast majority of cases. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Jerry Stuckle wrote: As I've said before - good programmers can write good code in any language. So... an eloquent speaker of English is also an eloquent speaker of Spanish/French/German? I think your statement would be correct if worded: some programmers can write good code in any language. There's a reason why computer coding paradigms are called 'languages' -- because they are, and as such they require different ways of thinking. Just because someone is good at playing pianos doesn't mean they are also good at wood carving. Just because someone is good (i.e. writes good code) in C / PHP / Python / Perl / Assembly / whatever does not inherently mean that that same person will be able to write good code in any other language. That's one reason why there are so many to choose from: different people think differently and most are only optimal in certain areas. Or perhaps your definition of a good programmer means somebody who can write good code in any language? What then is a programmer who can only write good code in a handful of languages? Or maybe only two languages? Or even only one? My definition of a good programmer is someone who can write good code in a computer language. I would use the word 'versatile' or even 'multi-lingual' to broaden the scope to more than one language. -- Ethan P.S. My apologies, Jerry, for writing back to you directly -- I haven't yet discovered how to post to newsgroups, and I do not know the php mailing list address. I guess by both our definitions I am not a 'good newsgroup poster.' ;-) -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
A good OO programmer could easily write good functional code. You are aware that functional programming is *not* procedural or imperative programming? http://en.wikipedia.org/wiki/Functional_programming OO is *heavily* depending on state and state modification. I've seen OO programmers weep over functional programming assignments. Which is not to say that FP is in any sense bad - au contraire, knowing it is important because it is a different school of thought that's very valuable to know of. And Python allows for many of the FP concepts to be used. See map, filter and other HOFs. Diez -- http://mail.python.org/mailman/listinfo/python-list
[OT] Re: FW: php vs python
On Thu, 2008-05-29 at 08:47 +1200, Phil Runciman wrote: The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have DSLs if language does not matter? For that matter, the English have several terms for snow as well. snow flurry blizzard powder pack flakes crystals sleet slush And in some contexts (http://www.abc-of-snowboarding.com/snowtypes.asp) crud crust rime graupel hail That's 14. Inuits are unimaginative punks. ;) Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ivan Illarionov [EMAIL PROTECTED] wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. ... No. Language does matter. A good programmer keeps many tools in his toolbox, and understands which tools provide the best service for the problem at hand. -- Tim Roberts, [EMAIL PROTECTED] Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
.oO(Ivan Illarionov) No. Language does matter. And the weather. If you know how to program, you can write good code in any language if you're familiar enough with it. Many people write good code in PHP, and many write total crap in C/C++. It's almost never about the language, but about the programmer. Micha -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 28, 1:42 pm, Michael Fesser [EMAIL PROTECTED] wrote: .oO(Ivan Illarionov) No. Language does matter. And the weather. If you know how to program, you can write good code in any language if you're familiar enough with it. Many people write good code in PHP, and many write total crap in C/C++. It's almost never about the language, but about the programmer. Micha I'd like to see someone coming from an OO programming background write good Haskell, Pure Functional Programming code even with a high level of OO experience. Language matters. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Wed, 28 May 2008 06:04:54 +, Tim Roberts wrote: Ivan Illarionov [EMAIL PROTECTED] wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. ... No. Language does matter. A good programmer keeps many tools in his toolbox, and understands which tools provide the best service for the problem at hand. Agree, I keep Python, C and x86 assembly in my toolbox. And this toolbox is perfect. Actually, even PHP has its place in my toolbox, but, *only when I can't use Python*, eg Sourceforge.net servers don't have good Python support and PHP starts to make sense. Language matters. Ivan -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
[EMAIL PROTECTED] wrote: On May 28, 1:42 pm, Michael Fesser [EMAIL PROTECTED] wrote: .oO(Ivan Illarionov) No. Language does matter. And the weather. If you know how to program, you can write good code in any language if you're familiar enough with it. Many people write good code in PHP, and many write total crap in C/C++. It's almost never about the language, but about the programmer. Micha I'd like to see someone coming from an OO programming background write good Haskell, Pure Functional Programming code even with a high level of OO experience. Language matters. Actually, I think it would be easier than a functional programmer converting to an OO paradigm. And the caveat was *if you're familiar enough with it*. A good OO programmer could easily write good functional code. -- == Remove the x from my email address Jerry Stuckle JDS Computer Training Corp. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Jerry Stuckle [EMAIL PROTECTED] writes: A good OO programmer could easily write good functional code. Over on #haskell there's a general belief that learning Haskell is easier for nonprogrammers than it is for OO programmers, since the OO programmers first have to unlearn what they previously knew. -- http://mail.python.org/mailman/listinfo/python-list
FW: php vs python
-Original Message- From: Jerry Stuckle [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 May 2008 1:48 p.m. To: python-list@python.org Subject: Re: php vs python Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Yes it does matter. I have programmed in many assembly and higher level languages. In OldenTimes: In Algol 60 I was productive from the start. KDF9 Usercode (Assembly) was brilliant. (A bigger HW stack would have made it even better). IBM 360 Assembly was poorer but not a disaster. PL1 was a mess. You could write good code but why bother? COBOL was fit for purpose and when combined with Jackson structured programming could be used straight away by rooky programmers in business systems programming. I am sure it has progressed since ANSI 68. The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have DSLs if language does not matter? My 2c worth. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Flaming Thunder is teh awesome! :P -- http://mail.python.org/mailman/listinfo/python-list
Re: FW: php vs python
On May 28, 4:47 pm, Phil Runciman [EMAIL PROTECTED] wrote: -Original Message- From: Jerry Stuckle [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 May 2008 1:48 p.m. To: [EMAIL PROTECTED] Subject: Re: php vs python Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Yes it does matter. I have programmed in many assembly and higher level languages. In OldenTimes: In Algol 60 I was productive from the start. KDF9 Usercode (Assembly) was brilliant. (A bigger HW stack would have made it even better). IBM 360 Assembly was poorer but not a disaster. PL1 was a mess. You could write good code but why bother? COBOL was fit for purpose and when combined with Jackson structured programming could be used straight away by rooky programmers in business systems programming. I am sure it has progressed since ANSI 68. The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have DSLs if language does not matter? My 2c worth. http://www.fukung.net/v/7729/php_vs_python.png :) -- http://mail.python.org/mailman/listinfo/python-list
Re: FW: php vs python
On May 28, 7:45 pm, blaine [EMAIL PROTECTED] wrote: On May 28, 4:47 pm, Phil Runciman [EMAIL PROTECTED] wrote: -Original Message- From: Jerry Stuckle [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 May 2008 1:48 p.m. To: [EMAIL PROTECTED] Subject: Re: php vs python Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Yes it does matter. I have programmed in many assembly and higher level languages. In OldenTimes: In Algol 60 I was productive from the start. KDF9 Usercode (Assembly) was brilliant. (A bigger HW stack would have made it even better). IBM 360 Assembly was poorer but not a disaster. PL1 was a mess. You could write good code but why bother? COBOL was fit for purpose and when combined with Jackson structured programming could be used straight away by rooky programmers in business systems programming. I am sure it has progressed since ANSI 68. The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have DSLs if language does not matter? My 2c worth. http://www.fukung.net/v/7729/php_vs_python.png :) Ha ha. Took me a second. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. -- Sincerely Yours, AnrDaemon [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Wed, 28 May 2008 01:32:24 +, Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. I want to add TROLL WARNING: this message is cross-posted between comp.lang.python and comp.lang.php Let's stop. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Not for a good programmer. Only for half-assed ones. -- == Remove the x from my email address Jerry Stuckle JDS Computer Training Corp. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Not for a good programmer. Only for half-assed ones. No. Language does matter -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ivan Illarionov wrote: On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Not for a good programmer. Only for half-assed ones. No. Language does matter Only to half-assed programmers. Good programmers can write good code in any language they know. Ever seen good assembler? It can be done - really! Also fortran, cobol, forth... the list goes on. -- == Remove the x from my email address Jerry Stuckle JDS Computer Training Corp. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Not for a good programmer. Only for half-assed ones. No. Language does matter Only to half-assed programmers. Good programmers can write good code in any language they know. Ever seen good assembler? It can be done - really! Also fortran, cobol, forth... the list goes on. Yeah, mov eax, Jerry mov killfile, eax -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ivan Illarionov wrote: On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: Ivan Illarionov wrote: On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: Greetings, Ivan Illarionov. In reply to Your message dated Monday, May 26, 2008, 04:47:00, As I've said before - good programmers can write good code in any language. Yes, they can. But it may be harder to do for them in one language and easier in another. It's obvious lie. If you have clear mind and you know language you're using, there are absolutely NOTHING can deny you to write clear code. Even using forth postfix notation, I have no problem writing good code, it's as easy as writing bad code. And yes, I do see the difference. No. Language does matter. Not for a good programmer. Only for half-assed ones. No. Language does matter Only to half-assed programmers. Good programmers can write good code in any language they know. Ever seen good assembler? It can be done - really! Also fortran, cobol, forth... the list goes on. Yeah, mov eax, Jerry mov killfile, eax Stoopid troll. But we already know you can't write good code. No surprise there. -- == Remove the x from my email address Jerry Stuckle JDS Computer Training Corp. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 22, 12:28 pm, NC [EMAIL PROTECTED] wrote: On May 21, 1:10 pm, notbob [EMAIL PROTECTED] 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? 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 23, 5:14 am, inhahe [EMAIL PROTECTED] 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. 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. You should see Basic's file operation syntax, ugly and hackish. All those #1, #2, etc is ugly and unintuitive. That's why I've always avoided anything related to file in Basic (no hard feelings to Basic programmers, my first language is Basic and I'm pretty good at it except for anything related with files). In python, file read is as simple as open('path', 'mode'), and the for-loop can easily loop the file object. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 22, 3:10 am, notbob [EMAIL PROTECTED] 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 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Lie wrote: On May 22, 12:28 pm, NC [EMAIL PROTECTED] wrote: On May 21, 1:10 pm, notbob [EMAIL PROTECTED] 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? 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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Jerry Stuckle wrote: Lie wrote: On May 22, 12:28 pm, NC [EMAIL PROTECTED] wrote: On May 21, 1:10 pm, notbob [EMAIL PROTECTED] 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? 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Ivan Illarionov wrote: Jerry Stuckle wrote: Lie wrote: On May 22, 12:28 pm, NC [EMAIL PROTECTED] wrote: On May 21, 1:10 pm, notbob [EMAIL PROTECTED] 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? 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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 25, 11:46 am, Ivan Illarionov [EMAIL PROTECTED] 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 25, 1:55 pm, Ivan Illarionov [EMAIL PROTECTED] 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. 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On Mon, May 26, 2008 at 8:12 AM, Jerry Stuckle [EMAIL PROTECTED] wrote: 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. I write or review PHP code everyday. While much can be done in PHP5 I still feel Python has a cleaner definition and therefore allows writing faster clean code. I many places around I see people saying doing XX is evil or YY tool/function is now on my blacklist. Most of the time it is because of an undocumented bug, unpredictable side-effect, or obscure security issue. This propagates fears, and fears are not, in my opinion and experience, the best companion of developers. It makes you stick on only the domain you know, and write code very slowly and defensively. Fear comes from what we don't understand. Take Regexp for example: when I came first to my current job, nobody used them, everyone feared them, because Regexp can bite (i.e. do something strange you cannot explain easily). After some time and patiently explain Regexp sample to my teammates, everyone now want to play with them (even when using them makes no sense). If a language makes their users more confident and propagates less fears, I would say it is better than the others in this respect. PHP has a good documentation with user comments, which makes me more confident (I'll find a solution) but, in my opinion, Python is better in this respect because the way it has been crafted makes me more confident. (Often, when I open a PHP application, the first 100 lines will be defensive stuff against magic_quotes or other weird settings, while when I open Python third-party modules, the first lines are most often nice docstrings, and the next lines are easy to decipher classes and functions just doing the work.) PHP did bite me hard (like a wild dog) at least once (postgreSQL NULL values fetched through pg_fetch_object were both null and not null !... the bug was very hard to find) ASP / MSSQL did bite me a lot (like a dangerous snake) with undocumented bugs, and so on. Javascript can bite (like a wild cat) but can be domesticated through frameworks like prototype.js CSS can bite while HTML usually can't As everyone knows pythons doesn't bite! (Or at least didn't bite me yet.) -- == Remove the x from my email address Jerry Stuckle JDS Computer Training Corp. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Michael Fesser [EMAIL PROTECTED] writes: 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
.oO(Nick Craig-Wood) Damon Getsman [EMAIL PROTECTED] 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. Micha -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
.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! flameWhere 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Erwin Moller [EMAIL PROTECTED] wrote: 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/gettingstarted/ss/whatispython_4.htm http://wiki.w4py.org/python-vs-php.html -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
.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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Michael Fesser [EMAIL PROTECTED] wrote: .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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
.oO(Duncan Booth) Michael Fesser [EMAIL PROTECTED] wrote: 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
Damon Getsman [EMAIL PROTECTED] 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. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On 2008-05-22, Larry Bates [EMAIL PROTECTED] 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/pylonscookbook/Making+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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On 2008-05-21, Paul Rubin http wrote: 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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 21, 3:10 pm, notbob [EMAIL PROTECTED] 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 TurboGears and Django are pretty cool Python web application frameworks. I would recommend looking at them too. Mike -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
I used python to generate php code. But that was before I knew what vast troves of python web frameworks there were. :) On Thu, May 22, 2008 at 11:40 PM, inhahe [EMAIL PROTECTED] 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. -- http://mail.python.org/mailman/listinfo/python-list -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.org/mailman/listinfo/python-list
php vs python
I'm not posting this just to initiate some religious flame war, though it's the perfect subject to do so. No, I actaully want some serious advice about these two languages and since I think usenet is the best arena to find it, here ya' go. So, here's my delimna: I want to start a blog. Yeah, who doesn't. Yet, I want learn the guts of it instead of just booting up some wordwank or whatever. I started to learn python, but heard php was easier or faster or more like shell scripting or... fill in the blank. Anyway, so I change over to learning php. Then I run across that blog, Coding Horror, and start reading articles like this: http://www.codinghorror.com/blog/archives/001119.html Now what? Go back to python. Soldier on with php? What do I know? Not much. I can setup mysql and apache,, but don't know how to use 'em, really. I use emacs and run slackware and can fumble my way through bash scripts, but I can't really write them or do lisp. I've taken basic basic and basic C, but am barely literate in html. Sometimes it seems overwhelming, but I persevere because it's more fun/challenging than video games, which bore me to tears. Well, that's my actual question, then. Is php really so bad I'm just wasting my time? Or is it really the quickest way to blog functionality? Would I be better served in the long run learning python, which claims to be easy as pie to learn/program (still looks hard to me). I admit I'm no code geek. But, I'm not completely brain dead, either, and I need something to keep my geezer brain sparking. What say ye? nb -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 21, 4:10 pm, notbob [EMAIL PROTECTED] 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.) Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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 +. :) a href=http://unix.derkeiler.com/Newsgroups/comp.sys.sun.apps/ 2008-04/msg0.html -Damon A. Getsman Linux/Solaris Systems Administrator /a -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On 2008-05-21, Michael Vilain [EMAIL PROTECTED] 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. nb -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On 2008-05-21, Carl Banks [EMAIL PROTECTED] 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. nb -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On 2008-05-21, Damon Getsman [EMAIL PROTECTED] 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. nb -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
notbob [EMAIL PROTECTED] 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 21, 11:10 pm, notbob [EMAIL PROTECTED] 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 By the way anything goes to you.. -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 22, 6:10 am, notbob [EMAIL PROTECTED] wrote: 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 :) -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
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/pylonscookbook/Making+a+Pylons+Blog -- http://mail.python.org/mailman/listinfo/python-list
Re: php vs python
On May 21, 1:10 pm, notbob [EMAIL PROTECTED] 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: 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 -- http://mail.python.org/mailman/listinfo/python-list
php vs python (operator comparison)-repost
Im sorry if this was already posted to the list; Ive been having major e-mail problems lately. Hi All, Ive already done a large amount of searching on Google to find out this information, but to no avale. Does anyone here know of a list of operators in python and there counterparts in php, or a website with this information? Im going to be trying to port some php and perl stuff to python, and this information would be extremely useful, rather than going through all the documentation and reinventing the wheel. Thanks Much, -- Brandon McGinty Email:b[EMAIL PROTECTED] Skype:brandon.mcginty Msn:[EMAIL PROTECTED] Aim:brandonmcginty0 (Not currently available.) Cell:4802025790 (Weekends and nights only, please.) Languages:python, php, autoit; Currently Learning:perl Kindness is a language that the deaf can hear and the blind can see. Mark Twain -- http://mail.python.org/mailman/listinfo/python-list
operator comparison for php vs python
Hi All, Ive already done a large amount of searching on Google to find out this information, but to no avale. Does anyone here know of a list of operators in python and there counterparts in php, or a website with this information? It would also be helpful to have this information along with perls syntax. Im going to be trying to port some php and perl stuff to python, and this information would be extremely useful, rather than going through all the documentation and reinventing the wheel. Thanks, -- Brandon McGinty Email:b[EMAIL PROTECTED] Skype:brandon.mcginty Msn:[EMAIL PROTECTED] Aim:brandonmcginty0 (Not currently available.) Cell:4802025790 (Weekends and nights only, please.) Languages:python, php, autoit; Currently Learning:perl Kindness is a language that the deaf can hear and the blind can see. Mark Twain -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python (speed-wise comparison)
[EMAIL PROTECTED] wrote: Anyone know which is faster? I'm a PHP programmer but considering getting into Python ... did searches on Google but didn't turn much up on this. Thanks! Stephen If you're talking about usage as a server side scripting language, then PHP will likely give better page serving throughput for the same hardware configuration versus even something that is mod_python based (but I believe the speed diff would be well under 100%). However, Python is just so much superior as a language (I was deep into PHP before I tried out Python and I always hate having to go back to PHP nowadays in the cases where it is unavoidable) that you will still want to use Python even if PHP requires lower server specs to handle the same throughput. Also, if you have a more complex application for which pooled variable reuse is an important performance-determining factor, Python-based server-side scripting solutions might offer better control of this aspect and may thus yield superior performance to a PHP-based one. The real problem with Python is not speed but _availability_. The number of hosting services out there supporting mod_php completely outstrips those supporting mod_python. Moreover, they are significantly cheaper, and offer a lot more features (Fantastico, etc...). The python-based hosting solutions out there tend to be dedicated to Python and thus do not offer these solutions. If this is not an issue (i.e. you will be running your own server), then I highly recommend going the Python route using something like Spyce (which is the closest thing to PHP in the Python world). -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python (speed-wise comparison)
Dnia Tue, 28 Dec 2004 02:54:13 +0800, Jon Perez napisa(a): If you're talking about usage as a server side scripting language, then PHP will likely give better page serving throughput for the same hardware configuration versus even something that is mod_python based (but I believe the speed diff would be well under 100%). I have different experience. When I moved from PHP to Webware and I compared its performance with (similar scale) php appplications, my webware was almost 6 times faster! Application servers are always faster because they use compiled scripts stored in memory. They do not need to load files from filesystem nor parse them. PHP is faster only for trivial, useless benchmarks like Hello world. For bigger code Python is faster than PHP. The real problem with Python is not speed but _availability_. You have rigth here. -- JZ -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
Paul Rubin wrote: I've never heard of any large sites being done in Python, with or without scaling. By a large site I mean one that regularly gets 100 hits/sec or more. There are many sites like that out there. Those are the ones that need to be concerned about scaling. How exactly would you know which large sites are using Python? The PHP sites tend to advertise their use of PHP by file extensions on every URL, but a lot of Python sites don't. I don't know how to tell how many hits a random site has, but there are certainly some big users out there. For example Viacom uses Zope for many of its CBS and UPN websites. LastMinute.com, who definitely hit your large site definition, were working with Zope as well although so far as I know nothing has yet reached their live site. -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
Dnia Wed, 22 Dec 2004 20:57:07 -0500, Robert Kern napisa(a): I think he means, scale to larger programs, not scale to more processors. Yes. I will try to be more specific. There is several reasons why Python scales better than PHP. (1) Python uses namespaces, PHP - not. The bigger programm the bigger probability of conflict among names in PHP. (2) Not only PHP lacks namespaces. It has one big inconsistent mess with its function naming! Inconsistent prefixes, order of parameters. Mess. It is difficult to memorize it. Python programming need less interupting for reading manual. (3) Python uses modules, PHP - not. Python can download single or some classes from many big modules (eg. from module1 import class1, var1, fun1). PHP is primitive in its copy-paste *all* included files! So Python uses less memory than PHP and do not need to parse so many lines. (4) Python automatic compile every imported modules into bytecode, PHP has to parse all those mess. Without accelerators PHP is much slower for bigger applications. This is the reason why PEAR is so slow. This is the reason why ezPublish is so slow. The bigger code (more included files), the slower PHP works. (5) Python compile its modules automatic and do not need to parse them for every browser request like PHP do. (6) Pythonic application server (eg. Webware) do not need to load and parse any files from filesystem at all! It loads them once, compile it and store compiled scripts in memory. PHP has to load files from filesystem, parse them and execute. From my own experience: when I moved from PHP to Webware and I compared its performance with (similar scale) php appplications, my webware was almost 6 times faster! (7) Python has much better free IDE editors with graphic debugger inside. PythonWin, Boa, SPE, Eric3 etc. It is much easier debug in Python than i PHP for larger programmes. (8) And last but not least. Python is truly object oriented, general purpose language. PHP is not general purpose language. PHP4 has very poor OO. (PHP5 has better, but has also some useless new features like private variables. They have sense for static compiled languages like C++ or Java , not for dynamic ones.) Python also uses sofisticated exception handling, uses namespaces, has module import, has better unicode support, has more consistent api etc. One more example from my experience. I always have problem with converting string among iso-8859-2, cp1250, mac-ce and utf-8. PHP utf8 functions are poor, implements useless (for me) iso-8859-1 only. iconv library for PHP is even worse, when it cannot convert some characters it deletes the following characters! PHP has no such like: unicode(txt, 'cp1250').encode('cp1250', 'xmlcharrefreplace'). When some characters exists only in cp1250 but not in iso-8859-2 that function convert them into xml entity #number; Cute! -- JZ ICQ:6712522 http://zabiello.com -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
Eric Pederson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] My beloved Python-oriented webhost doesn't currently support Mod-Python You can always do what I did. I wrote the backend of my app in Python and run it as an XML-RPC server. I did the front end in PHP using the Smarty template tool. (The actual templates themselves were stored in the Python server and grabbed via XML-RPC). Effectively PHP/Smarty were formatting XML-RPC results, delivered as Python dicts which turn into Smarty arrays (and it all works fine with nested lists and dicts). That way I got the best of both worlds, didn't have to get mod-python installed, and *my opinion* is that Smarty is the nicest template tool I have tried in Python or PHP. Roger -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
I like the idea of being able to port specific sections to C ... Python seems more flexible than PHP ... scalable. We're mainly using it to drive dynamic web apps ... online store ... etc. Thanks Again! Stephen -- http://mail.python.org/mailman/listinfo/python-list
Re: PHP vs. Python
Stephen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I like the idea of being able to port specific sections to C ... Python seems more flexible than PHP ... scalable. If you want portions of your code in C, then wrap them with Swig. That way they can be available in any number of languages including Python, PHP, Java and Perl. http://www.swig.org/compare.html Roger -- http://mail.python.org/mailman/listinfo/python-list
PHP vs. Python
Anyone know which is faster? I'm a PHP programmer but considering getting into Python ... did searches on Google but didn't turn much up on this. Thanks! Stephen -- http://mail.python.org/mailman/listinfo/python-list