PHP5/MySQL Book Question

From: Peter (BOUGHTONP) 9 Oct 2014 18:22
To: af (CAER) 9 of 19
> Why do you want to learn PHP anyway? ... a better investment
Do you have signatures ignored?

> ...its deceptively low barrier to entry.
That's not an advantage.

> or even JavaScript, despite what people say about it
People don't say about it (not once you exclude those that don't know what they're talking about).

From: af (CAER) 9 Oct 2014 19:12
To: Peter (BOUGHTONP) 10 of 19
Oh, yeah, was on my phone, and hadn't paid attention to her signature before.

Anyway, what I was getting at was that although it has a low barrier to entry in that you can just open a text editor and write some trivial code and it all just magically works, the lack of any kind of structure makes it quickly get messy once you move beyond trivial stuff. That's what I meant by 'deceptively' – it lures you in with initial ease of use, then slaps you in the face with its madness.

I'm not really sure if it's an advantage or not, tbh. On the one hand, it's an early short feedback loop, and is conceptually simple enough that beginners can get good results and be encouraged to continue to more advanced things. On the other hand, without proper guidance, those beginners could quite easily end up in a nightmare tangle of logic and presentation.

JavaScript: quite.
EDITED: 9 Oct 2014 19:15 by CAER
From: Drew (X3N0PH0N)10 Oct 2014 10:28
To: af (CAER) 11 of 19
Quote: 
hadn't paid attention to her signature before.
She should make it bigger.
From: Matt10 Oct 2014 12:09
To: af (CAER) 12 of 19
the lack of any kind of structure makes it quickly get messy once you move beyond trivial stuff. That's what I meant by 'deceptively' – it lures you in with initial ease of use, then slaps you in the face with its madness.

Assuming you mean project structure, exactly the same can be said of any program language, including Ruby, Python and JavaScript (and especially JavaScript). If you're a terrible programmer, you're going to program terribly in any language you choose.

Also, with an enforced structure comes inflexibility to do exactly what you want, surely?

From: af (CAER)10 Oct 2014 14:10
To: Matt 13 of 19
The same can't be said for Ruby and Python so much because there are very clearly recommended choices for frameworks, that encourage good project structure.

JavaScript, well, that depends. There's plenty of good frameworks around for client-side JS, but like PHP, there's no apparent (to a beginner) need to use them, and it's simple to get results without them, especially if you use jQuery. This is, clearly, why there's so much terrible JS code around. If you're learning JS to use on the server, Express is probably the default framework recommendation, and at least nudges you towards keeping things organised.
Quote: 
with an enforced structure comes inflexibility to do exactly what you want, surely?
You say that like it's a bad thing. Beginners don't know enough to avoid the pitfalls, so some structure is helpful to keep them on the rails.
EDITED: 10 Oct 2014 14:15 by CAER
From: CHYRON (DSMITHHFX)10 Oct 2014 15:26
To: af (CAER) 14 of 19
There's a steep learning curve that can be daunting and downright discouraging, so easy wins can be important. Also there's many tutorials and online stuff that present contradictory methods, and new versions, security patches &ct. keep coming out to obsolete 'accepted' methods. It's all a bit more complicated than you make it out to be.
From: Matt10 Oct 2014 21:39
To: af (CAER) 15 of 19
But they're frameworks, they're not inherent of Python and Ruby. You have to seek those out to use them. Scratch that, you have to know you're looking for a framework in the first place before you even go looking for one. I'm pretty certain anyone starting out in Python or Ruby could write the same sort of really bad code as is possible in PHP just by following a few web tutorials and then expanding upon them.

If you want PHP frameworks to read about, have a look at Symfony 2 and Doctrine (an ORM for PHP), Laravel and Phalcon too and to a lesser extent (because it insists on still supporting PHP4) Codeigniter. PHP isn't the raw, brash scripting language it used to be, it has made huge leaps in encouraging interoperability in the last 3~4 years* especially through the PHP FIG and the PSR standards which are designed to make sure your code is interoperable with that of others.

* Trying to type the tilde, I've just found out my Girlfriend has changed my Keyboard layout to US English.
EDITED: 10 Oct 2014 21:44 by MATT
From: af (CAER)11 Oct 2014 18:47
To: CHYRON (DSMITHHFX) 16 of 19
Well sure, nothing is ever as simple as it's usually made out to be, and I know how confusing a full framework can be at first (lots of new concepts you kind of need to understand before you can do anything), so it's nice to have what's basically a glorified templating language "just work" with no setup.

I understand, too, that most people don't even need a proper framework, that they just want to add a bit of dynamism to a few pages and aren't actually making a web app.
From: DeannaG (CYBATRON)12 Oct 2014 23:41
To: af (CAER) 17 of 19
Why do I want to learn PHP and MySQL?

First, I'd like to be able to help with Beehive and it's development more in the future.

Another reason is most of the stuff we use is done in PHP and MySQL. So, I'd also like to know what I'm looking at when I'm poking around in them as well.

I'm not the sharpest tack in the pack, but I'm not too thick to learn either, and I do want to learn.  :-) I've already got HTML and CSS pretty pat. PHP and MySQL are next, then maybe I'll start on something else. We'll just have to see what happens.  :-)
From: af (CAER)13 Oct 2014 08:18
To: DeannaG (CYBATRON) 18 of 19
Aye, I realise now why you'd want to learn, sorry :) Honestly, despite my general negativity towards PHP, it's still encouraging to see people willing to learn software development.
From: DeannaG (CYBATRON)13 Oct 2014 20:28
To: af (CAER) 19 of 19
No worries and thanks!  :-)