5 ms·
What made, say, PHP or Visual Basic good for beginners was that they just worked. You wrote a PHP program (in the language, not a framework), saved it as index.
by brandonhsiao 12y ago
What made, say, PHP or Visual Basic good for beginners was that they just worked. You wrote a PHP program (in the language, not a framework), saved it as index.php and suddenly you had a working web app. With VB6, you created a project, dragged stuff onto a window, typed things, and suddenly you had a program that looked just like the other programs you were running on your OS. You didn't spend hours configuring things or typing boilerplate code.
The experienced programmer's goal is to make good stuff; the beginner's is to get his feet wet. These are radically different goals with mostly randomly different tools.
- nkozyra 12y ago> What makes, say, PHP or Visual Basic good for beginners is that they just work. And what makes them bad is they permit, induce or even explicitly teach bad habits. I agree to not discourage someone if they're doing it, but if you have a chance to steer them in a position where they'll be better programmers, you should do that. The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all.
- nmjohn 12y agoBut the thing is for many people (at least for me) was the instant gratification PHP provides can be a powerful hook. With PHP you can create interesting visual things with virtually no experience, no boilerplate required. It's one of the few languages where that is (was, more options today than when I learned) really possible. PHP wasn't the first language I learned, but it absolutely was the language that got me hooked on programming by giving me the power to create things, visual things, interactive things, and more importantly, let me do so without following a step by step tutorial (I had basic html knowledge prior). > And what makes them bad is they permit, induce or even explicitly teach bad habits. Very true, I had some bad habits from php that took me a while to kick, but for me it was a small price to pay. > The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all. These days that may be the case, but many commenters here are referencing when they were learning to program, and a decade ago it was something incredibly unique to PHP.
- jordanlev 12y ago> The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all. This is not what the parent means. In PHP you get a crappy shared hosting account, and copy a file up to the server via FTP and it works. This is not possible with Python, Ruby, etc... you need to do more server setup in most cases. Sure this is due to historical reasons and maybe not specific to "PHP the language", but that is the situation that most beginners face. It's a very simple mental model as well. Services like Heroku kinda/sorta make it simpler for Ruby/Rails/etc., but understanding how those work and getting the command line tools set up is mentally more complex to a beginner.
- nkozyra 12y ago> This is not what the parent means. Well let's be fair, it's what the parent says. Even so, that's a largely outdated piece of "common knowledge" in 2014. Five years ago? Sure. Today? Not as much.
- jordanlev 12y agoGenuinely curious... can you explain to me how to get a single-file ruby or python app up and running on a normal shared host (basically anything that uses "CPanel" or "Plesk")? With PHP: 1. log in to server via FTP or CPanel "File Manager" 2. find the publicly-accessible document root (htdocs, public_html, etc) 3. upload an "index.php" file to that directory with "<?php echo 'hello world';" in it 4. visit http://yoursite.com/ http://yoursite.com/ How would I achieve this most-basic web page on a common shared host in ruby or python?
- nkozyra 12y agoIt's been a very long while since I've been in either of these, but I recall Plesk having a shell. With that the case, the Python/Ruby file could be dumped somewhere (ideally the vhost root) and then just run through the command line in a long-lived process or daemon. Port 80 is obviously taken by Apache, but other than that ...
- 12y ago
- Aeolun 12y agoIt is not that it is impossible to do it in another language. It is just that it is relatively simple in PHP. Single file does not necessarily mean simple. Bad habits can be induced by a language, but if you are still at the point where you're learning the concept of variables, you're way before the point where you'll begin to pick up bad habits.
- FLUX-YOU 12y ago>And what makes them bad is they permit, induce or even explicitly teach bad habits. Do we have a set of good habits defined? That seems no different a question than "What's the best programming language?" and backed by just as much opinion and authority as "Language X sucks! Use language Y!"
- icebraining 12y agoIn that regard, JavaScript is even more accessible; just put a <script> tag around the code, save it as an .html file and double click it. You don't even need installation permissions, since every computer comes with an interpreter installed.
- imakesnowflakes 12y agoAnd you can even do graphics in it too, which may be much more appealing to some one who is trying to learn programming. To me, moving a circle across the screen is much more rewarding than putting a HTML form with 20 input fields on it...
- larrys 12y agoKey to what you are saying (I agree) is that by starting to write something (even a shell script) you get instant feedback and reinforcement. If you are spending time understand a framework you don't get to that part as quickly. While it may seem trivial even having someone see what happens in the shell when they do simply from the command line: Lesson One from the command line: echo "Enter your name:" read x echo "Hello $x" ..is the type of reinforcement that allows someone to feel as if they are making progress. Lesson Two: Ok let's put that in a script and make it executable: ...and so on. (Obviously equivalent examples with Php.)
- n72 12y agoDespite not being a ruby programmer, this is why I've loved _why's shoes framework (http://shoesrb.com/ http://shoesrb.com/) You're not going to use it on an enterprise project, but in terms of just getting shit done with a little friction as possible it's great — and that is precisely what a beginner needs.
- pippy 12y agoI'd take it one step further and argue that it doesn't matter what they code in, it's the outputs that matter. Facebook is a billion dollar company, and their code base is PHP. There are still enterprise level companies that maintain Visual Basic programs. Yume nikki is made using RPG maker, and it doesn't make a bad game.
- smileysteve 12y ago> Facebook is a billion dollar company, and their code base is PHP. Great point, because allegedly, their original code base wasn't even in decent or organized php, it was just includes and inline sql queries.
- megablast 12y agoAlso, you could pay $20 for a server for a year, upload it, and boom! No fucking around with devops bullshit, like my current project.
- kpennell 12y agoI know Angular is getting a lot of HN hate lately, but it really helped me get my feet wet. It was much easier to get basic apps running for me in Angular compared to messing around with Rails or Django. For a basic backend, I can use firebase. Surely doing it this way has limitations, but it allows me to get in a positive feedback loop so much sooner.