0 karma · joined June 25, 2015
But I agree, it's crystal clear for anyone with a minor PHP knowledge. For the rest it's just "clear". (It will still work calling $a['1'] with the quotes so what exactly is the issue? If you mean the drawbacks of type coercion not sure if this example is the best one.)
def wsgi_app(environ, start_response):
output = 'Hello World!'
status = '200 OK'
headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, headers)
yield output
# mod_wsgi need the *application* variable to serve our small app
application = wsgi_app
Instead of this: <?php
echo 'Hello World!';This is the exact bull* that good hearted Haskell and Lisp guys have to face and fix because of arrogant people like you.
First of all, a good PHP programmer is a good programmer. End of story. You can write crystal clear code in PHP that anyone who started with C (how many I wonder?) or a C inspired language can read. Spreading information and knowledge IS FAR MORE IMPORTANT than debating the language.
Let me ask you a question, did you just happen to read that post that was recently on the front page of HN? The one that showed how much awesome is Lisp comparing to Python? How Python's creator seems to hate Lisp (functional programming)? Did you read it and got to the conclusion that since (perhaps) you are using a functional language then you are entitled to spew crap like that since you are the holder of truth?
Congratulation! PHP is worse than a functional language (you can write functional code in Python and PHP btw) and you are the winning lord of programming languages debates!
Sorry if I am hurting feelings here but it is true. You have to be a special flake if you think this is quality content. So please, go ahead with your reactions, they speak volumes about who exactly is the gross of HN.
And even if kids somehow really grasp what is going on in there, aren't they damaged in some profound way when they will actually have to deal with code? I remember the shock and horror my colleagues had when in college we went from a visual Java builder software to actual coding in the data structures course.
And also, learning JavaScript as a beginning language? With all of the callbacks / asynchronous paradigm traps? Wow, that is really incredible for a kid to understand!
Really cool interesting stuff!
I also wonder if Java has any kind of optimizations to experiment with.
Also, I am thinking if and how much speed gain could one inject by not using OOP in PHP...
The results were as follows:
~ 14.2 seconds for Python 3.4.3 [1]
~ 9.0 seconds for Python 2.7.9 [1]
~ 9.0 seconds for PHP 5.6 [2]
~ 2.3 seconds for C [3]
~ 2.3 seconds for Java 8 [4]
Again, this was on my machine with out of the box settings. I have linked the test code that I wrote and perhaps there is something wrong with my Python and PHP code but to me the results were quite revealing. Also it's interesting to see that on my configuration C and Java both hit the limit of my CPU (I can't explain the score otherwise) and I can't know for sure if on a more powerful CPU Java would still be on pair with C.
[1] https://gist.github.com/anonymous/7edafa3889be967a1e1d
[2] https://gist.github.com/anonymous/56ff76849f5a312340d9
In your opinion perhaps. In my opinion it's a perfectly good example of poor writing as well as a superiority complex.
> If lithium were a deity, it wouldn't exist.
Please.
Claiming that you don't believe in God is equally annoying as those sect guys knocking at your door. I do believe in God and I find the use of lithium in treating these illnesses a hope (with potential dead serious side effects: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4456600/) but not the potential meaning of life (?! how can you compare lithium with the notion of God?!).
From a web developer's mind: the coll thing is that the tool can be further developed and taken to new directions. For example implement the capability to take snapshots of pages and see if they've changed in layout and notify the user of changes (pretty awesome for scrapping).
I totally agree, unit testing is such a small cog in the wheel of software quality that it is truly a shame how something like this takes all the scene.
I just cannot believe people praising 'Unit Test'-ing. Fellow programmers, how exactly do you unit test a method / function which draws something on the canvas for example? You assert that it doesn't break the code?!
I see some really talented people out there who write unit test as proof that their code works without issues, that it's awesome and it cooks eggs and bacon etc. They write such laughable tests you cannot even tell if they are joking or not. They test if the properties / attributes they are using in methods are set or not at various points in the setup routine. Or if some function is being called after an event is being triggered.
My point is this: unit testing can only cover such tiny, tiny scenarios and mostly logic stuff that it is almost useless in understanding what is going on in the big picture. Take for example a backbone application like the Media Manager in WordPress. Please tell me how somebody can even begin to unit test something like that.
Unit testing is a joke. And sometimes a massive time consuming joke with a fraction of a benefit considering the obvious limitation(s).