No smilies, no avatars, no flashing gifs. Just discuss the issues of the day, from last night's telly via football to science or philosophy.
Started by coshipi on Sep 10, 2021 4:18:05 PM
PHP, Javascript, Java, C# etc.

Elsewhere I've been accused (it was levelled as an accusation, but could be interpreted less aggressively!) of not knowing what I was talking about. I've removed a lot of little bits of varied Javascript from multiple html files on my website, and replaced them with a single PHP file referenced from those html files. Obviously I know I've done this...it may have been a daft thing to do, but I did it and it all works.

JtS said "No serious developer will touch it [PHP] with a barge pole of any length." This may well be true, and I'm the first to admit that I'm not a serious developer. But I'd like to be a better amateur website producer than I am, and I'm perfectly willing to learn - as long as it's not too big a learning curve!

Previous
|
Next
|
Top
|
Bottom
coshipi - 10 Sep 2021 16:18:19 (#1 of 56)

I'm not an expert in PHP - I've done a little bit because it seemed to be the easy way to achieve my purpose at the time, and what I did is working. My Javascript was hacked together in a similar fashion, without really knowing Javascript, and it worked - but was much harder to get working, and far more work, than doing the same thing in PHP.

I'm like that with PERL, too. I'm a bit better than that with CSS, and I think I can fairly say I'm pretty good at html and svg. Other than that, all my computer languages are mostly ancient history (COBOL, Fortran, PDP8 and other assemblers) or rather niche (ARM assembly language, up to v7 only). I write a fair amount of BBC BASIC and run it under RISCOS on a Raspberry Pi...nice little apps that I'd love to be able to write for Macs or even for PCs, but can't.

kvelertak - 10 Sep 2021 16:21:07 (#2 of 56)

Python. Even I can code some, so it must be easy, proof positive.

coshipi - 10 Sep 2021 16:24:25 (#3 of 56)

Python

Yes, and very like BBC BASIC really. In BBC BASIC I know how to write windows, icons, mice and pointers programs for the Raspberry Pi - I'm not sure Python would really allow me to do the same for a Mac (or a Windows machine) - not without a steep learning curve way beyond the basics of the language.

Nor do I think it would lend itself to writing server-side programs for my website, would it?

kvelertak - 10 Sep 2021 16:25:23 (#4 of 56)

Admittedly I only use it for entry-level data analysis, but there is a web dimension, fill yer boots -

https://realpython.com/tutorials/web-dev/

Dementor - 10 Sep 2021 17:25:24 (#5 of 56)

No serious developer …

Being a serious developer is a bit overrated, I think - chasing the latest technologies, containerising everything, etc.

Write in whatever language you enjoy writing the most, I’d say.

Lento_ - 10 Sep 2021 17:25:43 (#6 of 56)

Personally I'm not a huge fan of PHP, but it definitely does have a role to play. It's widely available as an option when looking for a host for a website, and it can be relatively simple to put together a bit of functional server side code using it compared to other languages. If you want to build something with little fuss then it's a reasonable option. Python is similar in that way.

In the company where I work now, the server side code is split in to a PHP layer at the top and a Java layer below that. The PHP layer will probably go one day, but for the time being it seems to be doing the job OK. I'm happy to avoid it and stick to the Java layer though!

coshipi - 10 Sep 2021 16:33:43 (#7 of 56)

Thank you, Lento - that's reassuring!

I've just realized I told a fib earlier: there are in fact three PHP files on my website. I'd forgotten I'd got one to set a cookie (if people choose the option to do that - it's an opt-in on my site, not an opt-out) and one to clear it (just my one) if required.

coshipi - 10 Sep 2021 16:35:02 (#8 of 56)

And thank you too, Dementor.

slicey - 10 Sep 2021 18:41:51 (#9 of 56)

You didn't say PHP was an outdated technology that was fine 15 years ago and still has some niche uses today in amateur and hobbyist circles, you said PHP was better than Javascript.

I disagreed, even though I am a JS sceptic, and explained why.

You disagreed whilst (tacitly) admitting you were not qualified to do so.

coshipi - 10 Sep 2021 18:46:43 (#10 of 56)

you said PHP was better than Javascript

Did I? What I should have said (if indeed it wasn't what I said) is that I'd removed Javascript from client-side duties and replaced it with PHP doing the same things server-side. The result is definitely better, but not necessarily because the language is better in any general sense.

If I expressed myself inaccurately I apologise.

coshipi - 10 Sep 2021 19:00:00 (#11 of 56)

Found what I actually wrote:

At one time I did a bit of J*v*sc*pt for my website, then worked out how I could achieve the same (actually a better) result using PHP, so dumped J*v*sc*pt unceremoniously!

I didn't say the language was better at all: I said that the result I'd achieved with it was better than what I'd achieved with J*v*sc*pt...Which I stand by.

Tomnoddy - 10 Sep 2021 19:04:12 (#12 of 56)

It's all about nuance, innit?

<waves hands horizontally and wiggles fingers>

peacalmer - 10 Sep 2021 19:19:27 (#13 of 56)

People get weirdly defensive about programming languages and stuff.

If it works it works. When it doesn't... These days most errors seem to boil down to three things: poor documentation, oversight in the requirements specifications, and incomplete testing.

Recent one from the BOFH blog at work... An outsource team who wrote their code to be as obfuscated and undocumented as is feasible to do so... security by obscurity.

Something wacky was borking the login process.

They wot wrote it had a job to work out where the glitch lived, but eventually it got past their positive testing. You put in a correct username and password, it worked. Wrong username, it didn't let you in. Wrong password, it didn't let you in.

They missed a minor problem.

If, at login, you put your username and didn't bother putting anything into the password box at all, it let you in anyway.

None of their design or test plans covered "if password field is empty then grey out the submit button" or "treat an empty password as a wrong password".

Oops.

slicey - 10 Sep 2021 19:22:52 (#14 of 56)

I contend that PHP is completely outdated and irrelevant. coshipi's experience with his website has not changed my view of this.

Dementor - 10 Sep 2021 20:27:57 (#15 of 56)

https://www.cuelogic.com/blog/how-facebook-is-not-using-php-by-still-using-php (2015)

bossab2 - 10 Sep 2021 20:38:22 (#16 of 56)

None of their design or test plans covered "if password field is empty then grey out the submit button" or "treat an empty password as a wrong password".

I once tested a system (in English) where if you made dumbfuck user data entry issues it would give error messages in Spanish. The developers (Spanish) hadn't thought to test real dumbfuck inputs - which surfaced some of the original Spanish system messages.

Ebadlun - 12 Sep 2021 23:49:36 (#17 of 56)

I'm totally in client-side land, specifically mobile, but given that you can run pretty much anything you like on a server to spit out html why is a supposedly horrible language like PHP so popular?

Lento_ - 13 Sep 2021 10:02:39 (#18 of 56)

I suspect it's a combination of:

  • Loads of websites which offer cheap hosting will support PHP.
  • It's quite often studied at university, so a lot of people may be familiar with it.
  • It's fairly simple to do the basics.


It's not all good. IMO languages which aren't properly typesafe too often result in buggy code and and lack in good tooling, so would far prefer a "proper" back end language like Java. However if I was someone who wasn't that used to coding and just wanted to throw something together then I can imagine PHP seeming a reasonable option.

Also it isn't the abomination which is server side Javascript.

tasselhoff - 13 Sep 2021 10:06:03 (#19 of 56)

Loads of websites which offer cheap hosting will support PHP.

Also loads of domain name registrars will allow PHP but not much else for the price of the domain name.

tasselhoff - 13 Sep 2021 10:06:31 (#20 of 56)

Also it isn't the abomination which is server side Javascript.

Amen.

Previous
|
Next
|
Top
|
Bottom
Check Subscriptions
|
Home » IT & Computers