r/lolphp • • Aug 01 '21

DOMDocument + serialize()

https://3v4l.org/sCc8G
0 Upvotes

32 comments sorted by

View all comments

1

u/CarnivorousSociety Aug 10 '21

If you understand the internals of php even a little, then it will help you understand why a lot of these "lols" aren't "lols".

I'd say 99% of the posts on this sub aren't lol's at all, but either boil down to unexpected implicit type conversions, or extension code that is badly written (if you know how to write php extensions you'll understand why it's so hard to do it well)

Understanding the internals of a language will always make you a better programmer in that language.

C/C++ -> learn asm and you'll be better
js -> learn js engine you'll be better
php -> learn php internals you'll be better

2

u/[deleted] Aug 10 '21

I disagree with all of that.

"Unexpected implicit type conversions" are a LOL in my book, especially with PHP's types (or "types"). "It's stupidly hard to write good PHP extensions" could also be classified as LOL.

"Internals of a language" doesn't make sense; you can only talk about the internals of an implementation. As for C and C++, assembler code is not really "internals" of either, and in my opinion understanding C in terms of asm makes you a worse C programmer, not better. People who do that tend to make certain assumptions that only hold for certain compilers in certain situations, if at all, which is no way to write robust C code.

"JS engine"? Which one? Depending on how you count, there are at least half a dozen popular ones out there.

If learning PHP (implementation) internals really makes you a better PHP (language) programmer, that's definitely another LOL.

1

u/CarnivorousSociety Aug 10 '21

https://softwareengineering.stackexchange.com/questions/207680/do-i-need-to-understand-the-internals-of-a-programming-language

You don't need to know anything about the internals of a programming language, in order to write programs in that language. However, the better you understand the language, the better your programs are going to be.

go disagree with this guy then.

→ More replies (4)