Hacker Newsnew | comments | show | ask | jobs | submit | cosmok's commentslogin

I created a bookmarklet many years ago that does this and a little bit more: https://github.com/cosmok/HackerNews_Sorter

-----


I was able to reproduce this on a Galaxy Nexus.

-----


Great points! But, it can get pretty lonely to have your lunch alone - sometimes even depressing. I tend to have lunch with 1 or 2 of the closest of workmates whenever I can.

-----


It is almost impractical for me to be like Stallman and shun a lot of Hardware/Software. But, I do not wish for Stallman to be any less radical than he is as: by being radical he gains my attention and some of his thoughts and ideas stick with me and, it has made me think about 'freedom' while buying any piece of Hardware/Software.

I would never want to work him on anything - I watched him tear apart people while responding to their concerns - but, people like him are essential to the Free Software movement.

-----


Very easy in PHP. http://php.net/manual/en/pdo.prepared-statements.php

-----


Except when the database drivers PDO relies on aren't set up by default:

http://news.ycombinator.com/item?id=2376873

-----


I have forced myself to stop checking mail, facebook, time, etc. on my mobile after I have decided to rest. I have slept better since then.

-----


Not according to the guidelines:

    "Off-Topic: Most stories about politics, or crime, or        sports, unless they're evidence of some interesting new phenomenon. Videos of pratfalls or disasters, or cute animal pictures. If they'd cover it on TV news, it's probably off-topic."
But, I don't mind it all as I get to read views and firsthand accounts from fellow hackers that is much different from what I see on TV.

-----


I was particularly interested in "is patio11 ok?" (and, are there any transpac fiber cuts?)

I think it's fair to post stories which are headlines in ~all news simultaneously, even if not "hacker news" -- nuclear explosions, assassinations of G7 leaders, major wars, etc.

-----


I'm touched, but there are several dozen HNers in Japan who I've met personally (just an FYI) most were closer to it than I was.

-----


I have been writing command line scripts in PHP for the most part of the past 18 months.

I will have to agree with you that PHP is perceived as a web language. Hopefully with more articles like these that perception will change.

-----


I have also been writing PHP command-line scripts, or rather maintaining them.

They are a bad idea, in general. PHP is designed for a very specific purpose: Very quickly building web pages in a CGI or mod_php environment and spitting them out. Everything else is an afterthought, and it shows.

For example, if you try to manipulate the filesystem extensively using PHP you will eventually trip over its "stat cache". PHP caches the result of stat() calls, presumably assuming that, hey, it is more important to avoid redundantly calling stat() during the time-sensitive rendering of your web page than it is to actually return correct information about the state of the filesystem. I mean, how often do symlinks change or files get moved during the rendering of a typical web page? And how much web-page-rendering code really depends on being able to read a link, then read the link again after the link has changed on disk? You can afford to ignore that stuff at the language level, if you're PHP.

The result is that you have to learn about the stat cache and remember to call clearstatcache() all the time when manipulating the filesystem in PHP.

That's just one example of why it's better to use Ruby or Perl to write command-line scripts. These languages were designed with command-line scripting in mind. Indeed, this is the flip side of the reason why PHP eventually drove out Perl as a web development language: Perl was originally designed for command-line scripting, and PHP was originally designed for the web. Use tools for their proper purpose.

-----


Use tools for their proper purpose.

Java was originally designed for programming embedded devices. Python was originally designed as a teaching language. One anecdote suggests that Lisp's original designers always intended to add syntax to the language.

Perhaps a decade after a language's invention it's possible to discuss its current suitability and design for specific tasks more than its original design intent.

(I consider PHP's relative ease of deployment over everything else far more explanatory of its ubiquity than any original design intent.)

-----


Good example!

Things like "stat cache" and "memory leaks" are what I watch out for when I write command line scripts in PHP. Also, I do not run my scripts as a daemon and I make sure that they do not run for more than a set maximum execution time.

So yeah, it may not be the most perfect choice but, it beats : having to learn another language when I know what to look out for when I write a command line script in PHP.

-----


I use PHP at work for creating not only web applications but, also to do a lot of non-user facing backend stuff. It's great to know that someone out there is using PHP at a much bigger scale for backend stuff.I hope he shares more technical details. If you don't like PHP, fine, but, don't think all PHP programmers are stupid.

I once had a Python programmer looking at the kind of stuff that I was doing with PHP and he was surprised that such things could be done in PHP.

This is an actual conversation that I had in a meetup:

Guy1: If PHP were to disappear, it would bring down a lot of the web with it, wouldn't it?

Guy2: Nah, but, that would be the case if Java or .net were to disappear.

Me: (to myself)Wtf!

Guy1: But, most of the links that I click on the web end with .php.

Guy2: um.....

Me: (to myself)pwn3d!

-----


I wouldn't say that anyone has the impression that "all PHP programmers are stupid." Rather, it's more that PHP, on top of attracting O(N) competent developers like any other language, also attracts O(k >> N) marginal developers who barely know enough to get off the ground, and couldn't really manage to code in any other language. When you randomly select a "representative" PHP coder (such as by listing "knows PHP" as a criterion for resume submissions), you get a marginal one.

-----


Stupid was a bit too strong, but, I stand by what I said based on my experience. Articles like these exist partly because of the belief that PHP programmers in general are not competent. You do not hear such frequent rumbling on Python and it's practitioners. One could apply the same O(N)and O(k>>N) logic there as IMO, Python is not harder to learn/program in compared with PHP.

-----


I love ihackernews! The integration with ViewText makes it a perfect choice to read HN stories on my phone. Thanks and Great Job!

-----

More

Applications are open for YC Summer 2015

Guidelines | FAQ | Support | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: