Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought about not responding to avert judgement, but how is this not ok for 99% of all websites? Where an "undefined variable" is very much a "small thing"?

I mean, we have ways to catch those errors, its just that when they do appear in prod its usually because the project is so low impact (99%) that the budget for testing and whatnot is nonexistant (and the reasons for that vary from project to project, of course).

My experience suggests that, were this error to appear in a more complex component (say a shopping cart or notification system) these "non-entirely static-content-based" parts usually are either separate projects or have their own adequately-sized test code.

"But this is not a website, its a complex web app" - then PHP was probably not the most sound technical choice from the start.

"But this teaches bad practices" - practices are always evolving, new languages appear from time to time. I'd rather work on fixing real world problems.

"But PHP is old!" - so is Java... besides, another name for "old technology" is "stable tecnology".

In short, it is best if there are no errors in your code (haha yeah right..). If there are any, and its a website written in PHP acessing an undefined variable, it is probably a small thing. And if its critical that it does not happen, its usually an engineering blunder. Not the language's fault.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: