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

> How that even makes sense?

Maybe my point wasn't clear. It's not a difference in how those two ORMs accomplish their goal; it's that PHP doesn't let you do what SQLAlchemy does, even if you wanted to. Want to write an ORM that uses YAML, XML, or comment annotation in Python? Great! Want to write an ORM that uses classes or objects as column declaration in PHP? Too bad.

> Rehashing old tired "strpos doesn't have underscore and str_rot13 has, oh noes!!! I can't use language with missing underscore!!!" is really stale by now and doesn't contribute anything new.

Now I think you're just being petty. Obviously an underscore isn't what we're talking about here. Take your straw man elsewhere, please.



> Want to write an ORM that uses classes or objects as column declaration in PHP? Too bad.

I'm actually doing just that; it's not as clean as you can do in Python but it's not outrageously verbose either. Trying to map one languages features onto another is not a valid critique.


So PHP does not have the same power as Python, just like Java. Yet I don't see people saying Java encourage writing bad code.

Different language has different limitation. Just because you can not have SQLAlchemy in C, does not mean C encourage bad code.


> Want to write an ORM that uses classes or objects as column declaration in PHP?

What prevents you from doing that in PHP?


PHP doesn't allow you to pass functions and classes as arguments.


You can. Here's my code as an example:

https://github.com/gigablah/fsphinxphp/blob/master/src/FSphi...

Note the $getter parameter.


Unless I'm misunderstanding you, passing functions as arguments is definitely possible with anonymous functions/closures.


I have no idea what you mean by "what SQLAlchemy does" - I'm sure it does lots of things and most of these are perfectly doable in any language out there. You must be meaning some specific thing that is a favorite of yours - and indeed maybe it is hard to do it in PHP (or maybe not - since you didn't tell what this thing is nobody can have any idea). Who cares? I can name a bunch of things that is harder to do in Python that in some other language, but I don't run around shouting "Python sucks".

> Now I think you're just being petty. Obviously an underscore isn't what we're talking about here. Take your straw man elsewhere, please.

What he's talking about here is known and talked about for 10 years. It's just function names, it's not that big a problem. Yes, we know old function names are inconsistent. No, we can't change them because that will break code. If that's what makes or breaks language for you, PHP is not for you, and most languages are not for you, because you're obviously not interesting in solving the problem, you're interesting in boosting your self-esteem by boasting shiniest tool out there. Nothing wrong with it, but PHP is not created for that. If that means for you that PHP sucks, fine, but for 99.99% out there shininess is very low on the list of priorities. So if you want to discuss important stuff, leave old stale stuff like ranting about strpos alone and discuss important stuff.


> I have no idea what you mean by "what SQLAlchemy does"

You must have missed the rest of that paragraph. I specified what it does.

> What he's talking about here is known and talked about for 10 years. It's just function names, it's not that big a problem.

Again, missing the point. Python has these same minor inconsistencies in its stdlib. It's the combination of all these minor inconsistencies with a language that gives you more tools to write bad code than good that makes PHP torturous. It's everything that the author wrote about in one neat little package.




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

Search: