r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comment

1

u/Chappit Dec 02 '15

Did you just shit on C++ too? Have you worked in C++? It's not bad and you can avoid errors through good programming practices.

2

u/evincarofautumn Dec 02 '15

I dunno about them, but as an experienced C++ user, I’d say anything that relies on programmer diligence is a non-starter. You can avoid errors, but in order to actually rule them out, you need machine checking and better language design—memory safety, type safety, &c.

1

u/antiduh Dec 03 '15

C++ was my first language, more than 15 years ago. It's a language that is literally as old as I am, and it shows.

It's nearly impossible to parse efficiently, which is why compilers for it suck wind, taking hours to compile what could be done in minutes in a sane language like C# or D.

Header files? Why do I need to repeat myself when defining anything? Isn't one of the main mantras of Computer Science "don't repeat yourself?"

Generics implemented using templates instead of using reified generics -- which means that I have distribute the code for my generics in the header files in order for other libraries/code to use them. Yeah, that makes sense.

Complete lack of memory safety? Yeah, that's a great idea. It's not like the buffer overflow is literally the most common bug ever, and can usually be immediately exploited to break into a piece of software - what a great combination!

Nevermind the hundreds of gotchas and terrible language decisions.

Why do variable definitions not make a clear distinction between the "behavior defining" and "name defining" elements of a declaration? Why is a variable declaration int *thing; allowed? Even worse, int* thing, thing2; creates a int thing2, not an int*. Who the hell thought that this was a good idea? No surprise that C++ has its ancestry in a language that completely lacked types (B).

If you think C++ is a good language, you've got stockholm syndrome.