Live data from Hacker News

Rambling On [PHP] Internals

blog.ircmaxell.com

111–120 of 169 posts

Re: Rambling On [PHP] Internals

#111
post #14

PHP is addictive. You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning. And it will work on all servers and on all operating systems. Millions are made by average developers developing themes and plugins for wordpress. Hard to beat all that. #drama is for queens :)

> You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

> Millions are made by average developers developing themes and plugins for wordpress.

Yep, and thanks to people actually believing in that, php is also keeping the security industry alive and well.

Re: Rambling On [PHP] Internals

#112
post #4

I think the only hope PHP has of continuing development is if someone big like Facebook can add some direction to it. Maybe they will but I think last I checked even they were giving up on using it for much more then a thin veneer to their back end services.

Even if a large company like Facebook did want to help add direction, they'd have to do so within the confines of internals and the RFC process. The prehistoric luddites and trolls on the list would shout down any truly language-improving proposals in the same way they always do, regardless of source. The only way to get rid of those unwanted elements would be a fork, but that would be unproductive. The remaining thi…

Indeed, Facebook is already using their own fork of PHP.

Re: Rambling On [PHP] Internals

#113
post #106
post #94

I recently started learning PHP as my first programming language and I love it so far. But the amount of negativity and hatred I see towards PHP on the internet (even among so-called PHP lovers) makes me question my decision of learning PHP. My main purpose for learning PHP is for web-development. I have looked into java code and I felt like I am going to shit pants if I have to learn that. 2 questions. - Am I wastin…

No, you are not wasting your time. You will read people complain about PHP but in the end, it provides me with a great job that pays the bills and then some! When used properly, it doesn't have to be a bad language and can be fun. That, and if you are just starting to get into web development, it is a great place to start. You can always branch out into other web technologies down the road. Have fun and keep learning…

> When used properly, it doesn't have to be a bad language

> That, and if you are just starting to get into web development

These two things don't square well, and is a major reason why I discourage PHP. It's pedagogically suboptimal to be encouraging the sorts of behavior that culturally accepted PHP often does.

You can write good PHP. After many years I got to the point where I could say confidently that I can. But it took me most of a decade to get to that point of confidence.

Re: Rambling On [PHP] Internals

#114
post #100
post #94

I recently started learning PHP as my first programming language and I love it so far. But the amount of negativity and hatred I see towards PHP on the internet (even among so-called PHP lovers) makes me question my decision of learning PHP. My main purpose for learning PHP is for web-development. I have looked into java code and I felt like I am going to shit pants if I have to learn that. 2 questions. - Am I wastin…

- nodejs: Write in coffeescript or javascript on the server, two bird with one stone philosophy. Will let you build better programming techniques in respect to structure due to (1) it's async and (2) it's module based. Unlike php the global namespace should not be used. Additionally, JS is just better than PHP in every way I can think of. Node has a thriving user module community. Cons are that you have to deal with…

> Unlike php the global namespace should not be used

What do you mean? What's the "global namespace" in PHP and why do you need to use it?

Re: Rambling On [PHP] Internals

#115
post #106

Earlier quoted context omitted.

No, you are not wasting your time. You will read people complain about PHP but in the end, it provides me with a great job that pays the bills and then some! When used properly, it doesn't have to be a bad language and can be fun. That, and if you are just starting to get into web development, it is a great place to start. You can always branch out into other web technologies down the road. Have fun and keep learning…

> When used properly, it doesn't have to be a bad language > That, and if you are just starting to get into web development These two things don't square well, and is a major reason why I discourage PHP. It's pedagogically suboptimal to be encouraging the sorts of behavior that culturally accepted PHP often does. You can write good PHP. After many years I got to the point where I could say confidently that I can. But…

What bad things are culturally accepted in PHP?

Re: Rambling On [PHP] Internals

#116

Earlier quoted context omitted.

