TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP Addiction

308 pointsby nphasealmost 13 years ago

56 comments

cletusalmost 13 years ago
Is it my imagination or is Marco the king of writing blog posts that are quick reactions to whatever is trending on HN?<p>The message you should get from this post is that familiarity with one's tools easily trumps any aesthetic flaws (consistency in parameter ordering, naming conventions, etc are really nothing more than aesthetic flaws and not "deep" [1] as the author suggests. After all, human language is inconsistent. After awhile you just get used to it and don't think about it anymore. Programming languages are no different.<p>I agree with Marco that it will take "years to master" whatever he chooses next. I always scratch my head at these "I learnt Python in a day" claims you often see around here. No, you didn't learn Python in a day. You learnt the syntax for a for loop in a day. Idiomatic Python takes much longer.<p>I don't agree that choice is the reason people don't use Linux on the desktop. Desktop Linux is the reason people don't use Linux on the desktop. I'm sorry but it's truly awful and probably won't ever get better. In the absence of product direction you have us geeks making everything configurable because, you never know, you may want to write your own window manager (and knowing us geeks, no two will agree on what's right) so you have no consistency, no grand UI/UX design and it's just terrible.<p>I use Linux/Ubuntu at work basically because I have to. There are advantages on having your dev environment mirror your production environment and Linux (over OSX) does actually have a package system (it's a messy hack on OSX) but I certainly don't like it.<p>The only computers I use that I truly enjoy using are my iPad and my Macbook Air.<p>Fear of the wrong choice isn't I believe what motivates most people. Fear of looking like an idiot? Sure. But that's different and will probably be the case with anything new.<p>People don't tend to weight up two or more options, decide which is best and go with it. They tend to use the first thing they come across until its flaws (perceived or actual) outweigh the "cost" of transition and appearing like an idiot for awhile.<p>[1]: <a href="http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/" rel="nofollow">http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...</a>
评论 #4178379 未加载
评论 #4180370 未加载
评论 #4178118 未加载
评论 #4178480 未加载
评论 #4178541 未加载
评论 #4178627 未加载
评论 #4178973 未加载
评论 #4180439 未加载
评论 #4178414 未加载
评论 #4178315 未加载
z92almost 13 years ago
Here is another point that highlights the problem:<p>If I want to write a hello world application in PHP, it's neither as long as &#60;?php print("hello world");?&#62; nor as short as &#60;?="hello world"?&#62;<p>Rather it's simply: hello world. Just type in those 11 characters in a text file and save it as hello.php. Now load it on your browser [or run it from command line] and it will print hello world. I don't think it can get any more simpler than that in other languages. PHP was developed from the ground up as a templateting language for serving HTML pages. These other languages are more of a general type.<p>Therefore the replacement for PHP should come through a new language targeted as a replacement for PHP as Jeff said. Otherwise there always be extra web/template stacks for the developers to take care of. And that will be the first hurdle to learn and overcome for novice developers looking for switching to something easier.
评论 #4177815 未加载
评论 #4177793 未加载
评论 #4177855 未加载
评论 #4177800 未加载
评论 #4178048 未加载
sho_hnalmost 13 years ago
That's one of the problems with the now-famous Fractal blog, I think: It was a joy to read in the sense that being a Python programmer, it only heightened my appreciation of the achievement that languages like Python and Ruby represent. It's what conscious, determined design gets you and what mistakes they managed to avoid.<p>But it's preaching to the choir. If you've never seen anything other than PHP, you won't understand two thirds of the list or why they're problems. (&#60;- Not looking down on PHP coders there, rather I'm thinking back to when I started out on PHP and am speculating on how I would have received the document.)<p>How do we communicate effectively what makes other languages better to someone with no reference frame other than PHP itself?
评论 #4177556 未加载
评论 #4177687 未加载
评论 #4180154 未加载
评论 #4177739 未加载
espeedalmost 13 years ago
<i>The fear of making the "wrong" choice actually makes the familiar, mastered PHP more attractive.</i><p>The multi-core reality means that the long-term languages will have a strong concurrency model. Clojure and Go are two languages with strong concurrency models that are building momentum and have potential to go mainstream.<p>But for your first foray out of PHP, I would pick a language that has a large, well-established community with mounds of documentation, books, and resources.<p>My path out of PHP would be:<p><pre><code> 1. Python 2. Clojure 3. Go </code></pre> Learn Python first because it's easy to learn, easy to read, and it's taught at major universities so it's easy to find smart people to help. It has a large community behind it, which is still building momentum, and it has a huge library so it's generally more useful than Ruby.<p>Then once you're comfortable with Python, I would venture into Clojure. It's different, but in a good way. And you get access to all of Java's libraries so it's practical now, even though it's relatively new.<p>And then look at Go. Go is building momentum fast, but right now it doesn't have the massive libraries that Python and Clojure have. However, in a few years, this will change.
评论 #4178361 未加载
评论 #4180016 未加载
tom_malmost 13 years ago
The only thing flawed with PHP is your outlook on it. People with money (investors, clients, etc.) don't care about ANY of the nuances mentioned here or by Jeff Atwood. At the end of the day, we use PHP and are rewarded for doing so. If you want to use another language or make a new one...Great. Do it. But I'm not sure why some people just want to try to change an entire industry and move people off of PHP... It makes no sense. No one is holding a gun to your head to use PHP. You have alternatives and if you're not happy, make something yourself. You can't have everyone hold your hand your entire life and do things for you.<p>PHP is good. I'm living proof of that. I'm a very successful developer and PHP does just about everything I ask of it. I also find it enjoyable (when you don't use crap frameworks or CMS' like Drupal). For those of you that do struggle with PHP, then what on God's green Earth makes you think you'll do any better with the next language? There comes a point when you've rifled through everything saying they are all junk that you gotta look in the mirror and ask yourself what's really the problem?
评论 #4177988 未加载
pkulakalmost 13 years ago
Is learning another procedural/OO language really that tough? I've put off learning Haskell/Erlang/etc because it's such a shift in thinking, but PHP/Ruby/Python/Java/JS/C-whatever seem to all be about the same. There's some new syntax, and entire new libraries, but it just means you have have the docs open a bunch at first. I find I have to actively _keep_ myself from starting new projects in the new flavor of the month and force myself to use something that I know much better and that is much more proven. I think I'd be rather proud of myself if I got a whole project done in PHP rather than Node or Scala or JRuby or something like that.
xyzzybalmost 13 years ago
Disclaimer: I'm a Rails programmer for work and hobby.<p>Interested in learning something that isn't PHP to code your web applications in? Ok. You have a ton of options and this is a very exciting time to be a web developer.<p>Do you want to lean towards stability and proven concepts and work within a full application structure? Look at Django and Rails.<p>Do you want to serve up responses from a simple script without a lot of extra pieces? Look at Sinatra and Flask.<p>Do you want to get in on the cutting edge and don't mind forging some of the path yourself? Look at Node.js and Meteor.<p>Got a high level decision made? Sweet. Now compare the primary languages between your choices (forget the framework for now). After a few minutes looking at each, which reads better to you? Feel free to go on gut instinct here: there are no wrong choices.<p>You've now made a choice for your next learning target. Now: don't spend years. Don't worry about knowing everything about the framework and the language. Google for "X tutorial" and follow the first link that looks reasonable and current. Do that tutorial. Now you have some bearings within the framework and have some idea of how it thinks.<p>Now. Pick something you want to build (a todo list is popular now, it used to be a blog or a wiki). Build it. You will make mistakes. You will be confused. Google for answers (if you're in Node.js or Meteor you will have trouble here) or hack until you get something working.<p>Throw what you built up on github and ask others to check it out. Build something else. Repeat.<p>If you are already a decent programmer with a good grasp of the web and how HTTP works: you will pick up any of these frameworks well enough to work in it in a month or so. In six months you'll be well advanced: especially if there are good books available for the framework/language you are working in.<p>Have fun!
评论 #4177514 未加载
评论 #4177669 未加载
评论 #4177821 未加载
jmdukealmost 13 years ago
I'll sound like a broken record, but I'm convinced Flask is the perfect transition.<p>It's built for smaller web apps, and rapid prototyping. The system of mapping endpoints to functions is incredibly intuitive -- if you've used Python before, learning Flask is incredibly easy.
评论 #4177863 未加载
评论 #4178458 未加载
评论 #4177640 未加载
评论 #4177499 未加载
评论 #4177508 未加载
评论 #4178111 未加载
dansoalmost 13 years ago
I hadn't heard of his Second Crack project until reading this post...it's a static blogging engine similar to Ruby's Jekyll <a href="https://github.com/marcoarment/secondcrack" rel="nofollow">https://github.com/marcoarment/secondcrack</a><p>I know it's difficult to compare or find an observer who could adequately judge between the two, but I wonder if Ruby made Jekyll easier to write and maintain? Of course, there's not any easy way to make that judgment without knowing how much effort Marco put into Second Crack versus what was put into Jekyll.
Timotheealmost 13 years ago
I've been having a similar problem with the added difficulty* that I don't do development as my full-time job (yet) and have been coding mostly for developer contests and hackathons.<p>So when I start something that has a deadline in 24 hours or just a few days, I can either fall back to PHP to get something going fast or spend most of my time just learning a new language. So, I have been typically going with PHP…<p>I've found that the important thing is to take the time to set yourself up with the minimum environment that can get <i>something</i>, <i>anything</i> going in a different language: that means whatever is needed to print something on a page and get some logic working with GET and POST parameters. Because the nice thing with PHP is that it's so easy to write a single file that displays text on a page, or that responds to POST and GET parameters with some logic behind it. If I started with Ruby for example, I wouldn't know how to do this basic thing. (granted, with Rails and Heroku, this is easy)<p>My plan is to make Python my generalist programming language and I started to look at Flask (<a href="http://flask.pocoo.org/" rel="nofollow">http://flask.pocoo.org/</a>) for that reason: it's a mini-framework that doesn't take long to learn how to do these simple things. I can then play with it for simple things.<p>*though it can make things easier since I can just work on whatever I want in whatever language I want :)
RyantheLoualmost 13 years ago
So, I wouldn't really call myself a "programmer," because I'm a front-end web designer. I'm learning more and more web programming and I'm obviously using PHP. The main issue I see with languages like Ruby or Python for novices like me is that when you ask a novice (running on Windows) to go into the command line, that's like asking a cook to go milk cows. The cook will figure it out, but fuck you.<p>Sure, there's a learning curve to any new language, and I would love to learn a "better" language, but, if you can't explain to a novice why a certain language is better, the novice is going to go for the smallest learning curve and the language with the best/most ubiquitous documentation.<p>What do Python or Ruby do that PHP can't? Are they "faster?" I've heard that they are more secure, but does that mean that PHP can't be as secure if a skilled developer is coding for security? People say things like "rapid development," but I've been using CodeIgniter and it seems pretty rapid to me. What it all comes down to is this: are Ruby and Python "practical" for novice programmers like me? Truly? If not, then doesn't it make sense to start with a language like PHP and then, when you have figured shit out, make the jump to Python or Ruby? I wish this was more clear.
larrysalmost 13 years ago
"Whichever language I choose to replace PHP will have its own problems that will take me years to master, but by the time I know whether I chose the “right” language, I’ll have invested far too much time in it to practically switch any meaningfully sized project to another language: exactly the situation I’m in now with PHP."<p>Something that I'm not seeing people take into account generally when they decide to develop in a "new" language or complain about any established language additionally is how far along that new language is and how many people know it well. Choosing the best thing also involves how easy it is to get the help of others. An analogy might be an automobile purchase. If you are located in the middle of nowhere it might be a better idea to buy the Honda where there are multiple local dealers rather than the NewGreatAuto (pick any car with less market share that is better price and feature wise) where you have to travel 50 miles each way for warranty service.<p>I went through this with hardware back in the 90's choosing SGI servers that were better price and performance wise than Sun, only to find that many open source software ready to run was not available for SGI. And that there were less people that knew IRIX than Solaris.
restlessmikealmost 13 years ago
If you're a really good PHP developer and are considering using another language, you should ask yourself one question:<p>Why do I need to switch?<p>You've already gone through the pain of learning how to work around all of its warts, and you will lose a ton of productivity immediately after switching to a new language. This may seem trivial if you are just programming as a hobby (and fun, even, to learn something new) but if you are a professional programmer, the productivity loss can be a problem. If you are a freelancer billing at a good rate, can you charge the same thing to your new client knowing things will take you twice as long and be less optimal, with bugs happening in new surprising places?<p>Taking on a new language needs to happen for a better reason than "the language I'm an expert in is kind of ugly." Are there libraries that are only available in the new language? Is there a different server architecture that lets you write applications with several times the performance in certain important use cases? These are valid reasons. "Too many functions in the global namespace" is not, especially if you already have them all memorized.
评论 #4178159 未加载
评论 #4177946 未加载
lukiferalmost 13 years ago
Being addicted to PHP is like being addicted to coffee; for some of us, it works, and we're just fine with that. Code quality comes from the programmer, not the language.
playhardalmost 13 years ago
i have been a PHP programmer from college. Switching to python was the best decision i made.i'm just in love with python.
评论 #4177454 未加载
zaptheimpaleralmost 13 years ago
Really, I wouldn't worry about making the "wrong choice". I can identify with this, and I think its a reflection of perfectionism, which is not a good trait to have especially when you want to make something new. It takes years to master a language/web dev framework, and considering the pace at which web dev is moving these days, your mastery will be incomplete and slightly outdated by that time anyways. The point is, thats not the goal you should have in mind anyways. You can start from scratch with a new web framework and start being productive in a week, two weeks tops. After that, just use it for your projects and allow the experience of those projects to help you learn more about the framework/language.
gojomoalmost 13 years ago
Perhaps someone should make 'PYP', a Python that's easy for PHP programmers.<p>Like PHP, .PYP files would be templates with no limits on mixing presentation and logic. The filesystem hierarchy provides the default URL-routing.<p>But, you get the regularity/power/compactness of Python wherever you want it. (Perhaps, every line in a .PYP file beginning with '\' is meaningfully-indented Python.) If you ever want to hijack a part of the URL-space from the filesystem, there are routing utilities to do that.<p>Would such a glide-path from PHP to Python be a good thing? Or bad? ("The barbarians are at the gates!")
评论 #4178609 未加载
评论 #4179195 未加载
lucian1900almost 13 years ago
Either Python or Ruby, or any number of other languages, are <i>so</i> much better than PHP that it doesn't matter if you make the slightly less ideal choice.<p>Go with Python if you already find it appealing.
podpersonalmost 13 years ago
I'd suggest switching to JavaScript (or CoffeeScript) instead of Python or some other trendy language.<p>a) You need to know it anyway.<p>b) Node.js is awesome and works the way web servers ought to work.<p>c) JavaScript, if you avoid the obvious warts, is a really nice language. Every other language I've learned either has as many warts as JavaScript or isn't practical.<p>Having picked JavaScript, it turns out to be amazingly powerful. Need to automate content production? Adobe's stuff is all scriptable via JavaScript. Want to write a 3d game? Unity uses a dialect of JavaScript.
评论 #4181347 未加载
pragonealmost 13 years ago
I was in the exact situation a year or so ago. Everything I wanted to build, I always went straight to PHP.<p>I stopped myself from, unfortunately, not building things. I've spent the last year learning Ruby, Python, Rails, Django, and a half dozen javascript frameworks to get myself acquainted with it all. Only recently I took a position where I'll be working with Rails full-time. It's a tough addiction to break, but it's so liberating once you learn what else is out there and what you can do with it!
zaptheimpaleralmost 13 years ago
I think the simple problem with PHP is that its dated. Regardless of whether the language has serious flaws or not, the fact is that it takes a lot more effort and code to do the same things that new web frameworks let you do with a few lines of code. PHP is a great way to learn the basics because it doesn't have quite as many abstractions but that leads to slower development times, and plain bad code (insecure) if the dev doesn't know what hes doing. By the way, I'm referring to slower development times for decent size projects, not quite "hello world" (Honestly, even "hello world" would just be an HTML page and a route in django or RoR - 2 lines vs 1).<p>So if I was operating in the capacity of a recruiter for a project/company/startup, I'd definitely pick a skilled RoR dev over a skilled PHP dev, because the frameworks and the language themselves are handicaps for the PHP dev. Even if PHP is faster for a very small project, as soon as you move into a decent sized project, the frameworks start paying handsome returns for using them.<p>Note: I don't particularly love RoR/Django. Substitute with your favorite framework. It's just to illustrate a point.
评论 #4178289 未加载
评论 #4178027 未加载
评论 #4178007 未加载
mappualmost 13 years ago
I have a lowendbox for personal PHP projects. I'd love something with a little more static typing, but there's really no alternative (maybe Perl in strict mode?) that isn't going to blow out my 128M ram (no chance of Tomcat). Perhaps C++, but i'd need to first sort out a good templating system, and FastCGI wrapper / spawner.
crazygringoalmost 13 years ago
Question: is there a Node.js package out there that lets me write in PHP style, without having to configure <i>anything</i>?<p>I mean, I install node, I install the node package, I start the server...<p>And then it just looks for an "index.node" file or something in a directory? URL's would map to node files? It would use some kind of templating syntax like &#60;? ?&#62; or whatever, but the point is, it would be as easy to use as PHP. (Each template could get the URL parameters, and read session variables, just like PHP.)<p>I've used Express, of course, but that's overkill for throwing together a little website. People <i>love</i> the PHP model of files. It's clearly not theoretically ideal, or particularly scalable, but it works and is easy.<p>Anything out there? Maybe I should throw it together myself...
评论 #4179645 未加载
ChikkaChiChialmost 13 years ago
Whatever language you are fluent in, its going to be difficult to switch to another language. Sure, I get the syntactical sexiness of Python, but learning its proclivities really would take years.<p>The fact is that my comfort with PHP stems from knowing what I know, knowing there are things I don't know, knowing there are unknowns I don't know, and knowing there are unknowns that are unknown. (Thanks, Rumsfeld)<p>Its this grasp on the language that gives me comfort. Mix that in with the universality of PHP and I'm more than willing to take my lumps for being told I solve problems using a shitty language.<p>There are shitty guns and shitty marksman. A good marksman can kill you with a shitty gun, but a shitty marksman will always be a shitty marksman.
raintreesalmost 13 years ago
Ah, but that's the whole joy of it! Although I have a large enterprise-type code base in Visual Basic/Access Basic, I am still trying to nudge my next project into Python because I love learning new things!<p>Same with my distro - I am currently using Mint, but that may change, when my next boot hard drive fails.<p>Even with VBA, where I had done much of the work using DAO (started in 2005 with what I already knew) I am now trying to make the next changes using ADODB. The benefit being it will be easier to shift the back end to MySQL (or any other ODBC-compliant flavor) and have more then one language used in different front ends.<p>Ah, the learning! My joy in life.... And these days, thankfully little tuition required.
anurajalmost 13 years ago
At two extremes 1) You want to develop something fast and dirty - Go for scripting language. Out of them PHP is the dirtiest and fastest out of gate and thus the best choice. 2) Want someting battle hard with lots of extendability - Go for a stuctured language - Java or C# will work best here.<p>Between these two extremes run all others with their fair share of incongruencies and imperfections. They are just not popular and probably never will be. So I don't care. Let me know when there is a language that slaps me on the wrist for bad design and coding!
torrenegraalmost 13 years ago
I am always surprised with the level of argumentation in reference to programming languages. From my perspective, good development paterns and arquitecture are WAY more important than the language. It's similar to writing poetry or novels: picking one language over another won't make you a great writer automatically. Can you imagine Cervantes and Shakespeare arguing whether Spanish or English was better? What's most important is what you do with the words of the language, and not the language itself.
评论 #4179670 未加载
tfbalmost 13 years ago
I switched from PHP to node.js and haven't looked back since. And I know node has its shortcomings, but in time I have no doubt that they will be sorted out. Right now it does absolutely everything I need it to do and more.<p>A huge part of node's appeal to me (and many others, I'm sure) was the fact that I already knew javascript. Making the switch couldn't have been easier.<p>I used to defend PHP; but now when I look at PHP code, even well-written code, it just makes me go "ugh".
评论 #4178544 未加载
lekealmost 13 years ago
The PHP problem for me least is always available of existing projects I can modify. The last thing I did was an availability calendar and I soon found a perfect opensource one already written in PHP. A few customer specific modifications later, and I had finished my task. I did look for one in python, but didn't find anything. If I had to write one from scratch, it would be in python, but why reinvent the wheel?
ojralmost 13 years ago
Tumblr, Wordpress, Facebook, Instapaper, Wikipedia... PHP has a stronghold, an opensource equivalent implementation for each platform would take forever
评论 #4177986 未加载
juddlyonalmost 13 years ago
What's with the 'PHP sucks' fixation? Enough already. It doesn't help educate others, it makes you look like a know-it-all.
davidwalmost 13 years ago
See, once again: <a href="http://www.welton.it/articles/programming_language_economics" rel="nofollow">http://www.welton.it/articles/programming_language_economics</a><p>It's not exactly mind-shattering stuff, but it's nice to have some common terms to describe the properties programming languages have that make them the kinds of products they are.
figitalalmost 13 years ago
I've just been rewriting much of the stuff I can't stand (or adding the stuff I can't find) like this ... <a href="http://tetraboy.com/lolcode/" rel="nofollow">http://tetraboy.com/lolcode/</a> and various easy helper libraries for more intuitive/flexible functions .... listcontains("1|2|3", "|", 3). Most problems solved.
CoffeeDregsalmost 13 years ago
On PHP:<p>This discussion seems to be missing a key factor: <i></i>context<i></i>.<p>I seriously dislike PHP and its inconsistent, unpredictable features and libraries. I avoid PHP whenever reasonable/possible. I also avoid talking to mean, verbose or dumb people whenever reasonable/possible. But sometimes I just gotta do it...<p>So I use PHP, Python, [Java|Coffee]script, Ruby, Django, Pyramid, Express, Wordpress, Joomla, or whatever else is the right tool for the context/job.<p>In the context of building a 100M request/month API server, I used Python + Django. I would never have used PHP and I consider it a serious mistake to build large scale systems in PHP. Of course, others would choose Ruby, Clojure, Java, Scala, etc and those are all reasonable answers. I happened to be able to get the thing up and running fastest and most effectively in Python + Django.<p>In the context of currently re-building a client site that needs social features, a small CMS, etc, we're using PHP and Wordpress. I would never have used Python + Django because the client would not know how to host it and whomever is called on to fix a template is going to have to set up a Python stack, learn git and SSH, log into a VPS, etc in order to tweak anything.<p>Blends are good, too. We recently worked with a client where the website <i></i>and<i></i> application were built in PHP/Wordpress, but their API was Python. The "application" was basically a handful of Wordpress templates that pulled API data. They got the nice little CMS interface of Wordpress which made the website admins happy, but the developers got to do the heavy lifting in Python. Their anti-PHP developers were quite happy with the arrangement.<p>On Marco's post:<p><pre><code> If you can get PHP programmers to agree that they need to stop using it, the first question that comes up is what to use instead, and they’re met with a barrage of difficult choices and wildly different opinions and recommendations. </code></pre> Yep and that's true of everyone who's ever behind <i></i>a curve when the curve is shifting<i></i>. The ice cutters knew about refrigeration, but couldn't adapt. And the curve doesn't always just shift up or down; sometimes it branches crazily and the only way to adapt is to jump into the fray. Even then bad things can happen: Kodak predicted digital cameras, jumped into the fray and basically invented everything and they still got crushed by the digital camera transition.<p>I think the tension for PHP developers is in understanding on a personal-level how and when to make the transition to newer languages. Unfortunately, many seem to ignore the <i></i>possibility<i></i> that a transition is underway.
评论 #4178164 未加载
karlsheaalmost 13 years ago
The problem is pretty much what the article he discusses mentions: I can copy up a PHP file to any old random web host, and it will Just Work.<p>I would love to be able to not write PHP. But the language that replaces it has to be that easy to deploy.
评论 #4177659 未加载
评论 #4178043 未加载
mjacksonalmost 13 years ago
The reason you describe your relationship with PHP as an "addiction" instead of using a word that described a more healthy relationship is probably because there is something about it that doesn't resonate well with your core values. At least that's the problem that I had with it.<p>If you want a nice introduction into the world of developing web apps with Python, I suggest you read the Flask user manual (see <a href="http://flask.pocoo.org/docs/" rel="nofollow">http://flask.pocoo.org/docs/</a>). It not only covers the basics of the framework, but also seems to assume that you're a first-time Python user as well. It covers topics such as using virtualenv and pip to setup your environment which I found very helpful when getting started with the language.
valehalmost 13 years ago
I have the same problem nowadays and think about migrating to Java for web development. I heard about Play! framework very much. Do you think Java is a good idea for web over Python and Ruby?
评论 #4178078 未加载
njharmanalmost 13 years ago
A victim must want help.<p>Make small incremental steps.<p>The investment you think you have in X (PHP) is less than you think. It's much more in how to code, how web works, etc. the PHP parts are cruft you won't miss anyway.
qixxiqalmost 13 years ago
I've had a similar issue and have even come up with some suggestions myself[1], but really I think there is only one company in the right place to produce a serious PHP competitor. Facebook.<p>They have the man-power required to displace it, as well as the serious need... although the only potential solution they have come up with HipHop / HPHPi is really lacking in community support. Its open source but rather undocumented, and took an entire day to get set up.<p>If they could produce a viable alternative to PHP... something that fixes the clear fuckups but doesn't try to fix everything I think it would have a real shot.<p>[1] <a href="http://davelang.github.com/" rel="nofollow">http://davelang.github.com/</a>
benguildalmost 13 years ago
Wow, this is EXACTLY the same problem I have... word for word.
评论 #4177675 未加载
runjakealmost 13 years ago
How do PHP people handle templating simply?<p>Edit: Perhaps I worded my question wrong. How do PHP programmers try and keep to DRY (ala layouts and view templates)?
评论 #4177772 未加载
评论 #4177829 未加载
评论 #4177738 未加载
评论 #4179207 未加载
评论 #4179235 未加载
bootloadalmost 13 years ago
<i>"... The fear of making the “wrong” choice actually makes the familiar, mastered FOO more attractive. ..."</i><p>An excuse for not learning something new.
alainbrydenalmost 13 years ago
Looks like PHP is the VBA of web design.
poundyalmost 13 years ago
"There are only two kinds of languages: the ones people complain about and the ones nobody uses."<p>-Bjarne Stroustrup
评论 #4178032 未加载
capitaoalmost 13 years ago
i'm so bored of these arguments and how people get so religious. its honestly nuts.
adventurefulalmost 13 years ago
The only thing actually wrong with PHP, is that it's popular but not cool. And that's a terrible place to sit for any product.<p>It runs half the Internet quite well, but if you went by the posting on HN, you'd think it was Windows Vista.<p>I've probably read every article critical of PHP that has hit the front page of HN in the last few years, and the one thing they all have in common is the vague refrain that PHP is a broken language. And yet the gap between tangible proof of that being the case in real world use and the gossip of it supposedly being true, couldn't be wider.
评论 #4178056 未加载
评论 #4177823 未加载
评论 #4177862 未加载
评论 #4177910 未加载
评论 #4178025 未加载
评论 #4177825 未加载
评论 #4177865 未加载
papsosouidalmost 13 years ago
&#62;the first question that comes up is what to use instead, and they’re met with a barrage of difficult choices and wildly different opinions and recommendations.<p>The real answer is "it doesn't matter". Of course python people will try to convince you to use python, and ruby people will try to convince you to use ruby. But both groups will agree that either language is far better than PHP. And as someone who likes neither of those languages, I would agree with both of them, just pick one. There's no "wrong choice" to worry about.
评论 #4177462 未加载
评论 #4177771 未加载
评论 #4177737 未加载
adventurefulalmost 13 years ago
Yeah, I wrote Tumblr in PHP, but I'm eager to abandon it. You know, it's just an easy to use, broken language that you can scale a site to 15 billion page views per month with. I'm sure my next project will need a better language, because it's going to scale to 400 billion page views per month, and PHP just isn't going to cut it.<p>Hilarious suggestions contained throughout his post.
评论 #4177789 未加载
评论 #4177708 未加载
drivebyacct2almost 13 years ago
&#62;"Whichever language I choose to replace PHP will have its own problems that will take me years to master"<p>What? Really?
评论 #4177898 未加载
评论 #4183477 未加载
gcbalmost 13 years ago
<p><pre><code> "[php solves problems etc] but it's deeply flawed. [...] I promised my next project i would code in something else [...] but i went right back to PHP" </code></pre> This really struck a cord here... Is that the first signal that tomorrow I will be the Cobol guys of yesterday today?<p>Or is it just a signal that PHP is indeed damn practical for web prototypes that tend to overgrow?<p>i'm pretty comfortable dumping C and assembly to microcontrolers (kidding, nobody is. damn datasheets full of mistakes) and automating every bit of what i do in bash and python. but i can't get away from PHP for web crap!
hk_khalmost 13 years ago
Well, there's a solution.<p>Do not write every part of a project in only one language. Following the UNIX "Small is beautiful", most projects can and are cut to small things that work together.<p>I often find myself writing a library in Python and publishing it's API in web.py, building services that rely on this API in Node.js, and making the final website in PHP.
moronalmost 13 years ago
Its benefits are vastly outweighed by its negatives for me. I've made things in PHP before but if I ever do it again, it will be too soon. Sounds like a nasty addiction.
baqalmost 13 years ago
my advice? stop writing blogs and start writing python.
cjohalmost 13 years ago
I don't understand why someone does not just fork PHP and create something that's syntactically similar but fixes a lot of the problems people complain about.
评论 #4177776 未加载
评论 #4177799 未加载
jeniusalmost 13 years ago
"...next language choice was clear: Python, which seems to fit my style better than Ruby"<p>Just out of curiosity, why would someone believe this? The syntax of python and ruby are nearly identical, but ruby has more tools and support for web-based projects. For someone looking to develop for the web, ruby is pretty clearly a better choice. And this is not knocking python at all, I really enjoy them both and there are many other things python has more community support for - don't get me wrong.<p>To support what I'm saying about the syntax, check out this comparison: <a href="http://hyperpolyglot.org/scripting" rel="nofollow">http://hyperpolyglot.org/scripting</a> - they are super similar, if anything ruby is a tiiiny bit more elegant.
评论 #4177757 未加载
评论 #4177746 未加载
评论 #4177756 未加载
评论 #4177857 未加载
Kilimanjaroalmost 13 years ago
I propose this as a blueprint for a solution:<p><pre><code> {% name = request.get('name','world') list = ['this','language','rocks'] %} &#60;h1&#62;Hello {{ name.upper }}&#60;/h1&#62; &#60;ul&#62; {% for item in list %} &#60;li&#62;{{ item }}&#60;/li&#62; {% endfor %} &#60;/ul&#62; </code></pre> Save it as 'index.nxt' and run it in any future language you are going to design.<p>Create a mod_next and try it on any web server like apache, nginx, etc. It should work without any extra fiddling with config files or installing frameworks or template engines.<p>It should just work!<p>That's the kind of platform that would leave php behind once and for all.
评论 #4178109 未加载
评论 #4178602 未加载