« first day (854 days earlier)      last day (4094 days later) » 

user895378
11:04 PM
> Clueless people get obsessed with languages and frameworks. No matter what language and framework you use, you have to write your application code. If you use a fancy framework, then you have to write framework-compliant code in addition to your program’s code. With node.js, you’re fiddling around with callback functions and manually managing timing, instead of letting Apache and the OS do it for you.
 
@rdlowrey Just popped by to say that just because you don't understand how a language or framework works doesn't make you right :)
You're not 'manually managing timint' you're programming event based. Callbacks make more sense than sequential code for event based code, which is what you're writing in your api anyway.
 
@rdlowrey how do you ensure that the writes will succeed fast enough?
 
@BenjaminGruenbaum common misconception
 
@NikiC I'm sure you think it is but you're reminding me of classic ASP developers a few years ago.
Then they said "We don't need php, asp (classic)/PERL is great. Its code is easier to read, php isn't a real language"
 
@BenjaminGruenbaum If they were talking about php4 they were probably right ;)
 
11:14 PM
@PeeHaa I'd argue that PHP4 was a breakthrough that changed the web forever :) PHP5 is a lot better but it's not a one size fit all, just like node.js isn't
 
@BenjaminGruenbaum The way you are saying that implies to me that you think that just because some new way of programming turned up it is bound to be good. That's not true
 
Different languages/frameworks all have their ups and downs
 
If someone tells that "XYZ sucks" that may be because he does no properly understand the concept, but it can also be because it actually does suck ;)
 
@NikiC I'm not saying it's better because it's newer, javascript is older than php
 
Agreed. Most frameworks are a piece of crap. You just have to know where the crap is exactly and how to avoid it.
 
11:16 PM
That's the thing, there are frameworks that are not a piece of crap, I'm also not calling PHP crap
I'm just saying that event based code with callbacks isn't harder to read once you get used to it. It's harder to learn.
PHP is extremely easy to learn which is why php developers tend to not like a lot of other languages.
 
lies! Everybody loves python
 
node.js is different, that doesn't make it better/worse than php, but just because you don't understand something doesn't mean it's bad
Just like you don't like C#, or RoR
 
@BenjaminGruenbaum this has nothing to do with php developers not liking other languages. I'm a PHP developer and I like a lot of other languages. I like C++, I like Python, I like Haskell. I also like JavaScript. But still I think that the concept of using node.js for "real" applications is very fundamentally flawed
 
@NikiC why?
 
I think that's a no sense conversation. If navigators had some kind of internal PHP motor that we can talk about what language is better. It is impossible compare PHP with Js and Node because its about one motor vs two (almost).
 
11:20 PM
@JuanFernandoz I'm not sure I understand
 
@BenjaminGruenbaum Because of what @rdlowrey said. The callback-style programming is just forcing you to manually manage things that normal blocking calls give you for free. I really can't believe how people can think that those async APIs in any way improve your programming experience
 
@Benjamim PHO is easy or hard that depends a lot...
 
@NikiC what do you advise instead of node.js ?
 
Blocking calls are easy, because the operating system manages the asynchronity that lies behind them
 
@NikiC you tell your program what to do when something happens. Something can be a lot more than 'user enters php page'. That makes a lot more sense to me. Events.
@NikiC it manages the logic behind them poorly, context switches are expensive, node.js gives you more control. As do react, ruby event machine, and HttpAsync on C#
 
11:22 PM
@BenjaminGruenbaum With events like "a record from mysql arrived" it becomes very inconvenient
 
@PeeHaa Just an FYI: this is turning into a major refactoring, I have to undo some of my own stupidity
 
@NikiC yes, that is an event, I want to handle it, I don't want to block the thread until such an event arrives. If I want to I can though
I just shouldn't
 
@BenjaminGruenbaum the cost of a context switch is a lot lower than the cost of the actual system call, usually. The costly part is actually reading a file or whatever, not the context switch to start doing that ;)
 
@DaveRandom That doesn't sound good :P
crap language settings
 
@PeeHaa No actually it will be good, I have realised that I missed a couple of obvious things in the first place, notably the read buffer should be an object and not just a dumb string and that messages != frames
 
11:25 PM
@NikiC You say so, I'm still waiting on those benchmarks
 
@BenjaminGruenbaum "those benchmarks" are unrelated. They actually use a node.js like approach ;)
And directly using that appraoch is just as bad in php as it is in node
 
