TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

When PHP Actually Is Your First Programming Language

30 点作者 reid超过 16 年前

9 条评论

IsaacSchlueter超过 16 年前
This is dead on: "Whatever you choose to learn as your first language, the key is to learn from great code."<p>It's also worthwhile to learn a lot of other languages. Do it as soon as possible in your career, especially Lisp and C. No matter what language you may use, you'll probably benefit from knowing these two. The danger with any "first language" is that you may never learn a second.
评论 #324636 未加载
评论 #324618 未加载
jlujan超过 16 年前
It is still shooting yourself in the foot. There are a lot of questionable design decisions that will take a while to unlearn when PHP is your first language. The OO model is still a little screwed up, and uglier than C++ even, because of lack of namespace. There are arguments for and against it, I wont get religious. But if you want to be a "programmer" then you must move quickly from PHP. If you want to only be a web developer... fine. PHP is a baby step, even if you stick to dynamic languages.
ryan-allen超过 16 年前
My first was PHP, I was able to get useful things off the ground, mostly by trial and error, from what was initially very simple examples.<p>PHP's strength is it's so damn easy to write useful, simple scripts. And it's so fast to provide feedback, and it works with an existing metaphor many people understand (upload file to FTP, hit it in your web browser, bob's your uncle).<p>I found it very, very difficult to learn OO as the stdlib at the time was full of nothing but functions. I think you learn a hell of a lot from working with well designed APIs, and let us be brutally honest, PHP's stdlib is about as well designed as a shit-moulded santa claus.<p>I tried learning Java well enough to get some kind of commercial project off the ground but was befuddled, book after book why it took so damn much code to do _anything_. Though I did learn a lot about OO from reading these books, I never got an opportunity to get stuck into any Java to learn how to do things, at the time I perceived as the 'right way'.<p>But unlike PHP to get anything off the ground in Java, you had to install Tomcat, write about 20 lines of something and set up a web container and god knows what else. Compare this to plonking &#60;?= $_GET['test'] ?&#62; in a text file, call it 'blah.php' and hit it. Instant feedback.<p>Since then I've been working with Ruby for about 3 years, and I've finally got my head around how to write decent code, and it's mostly been because of exposure and experience with nice APIs, and being able to work with the higher level patterns that you are just simply not exposed to with rudimentary PHP.<p>Sure, today you have CakePHP, the Zend Framework but they only popped up in the last couple of years, and mostly in response to Rails' influence.<p>In between Rails and PHP I had toted with Perl and Python and enjoyed them thoroughly. I would suggest writing as much damn code as you can in a bunch of popular, and different languages, and you'll be fine :) I'm still yet to play with LISP and OCaml, though I'm keen to have a crack at Lua...
评论 #324776 未加载
dryicerx超过 16 年前
Yup, One thing to add is PHP is good language to start out if you want to be a PHP Programmer / Web Developer and no plans to move over to something else.<p>But if you want to be a generic programmer or get in to the field, it will save a lot of time and hassle if you start out with C/C++/Java. Those cover all the major concepts to begin with, and switching to PHP or any similar language would be very quick if not instantaneous.<p>Then again, I think it's even a better idea to start with something fun and something you really and feel like you are getting rather than jumping to something really complicated.<p>There is no one-size-fits-all language to start with, it depends from person to person.
评论 #324630 未加载
评论 #324837 未加载
sunkencity超过 16 年前
PHP is no different from any other scripting language in that it's a language tailored to get things done, and done quick. If you do something quick with ruby, perl, python you can make it as crappy and sloppy as you can with php.<p>The problem though is that almost every thing written in PHP looks like shit. So PHP programmers trying to learn a good writing style by looking at PHPbb or similar are shooting themselves in the foot. Aha! I could put PHP code in the database and run it by 'eval' - smart idea! Must be really secure templating / programming design since this is such a big project... And what's up with wordpress, a more programmer hostile templating engine is hard to find still people use it.
ashleyw超过 16 年前
Each task has a language or two which will fit the task the best, but don't get hung up in the finer details like which language you should use. Use which ever language feels right, and invest your time into the application itself.<p>(just don't use BASIC)
ars超过 16 年前
"it was horrible. Procedural, PHP inline with HTML, calls directly to mysql library functions"<p>There is NOTHING wrong with any of that! Making something more complicated does not make it better.<p>PS: I use a very strong templating library personally. It's called PHP.
评论 #325304 未加载
评论 #411808 未加载
begemot超过 16 年前
My first programming language was mircScript, and I turned out okay.
kajecounterhack超过 16 年前
Thing to note: Facebook is written in PHP.<p>I laugh so hard.
评论 #324806 未加载
评论 #435791 未加载
评论 #324810 未加载