Live data from Hacker News

Rambling On [PHP] Internals

blog.ircmaxell.com

161–169 of 169 posts

Re: Rambling On [PHP] Internals

#161
post #154

Earlier quoted context omitted.

Depends on your perspective, I guess. The difference between not knowing how to program and learning, say, ruby is a fair bit larger than the difference between knowing how to program in php and learning ruby. Take php and ruby (two languages I happen to have used a fair bit both). If you're writing your typical web app, you'd probably use mysql for a database. That's the same. You talk http to the client - same. You…

I agree that different languages don't all have perfectly different purposes or philosophies, but I'm not sure why you'd think I'm claiming that. I think you could pick better examples. PHP and Ruby are both interpreted, Perl-inspired languages started by hobbyist first-time language designers who released 1.0 versions about months apart. So yes, if you apply them to similar problems and use similar techniques in the…

You have me a bit confused. You say that I could have picked better examples, but then pretty much agree with me wholesale. So it seems I picked exactly the right example, at least if my intention was to support my own point.

That point being that languages such as Perl, Php, Ruby and even Python is relatively minor. I'll claim that any programmer who is competent with one of these will easily be able to transition to one of the others. There may be reasons why people don't always do this, but I don't think they are intellectual.

Re: Rambling On [PHP] Internals

#162

Earlier quoted context omitted.

Sigils.

I figured that may have been the reasoning, but I long ago stopped thinking of the variable names in Perl as just the alphanumeric portion. To me, the native data types, which are denoted by the sigils, are intrinsic to the name.

Yes, that was the reasoning of what I said. It doesn't really change the way you think about the program, but in PHP it leads to stuff like variable variables (`$$myvarname`) and to assigning a string "foo" to `$x` and having `$x(...)` execute as `foo(...)` and so on... which is cool and useful sometimes, but this really messes up a beginner's mind or it leads to code that is almost impossible for beginners to read, comprehend and learn from.

Perl at least had the "if it's different, it should look different" philosophy as a justification for its sigils. PHP just makes functions and variables look different and it feels like CLs two namespace system with `foo(...)` / `(foo ...)` and `$foo` / `(funcall foo ...)` being different, but it was mostly useless in CL too and it has the same side effect of adding extra cognitive overhead to passing functions around, which imho should be as simple and natural for a beginner as possible to ensure that later on he has a safe landing in functional programming land...

Re: Rambling On [PHP] Internals

#163
post #23
post #3

Any large community has these problems. This is the advantage to using forum engines that allow non-anonymous upvotes/downvotes over a naive mail-list - people can silently agree and separate the wheat from the chaff, and consensus becomes far more visible. You can even give the important contributors greater "weight" to the ups/downs (this is not a democracy, contributors are worth more).

All the "forum" software that I have seen (opposed to more "ephemeral discussion" software like HN/Slashdot/Reddit) provides such a goddamn awful reading/browsing/discoverability experience that any benefits it may have over mailing lists are completely lost. Just for starters, mailing lists allow the discussion to thread (as do sites like HN, Slashdot, and Reddit) and don't force you to use a shoddy web interface th…

I like the Discourse approach. http://www.discourse.org/

Instead of nested replies, it encourages "Creating new threads linking back to a post", which I find to be way more orderly than "conversation trees". They're also aiming for feature-parity with mailing lists, allowing people to participate effectively with threads by e-mail alone.

Re: Rambling On [PHP] Internals

#164
post #161

Earlier quoted context omitted.

I agree that different languages don't all have perfectly different purposes or philosophies, but I'm not sure why you'd think I'm claiming that. I think you could pick better examples. PHP and Ruby are both interpreted, Perl-inspired languages started by hobbyist first-time language designers who released 1.0 versions about months apart. So yes, if you apply them to similar problems and use similar techniques in the…

You have me a bit confused. You say that I could have picked better examples, but then pretty much agree with me wholesale. So it seems I picked exactly the right example, at least if my intention was to support my own point. That point being that languages such as Perl, Php, Ruby and even Python is relatively minor. I'll claim that any programmer who is competent with one of these will easily be able to transition t…

Yes, I agree that your intention is apparently to support your own point. In trying to win the argument game, you're missing out on the deeper point, and an opportunity for professional development.

I've learned quite a bit from working in different languages. You may not have, but that doesn't indicate there's nothing to learn.

Re: Rambling On [PHP] Internals

#165
post #85

Earlier quoted context omitted.

That's why i'm impressed with Symfony and Doctrine. Taking one of the worst language out there , and creating these well crafter libraries , that's insane. I think type hinting and basic POO saved PHP.

Symfony..maybe..but Doctrine? Do we really need a sudo-sql language for creating object->db table relational mappings? I used Doctrine extensively at my last job..and I will not be using it for any personal projects. It's bloated and when I need to optimize a sql query, I have to essentially create a hack outside of the main ORM..which kinda defeats the purpose in the first place. I much prefer Zend or Codeigniter.

Use the Query builder, you dont need to use DQL.

Re: Rambling On [PHP] Internals

#166
post #26
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. You can. But I shudder to imagine one file containing everything you just said. Also, I'm skeptical about the security claim. I'm not talking about PHP-specific vulnerabilities here. Rather, the developer of such an app might be pretty naive, and might buil…

You can. But I shudder to imagine one file containing everything you just said.

Look on my works ye mighty and despair (i know I have): https://gist.github.com/kennethrapp/0ebbd15b509d8f18b095

Re: Rambling On [PHP] Internals

#168
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…

Whether or not you stick with PHP, you should learn some other languages. At the very least, it will make you a much better PHP programmer. But maybe you'll find something you like better. Ruby, Python, and Node are all reasonable next things to try. Large communities, lots of resources, and plenty of example code to look at.

You're not a "PHP programmer" unless that's the only thing you know, and if that's the case, you're cheating yourself.

Be a "programmer". Learn other languages. It makes you a better programmer in general.

Re: Rambling On [PHP] Internals

#169
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 :)

I've been clean for four years now

About 2 years for me. Keeping strong.
Post reply on HN