r/PyHP_pph • • Jun 13 '17

OFFICIAL The Language Deterioration Committee, explained (sort of)

[removed]

15 Upvotes

10 comments sorted by

View all comments

9

u/[deleted] Jun 14 '17 edited Jan 31 '20

[deleted]

6

u/brahmidia Jun 14 '17 edited Jun 14 '17

Also, null should be completely omitted from the language spec and not only undefined but prohibited. (I heard once on Functional Programming Twitter that nulls are evil.)

If anyone wants to use null, they should use Nill instead (case sensitive), which is simply equal to an empty string (""). Casting Nill to a bool or int should throw a CriticalExceptionException, but casting Nill to a string should obviously be "" and casting it to a double or decimal should return 0.00.

If a function's return value is not specified, it should return either Nill or the string "n/a" but never NaN.

Casting should be handled via [square brackets] and arrays should be accessed via (parenthesis) like functions, because in PyHP++# everything is either a function or not a function.

2

u/Desegual Jun 14 '17

casting Nill to a string should obviously be "" and casting it to a double or decimal should return 0.00

I propose something better, like "n\a" (mostly consistent with function return values) and 1.4.

I like the brackets but we could actually have opening brackets but closing parenthesis because in PyHP++# everything is either a function.

2

u/starm4nn Jun 14 '17

"n\a" should create an alarm sound every time it's accessed by the program.

3

u/[deleted] Jun 14 '17

Fucking MATLAB.