@NikiC then how do you explain the speed difference between evented non-blocking I/O and traditional threads?
 
Or rather, it's bad in most cases
 
25
Q: Node.js vs PHP processing speed

Cody CravenI've been looking into node.js recently and wanted to see a true comparison of processing speed for PHP vs Node.js. In most of the comparisons I had seen, Node trounced Apache/PHP set ups handily. However all of the tests were small 'hello worlds' that would not accurately reflect any webpage's m...

 
I never said it's a one size fit all
 
11:26 PM
There are obviously cases where it makes sense to use node. For small things like chats
@BenjaminGruenbaum I'm referring to writing "normal" application code in node.js
 
@NikiC and I'm not, I'm referring to writing RESTful APIs in node.js
 
user895378
@igorw That's a trade-secret at this point :)
 
user895378
What a blatantly idiotic comparison that is.
 
@BenjaminGruenbaum exactly the kind of thing I wouldn't do with it
 
user895378
11:29 PM
You'd have to not understand computers to compare benchmarks for an app that has to generate a new process for each request to an app that doesn't.
 
@rdlowrey why? I have a CS degree and I disagree with that last statement
 
user895378
var_dump(++$tinyAvatars > $beingSuckedInByAntagonism); // bool(true)
 
@BenjaminGruenbaum Because you are benchmarking two incomparable things.
 
@DaveRandom how are they incomparable?
 
@BenjaminGruenbaum They do different things?
 
11:30 PM
Just because one app fires threads to do something and another runs in NUM_CPUS processes to begin with and doesn't start/stop new processes doesn't mean they can't be tested against each other
 
Apache/Nginx/whatever are general purpose extensible servers, the Node app is all in one with an embedded server. Of course Node will outperform the others, it's solving a totally different set of problems in a very specific way.
 
@DaveRandom I have a typical service that offers a REST api, it has to make one or several DB calls, maybe access a file, maybe perform some validation, maybe do very little logic and return an answer to the client.
My argument is a good environment to write that as long as you have a good understanding of asynchronous coding
WAY better than PHP, but that's a futile argument :)
 
another of those moments where you just want to punch Stas in the face
 
What the app actually does isn't relevant, the point is that if you write it in Node you are writing an app that does exactly that in a very specific way, with the web server embedded. No insanely configuration process to fall through (yes Apache, I'm looking at you), no humungous routing table/vhost setup to traverse, just receive a request, process it and spit it out. Obviously that will be more performant, there's no bloat.
But at the same time, your app cannot do anything else unless you write the code to do it. It's not a couple of lines in a config file, its several hours/days/weeks/years of development.
 
user895378
(which may or may not end in a better solution than what's already been invented)
 
11:37 PM
That's the tradeoff you're making. And it's not a bad thing at all, but it does mean that the two are no longer comparable.
 
@DaveRandom you don't need hours/days/weeks/years of development to code a restful API...
I'm not going to argue this: codinghorror.com/blog/2012/06/the-php-singularity.html or that: me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design against PHP. I'm just saying you should not be so quick to diss alternatives like node.js because they're harder to understand at first.
 
You're still focusing on the wrong part of this. It's not about what the app does, restful or no, it's about the number of mechanisms that are involved to make it all happen.
It's completely language and platform agnostic.
And ftr, I like Node. But it's not a magic bullet.
 
Anyway, I got to go, good luck :) I never said node is a one size fit all, or that it's the greatest thing since sliced bread.
Until next time :)
 
yeah node.js are mroe faster and easier to make simple things....
 
11:41 PM
@PeeHaa lol that's awesome
 
It truly is :)
 
@rdlowrey so you too could not stand him
 
user895378
After a while it's just easier to prevent getting sucked into a pointless discussion by removing the temptation.
 
PHP vs Cobol please ha ha
 
@rdlowrey once I have secured the venture capital, I'd like to place an investment in your business.
 
11:48 PM
@NikiC Do you think he notices The Point sailing past him at speed on a regular basis?
 
user895378
@igorw lol, you might wanna wait to see the code before you say that.
 
@rdlowrey once I have secured the venture capital, I will no longer care. ;-)
 
user895378
hehe good point.
 
Diagnosis Murder Is Awesome
 

« first day (854 days earlier)      last day (4094 days later) »