Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I don't know much about php but private variables that are public smells like rotten fish to me.
-
@NeatNerdPrime you are right and my head is full of rotten fish.
In 2004 in php all properties and method where public: the were no alternatives than a comment.
Now how in the hell would change this. -
@horus definitely. My comment regarding insanity was meant regarding the insanity of PDF...
E.g. calculating offsets by multiplying font sizes with strange values to position sth perfectly. XD
TCPDF was nice. PDF itself ... Nope. -
@NeatNerdPrime These are probably library-private properties. PHP doesn't support visibility by module or library. So you have to declare them public and just don't use them outside the library.
Obviously, making em protected or private and only allowing access by getters and setters would have been the cleaner solution. But all these properties where probably once declared using the var keyword. Maybe, someone just preemtively replaced all uses of "var" with "public" when 5.0 (temporarily) deprecated "var".
Might very well be the case that there where refactorings planned for the library. But as it always happens with private FOSS projects: Life gets in the way and maintenance suffers...
Today, DomPdf is the FOSS lib to use for PDF generation in PHP.
Related Rants
My company con not find any other developer than me.
I could not understand.
We use only up to date libraries in our projects.
Please note the comment private properties...
rant
legacy code
php