Those "databases and other systems" make up a significant portion of their code base, and in many cases Facebook either contributes to their development or created them internally. To claim that Facebook is written entirely in PHP is false. Examples: - Cassandra (Java) was created by Facebook http://en.wikipedia.org/wiki/Apache_Cassandra - Giraph (Java) has significant contributions from Facebook and I believe was fo…

Alright, let me correct myself then. The "frontend" of Facebook is written entirely in PHP. The backend is written in everything from Erlang to C++.

Don't correct yourself. The majority of the backend is written in PHP as well.

Re: Rambling On [PHP] Internals

#117
post #115

Earlier quoted context omitted.

> When used properly, it doesn't have to be a bad language > That, and if you are just starting to get into web development These two things don't square well, and is a major reason why I discourage PHP. It's pedagogically suboptimal to be encouraging the sorts of behavior that culturally accepted PHP often does. You can write good PHP. After many years I got to the point where I could say confidently that I can. But…

What bad things are culturally accepted in PHP?

Most common thing that seems to come out is using string concat for sql queries.

Re: Rambling On [PHP] Internals

#118
post #94

I recently started learning PHP as my first programming language and I love it so far. But the amount of negativity and hatred I see towards PHP on the internet (even among so-called PHP lovers) makes me question my decision of learning PHP. My main purpose for learning PHP is for web-development. I have looked into java code and I felt like I am going to shit pants if I have to learn that. 2 questions. - Am I wastin…

You are not wasting your time with learning PHP, but it also is not a good foundation - the language is a collection of tools that someone somewhere found useful.

Employment wise it is a safe bet - there is a lot of legacy code for a person to maintain for a few lifetimes and then more.

The hatred towards PHP is explainable - if you use Haskell or Clojure today it is because you chose it. If you use php it is because you were forced to use it. So every little and not so little gotcha in the language (and there are a lot of them) is causing a lot of pain.

I have used python/(tornado/gevent)/flask/ stack with success.

Disclaimer - PHP programming 4 years, python 1

Re: Rambling On [PHP] Internals

#119
post #114
post #100

Earlier quoted context omitted.

- nodejs: Write in coffeescript or javascript on the server, two bird with one stone philosophy. Will let you build better programming techniques in respect to structure due to (1) it's async and (2) it's module based. Unlike php the global namespace should not be used. Additionally, JS is just better than PHP in every way I can think of. Node has a thriving user module community. Cons are that you have to deal with…

> Unlike php the global namespace should not be used What do you mean? What's the "global namespace" in PHP and why do you need to use it?

php has the ability to have global keyword in a namespace to use something out of scope.

And it is easy to use it ... and you don't want to maintain code written like that.

Re: Rambling On [PHP] Internals

#120
post #94

I recently started learning PHP as my first programming language and I love it so far. But the amount of negativity and hatred I see towards PHP on the internet (even among so-called PHP lovers) makes me question my decision of learning PHP. My main purpose for learning PHP is for web-development. I have looked into java code and I felt like I am going to shit pants if I have to learn that. 2 questions. - Am I wastin…

Learning is never a waste of time, but would that time being better employed with another technology? I think, definitely, yes.

Important point, whether you like php or not, you need to know why. If you like it because you are comfortable with it, make sure to know why. Being comfortable in a dev environment is great when you are learning, but very dangerous in the long run, since learning something new will be much (much) more painful.

Also, what is your final goal ?

If you just want to learn to build websites, regardless of top notch ways of doing things, just stick with what you are productive and comfortable with. The more reputable tech you use, the better, but it's not the point.

If you want to learn websites because it looks like a good way to learn programming in general, don't stay in the comfortable zone, don't fear the steep learning curve, embrace it. Well, it's not masochism either, if it's too painful, just stop. You have been intimidated by Java, but don't let it divert you from all other techs. Django/Python, Ruby on Rails, NodeJS and some others are much more easier to step into, will teach you much more about programming in general.

Post reply on HN