inDesperateZone
Joined 14 years ago
Joined 14 years ago
The use of frameworks seems to be condoned. On my search for a template engine I passed by many articles of PHP developers saying they were unnecessary as PHP would provide all you could need.
Flask doesn't do much. But that's exactly the point. Even though it's so simple it offers enough to write an application that shouldn't have to hide because it's amateurish.
> From the rest of the post, it seems like the problem isn't that PHP is bad, but that you don't know (even remotely) how to write good PHP.
That may be true. But it could also be true that writing good PHP requires far more skill and time. Skill I might not have. But I'm not someone blindly following tutorials or someone who tries to whip out a lousy program as fast as possible. Nor do I think PHP is a bad language is such. But I had a hard time.
To come close you would probably end up using a framework written in PHP. At that point the language doesn't matter all that much.
I'm helping a friend writing a simple wiki-like application and due to him having to explain every part of the program we decided to write as much ourselves as possible and only use external libraries when absolutely necessary. Me trying him to explain what Django does and why it would help him didn't end well.
I'm not the absolute master of Python web frameworks, but I know enough to come by. But I tell you, writing clean, understandable, side-effect free and secure code in PHP is much harder in comparison than I expected.
There are thousands of tutorials on the web. But a lot of them show things done wrong, deprecated or blatantly insecure. The language is quite a mess and you can do the same thing 10 different ways, 8 of which are deprecated and maybe 1 that works with unicode. Not that you would know it's deprecated, the original mysql API is still not officially called deprecated, but it sucks big time.
I reckon knowing how to use Flask and Django makes it harder for me to write code the hard way. I'm replicating a lot of functionalty in PHP. But at the same time I know that I'm not good enough to do so. And doing so costs time anyway. I would have probably finished his application in a quarter of the time using Django, heck, even Flask. And it might even hold up to industry standards. My PHP code not so much. Somebody would probably end up dead.
The easiest step would be to store your static data on a commercial CDN. There isn't much logic running. If you would set up one yourself you would use a webserver that is extremely fast at serving static content. The only "thinking" part of the chain would probably be a load balancer.
You're server is now somewhat outside of the boundaries your application server "creates" and deleting old data requires new functionality (although storing too). Functionality that might not readily exist in the framework you use.
If the whole thing is growing too fast for you to keep up you might say to yourself "This and that is now far more important, have the data lying around for a while, it's too much work for now".
Nearly drove me nuts because a friend who I was working on a project with kept searching in german. As a result he got the terribly translated pages first followed by the actual SO pages.
But I wonder how many long haired man were in the sample. They are quite rare and a few ponytail grad students might lower the score.
If I had the money to fly to NY, gee, that sounds both awesome and frightening. I envy people who can just take the already filled suitcase out of their closet and end up in a distant place without fear or confusion about what to do next.
But that doesn't seem to be the case here. With Python I would have used a parser like lxml or BeautifulSoup (and I'm sure there is something comparable for JS) coupled with Requests async methods. That would probably not only end up with shorter and more concise code, but also be a lot faster.