[PHP] newbie question about code
I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie question about code
Did you mean to say That is a method call.? Bob McConnell - From: Joshua Kehn That is a function call. In Java: class Code { public static void function do_command(){ } } Code.do_command(); Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:27 PM, Adam Williams wrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
Bob- Yes, yes I did. And note that my Java code is incorrect, that should simply be public static void, no function. This is what I get for taking a week to code everything in Node.js. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:32 PM, Bob McConnell wrote: Did you mean to say That is a method call.? Bob McConnell - From: Joshua Kehn That is a function call. In Java: class Code { public static void function do_command(){ } } Code.do_command(); Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:27 PM, Adam Williams wrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
It's object oriented code. $code is an instance of class, and do_command() is a method if that class. I'd advise reading up on oop php. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Adam Williams adam_willi...@bellsouth.net Date: Fri, Sep 10, 2010 19:27 Subject: [PHP] newbie question about code To: PHP General list php-general@lists.php.net I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
Node.js, wouldn't that be javascript rather than java? :P Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Joshua Kehn josh.k...@gmail.com Date: Fri, Sep 10, 2010 19:32 Subject: [PHP] newbie question about code To: Bob McConnell r...@cbord.com Cc: Adam Williams adam_willi...@bellsouth.net, PHP General list php-general@lists.php.net Bob- Yes, yes I did. And note that my Java code is incorrect, that should simply be public static void, no function. This is what I get for taking a week to code everything in Node.js. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:32 PM, Bob McConnell wrote: Did you mean to say That is a method call.? Bob McConnell - From: Joshua Kehn That is a function call. In Java: class Code { public static void function do_command(){ } } Code.do_command(); Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:27 PM, Adam Williams wrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
Ash- Correct, hence my typo and nomenclature slip. ;) Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:48 PM, a...@ashleysheridan.co.uk wrote: Node.js, wouldn't that be javascript rather than java? :P Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Joshua Kehn josh.k...@gmail.com Date: Fri, Sep 10, 2010 19:32 Subject: [PHP] newbie question about code To: Bob McConnell r...@cbord.com Cc: Adam Williams adam_willi...@bellsouth.net, PHP General list php-general@lists.php.net Bob- Yes, yes I did. And note that my Java code is incorrect, that should simply be public static void, no function. This is what I get for taking a week to code everything in Node.js. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:32 PM, Bob McConnell wrote: Did you mean to say That is a method call.? Bob McConnell - From: Joshua Kehn That is a function call. In Java: class Code { public static void function do_command(){ } } Code.do_command(); Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:27 PM, Adam Williams wrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
At 2:27 PM -0400 9/10/10, Joshua Kehn wrote: Adam- That is a function call. In Java: class Code { public static void function do_command(){ } } Code.do_command(); Regards, -Josh Not just Java, but does I've seen this in several languages. Javascript is one. But realize that Java is to Javascript as Ham is to Hamster. In other words, the two aren't related. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
This is what I get for taking a week to code everything in Node.js. It is a Friday, so I'll let my curiosity get the best of me and ask a follow-up on something non-PHP. What insights/impressions do you have regarding Node.js after a week of working with it? Thanks, Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com
Re: [PHP] newbie question about code
I would check this out to give you a decent understanding of php's oop. http://php.net/manual/en/language.oop5.php Chris. On Fri, Sep 10, 2010 at 2:27 PM, Adam Williams adam_willi...@bellsouth.netwrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code-do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
Adam- It is unique. I'm writing code that really can't be done any other way. How it handles events, sockets, etc is exceptional. The best part is everything now is JavaScript. The server (Node.js) is written in JavaScript. MongoDB is JavaScript. The frontend used to manage the WebSocket is entirely JavaScript. I have essentially replaced J2EE as the backend with Node and I couldn't be happier. Of course standard JavaScript woes apply. Debugging is a royal pain in the ass. Your code can and will suddenly fail due to odd strange errors. There are stability concerns with Node, it is version 0.2 after all. It won't replace PHP or Java as an enterprise level solution, but it does fill in the gaps very nicely. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com On Sep 10, 2010, at 2:53 PM, Adam Richardson wrote: This is what I get for taking a week to code everything in Node.js. It is a Friday, so I'll let my curiosity get the best of me and ask a follow-up on something non-PHP. What insights/impressions do you have regarding Node.js after a week of working with it? Thanks, Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about code
On Fri, Sep 10, 2010 at 3:03 PM, Joshua Kehn josh.k...@gmail.com wrote: Adam- It is unique. I'm writing code that really can't be done any other way. How it handles events, sockets, etc is exceptional. The best part is everything now is JavaScript. The server (Node.js) is written in JavaScript. MongoDB is JavaScript. The frontend used to manage the WebSocket is entirely JavaScript. I have essentially replaced J2EE as the backend with Node and I couldn't be happier. Of course standard JavaScript woes apply. Debugging is a royal pain in the ass. Your code can and will suddenly fail due to odd strange errors. There are stability concerns with Node, it is version 0.2 after all. It won't replace PHP or Java as an enterprise level solution, but it does fill in the gaps very nicely. Regards, -Josh Thanks for the insights, Josh. I've been intrigued by Node.js and it's architectural implications, and your feedback helps as I evaluate potential projects/experiments going forward. Excellent point about the debugging relative to other environments. Palm's inclusion of Node.js in webOS 2.0 does help provide more confidence in the code-base, even if it is relatively early in the development cycle, so I guess I'll have to start tinkering soon :) Thanks again, Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com