Spaniard, manager by day, dev by night. node.js express alexa jquery html5 css but can also do java php, and if you really insist I'll dust off my C LISP Prolog ML Miranda and even assembly.
In Pascal, a:=33 would assign the value 33 to variable a. The is-equal operator was just =. It was less error prone than what finally stuck, thanks to C and Java ---> = to assign values, == to compare them.
I agree. There's nothing bad about the syntax. True, the language could be better. There are 99 reasons to dislike PHP but syntax is definitely not one of them.
Jeroen is a Software Craftsmanship advocate with over 15 years of experience. He is CEO of https://pro.wiki. Previously Jeroen created Wikidata.org and was Software Architect at Wikimedia Deutschland.
Haha, I can understand that. I actually liked the namespacing so much, I wrote a babel plugin that rewrites import paths in JS to work similarly. Not EXACTLY the same, but it's very similar.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I was a sysadmin, mobile dev. expert, Nintendo DS game programmer, Pascal compiler dev., Java consultant, assembler guru, automated QA engineer, embedded C/C++ maintainer. Some say I'm a hacker.
I strongly disagree, with the Pascal remark, but I'm a Pascal lover, so I'm probably biased the other way. I'd say := vs. = is much better and a lot less error prone and ugly than = vs. == let alone === in some languages.
Also := was not even a Pascal invention, but much older. It comes from ALGOL actually, IIRC.
I was a sysadmin, mobile dev. expert, Nintendo DS game programmer, Pascal compiler dev., Java consultant, assembler guru, automated QA engineer, embedded C/C++ maintainer. Some say I'm a hacker.
I believe there's worse than PHP, but that alone doesn't make any PHP better for sure. :)
BTW, I always think about replacing : with be and = with equal in my mind when reading Pascal code. So a:=1; is let a be equal 1. Same works with colon elsewhere, for example type definitions like var x: integer; can be read as let var x be integer; ... It makes the whole syntax quite readable for me.
But I'm not a native English speaker, so sorry if this just makes it even worse. :P
Yes, and there's definitely a "thing" with code quality being correlated to natural readability too.
I come from an ORACLE background originally, and it would drive me insane to see people uppercasing their SQL, like it was an act of kindness to the compiler, and us humans have to suck up the inconvenience. I used to send people photos of major highway direction signs and ask "WHY DO YOU THINK WE DO NOT PUT INFORMATION THAT HAS TO BE QUICKLY ABSORBED IN UPPER CASE? Which do you find easier to read?".
I was also once instructed that all text in a BI system's reports should be in fixed pitch uppercase – got out of it by showing how wide that made every text-heavy report.
TL;DR; People are sometimes quite dumb.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
PHP
Oldschool-wise, I can never forgive Pascal it's
:=
operator.Can you tell me more about the
:=
operator?In Pascal, a:=33 would assign the value 33 to variable a. The is-equal operator was just =. It was less error prone than what finally stuck, thanks to C and Java ---> = to assign values, == to compare them.
PHP: it’s not a bad syntax, it’s just not what some people like, and they’ve formed opinionated debates over it.
I agree. There's nothing bad about the syntax. True, the language could be better. There are 99 reasons to dislike PHP but syntax is definitely not one of them.
PHP has been my main language for 10 years.
-> instead of . is rather unfortunate. Much harder to type :/
$var instead of var is also not idea if you ask me, though at least not as silly as needing to hit 3 keys.
That does not make the syntax as a whole ugly though.
Lol. It helps. :D
True enough. The syntax isn't bad as in defective or overly verbose. It does look inelegant to me, though.
Especially if you look at more modern PHP. I really like Laravel's code style.
For non-PHP developers, a few syntax niceties:
$
prefix. So$post = getPost($id)
.$request->has('name')
::
(by far my favorite).Route::get('/api/posts', function() {});
I also like PHP namespacing:
and accessing the namespace:
As someone who's used PHP in the past, all of your niceties are among the many reasons I don't care for the language 😆 to each their own though! 🤷🏻♂️
Haha, I can understand that. I actually liked the namespacing so much, I wrote a babel plugin that rewrites import paths in JS to work similarly. Not EXACTLY the same, but it's very similar.
I really dislike PHP namespacing.
You might have to blame ADA for that.
PL/SQL also uses it – it is very closely related to ADA.
I strongly disagree, with the Pascal remark, but I'm a Pascal lover, so I'm probably biased the other way. I'd say
:=
vs.=
is much better and a lot less error prone and ugly than=
vs.==
let alone===
in some languages.Also
:=
was not even a Pascal invention, but much older. It comes from ALGOL actually, IIRC.All very fair points. I never minded Pascal as a language. Just that assignment operator.
I had forgotten it came from ALGOL.
But you agree PHP is hideous?
:D
I believe there's worse than PHP, but that alone doesn't make any PHP better for sure. :)
BTW, I always think about replacing
:
withbe
and=
withequal
in my mind when reading Pascal code. Soa:=1;
islet a be equal 1
. Same works with colon elsewhere, for example type definitions likevar x: integer;
can be read aslet var x be integer;
... It makes the whole syntax quite readable for me.But I'm not a native English speaker, so sorry if this just makes it even worse. :P
No, it's a nice thought. It does work, as far as I can remember. Maybe it's what Pascal's creators were thinking.
=== and !== look rad in Fira Code
And there was me thinking it was from ADA ... it's like archaeology, this, just stripping layers away.
Historical linguistics is a real discipline in natural languages. I love the analogies between natural languages and computer languages.
Yes, and there's definitely a "thing" with code quality being correlated to natural readability too.
I come from an ORACLE background originally, and it would drive me insane to see people uppercasing their SQL, like it was an act of kindness to the compiler, and us humans have to suck up the inconvenience. I used to send people photos of major highway direction signs and ask "WHY DO YOU THINK WE DO NOT PUT INFORMATION THAT HAS TO BE QUICKLY ABSORBED IN UPPER CASE? Which do you find easier to read?".
I was also once instructed that all text in a BI system's reports should be in fixed pitch uppercase – got out of it by showing how wide that made every text-heavy report.
TL;DR; People are sometimes quite dumb.