Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-02-2009, 01:58 AM   #1
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
So, I started a personal blog ...

Yes, this is a cross-post. Whee-ha.

I'm not sure what I'm intending to do with it, how long I'll keep it, or who my audience even is, but if you're a coder (or someone who deals with coders), you might find it interesting.

Comments are welcomed, as I'm trying to at least provide SOME level of service to people out there.

In the short term, I'll probably write about how to treat clients, how to document code, explore PHP tricks and tips, and other topics.

I posted a sample of my code because I hate when people just start talking about something without you being able to see their own work.

I also posted about ending a contract on good terms and avoiding spaghetti code.

If you find any of this the least bit useful, please leave comments our encouragement here ... if there's a desire to read more, I'll probably keep it going.

Thanks for looking. If I have you on ignore and you reply, I apologize in advance, but I'm sure you know why.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 06:08 AM   #2
PR_Sebas
Confirmed User
 
Join Date: Dec 2006
Posts: 2,825
looks good... best of luck with it
__________________
PR_Sebas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 07:12 AM   #3
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
whats a blog?
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 07:59 AM   #4
HorseShit
Too lazy to set a custom title
 
Join Date: Dec 2004
Posts: 17,513
I will hopefully never go to that blog
HorseShit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 08:08 AM   #5
Sands
Confirmed User
 
Sands's Avatar
 
Join Date: Feb 2007
Location: 418194907
Posts: 3,134
Increase the font size on the code, dude. It's hard to read.
Sands is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 01:22 PM   #6
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by NwSebas View Post
looks good... best of luck with it
Thanks! I've been doing what I do for a while, so I figure if I can pass some tips along and it helps someone, all the better.


Quote:
Originally Posted by jdavis View Post
I will hopefully never go to that blog
Agreed.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2009, 10:38 PM   #7
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by Sands View Post
Increase the font size on the code, dude. It's hard to read.
Sorry, missed your comment before. I made it 14 px now. Is that a bit easier? It is easier for ME to read (it WAS small, you're right), and it doesn't blow out the table (bonus!). Let me know.

Thanks!
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-06-2009, 06:39 PM   #8
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
This week's update is about IDEs and why I use them versus Notepad. The "popular" thing to say is "yeah, I write code on Notepad," and then (I assume) to throw down "old school" gang signs. I discuss this on Wednesday in a short commentary piece.

Opening paragraph (the rest is scheduled for Wednesday, and will appear automatically on the blog, not on GFY):

Quote:
Unless you live under a rock, you know that integrated development environments are for sissies, and Notepad is the "old school," "hardcore," or "l33t" platform for developing code. I call bullshit. A good IDE can reduce time to market, improve coding efficiency, and help you write tighter code.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-06-2009, 06:43 PM   #9
born2blog
Confirmed User
 
Join Date: Sep 2006
Posts: 1,801
Quote:
Originally Posted by fris View Post
whats a blog?
I don't know, seems it's all the rave these days
__________________
Juicy Ads - Buy & Sell Quality Traffic!!
born2blog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-06-2009, 06:45 PM   #10
collegeboobies
So Fucking Banned
 
Join Date: Jul 2004
Posts: 3,644
Quote:
Originally Posted by edgeprod View Post
This week's update is about IDEs and why I use them versus Notepad. The "popular" thing to say is "yeah, I write code on Notepad," and then (I assume) to throw down "old school" gang signs. I discuss this on Wednesday in a short commentary piece.

Opening paragraph (the rest is scheduled for Wednesday, and will appear automatically on the blog, not on GFY):

Ok, write about your blog on your blog, not here
collegeboobies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-06-2009, 06:58 PM   #11
Si
Such Fun!
 
Industry Role:
Join Date: Feb 2008
Posts: 13,900
Quote:
Originally Posted by born2blog View Post
I don't know, seems it's all the rave these days
SHIT!

Didn't know

Better go and download PressWord versions 7 and start making blost pogs.

thanks for teh tip
Si is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 03:54 AM   #12
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by mobilefun1987 View Post
SHIT!

Didn't know

Better go and download PressWord versions 7 and start making blost pogs.

thanks for teh tip


That cracked me up.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 03:58 AM   #13
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
your "put up or shut up" code example is a Hello World Class ? :D
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:07 AM   #14
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by fartfly View Post
your "put up or shut up" code example is a Hello World Class ? :D
What would you prefer? I figured it'd be an uncomplicated way to show the way I code, indent, document, etc.

Do you have a better suggestion to illustrate those concepts? I'd be happy to hear it out and decide if I'd like to post it.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:13 AM   #15
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by edgeprod View Post
Yes, this is a cross-post. Whee-ha.

I'm not sure what I'm intending to do with it, how long I'll keep it, or who my audience even is, but if you're a coder (or someone who deals with coders), you might find it interesting.

Comments are welcomed, as I'm trying to at least provide SOME level of service to people out there.

In the short term, I'll probably write about how to treat clients, how to document code, explore PHP tricks and tips, and other topics.

I posted a sample of my code because I hate when people just start talking about something without you being able to see their own work.

I also posted about ending a contract on good terms and avoiding spaghetti code.

If you find any of this the least bit useful, please leave comments our encouragement here ... if there's a desire to read more, I'll probably keep it going.

Thanks for looking. If I have you on ignore and you reply, I apologize in advance, but I'm sure you know why.
Looks good. If you're going to the effort of coding in classes in PHP, you should use exceptions too (..if you already don't)
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:17 AM   #16
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by edgeprod View Post
I figured it'd be an uncomplicated way to show the way I code, indent, document, etc.
yeah, it did. i just thought the two concepts were funny
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:19 AM   #17
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by quantum-x View Post
Looks good. If you're going to the effort of coding in classes in PHP, you should use exceptions too (..if you already don't)
Thanks very much. For error handling in the Hello class, I used the default handler in switch(), rather than throwing an actual exception. I wanted the code to be backward-compatible with PHP4.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:19 AM   #18
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Quote:
Originally Posted by edgeprod View Post
In the short term, I'll probably write about how to treat clients...
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:19 AM   #19
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by fartfly View Post
yeah, it did. i just thought the two concepts were funny
Your comment definitely made me laugh ... I just added the clarification for other people who might be tempted to "not get it" if you know what I mean.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 04:39 AM   #20
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by edgeprod View Post
Thanks very much. For error handling in the Hello class, I used the default handler in switch(), rather than throwing an actual exception. I wanted the code to be backward-compatible with PHP4.
Well, considering PHP4 is well and truly gone now...(but I do understand your frustration)
Coders discussing style always turns into a pissing contest, but here we go.

There are a few things that could be built on / improved. Not sure if you left them out because it was a simplistic example, or because you don't use them.

I spent pretty much every moment of the day coding, and could have done w/ some sage tips, especially w/ OOP in PHP when I was learning, so take this for what it is.

- Making the $returnText shouldn't be public. It should be private, with an accessor function.
- You shouldn't refer to it as $returnText .= " " - it should be $this->returnText This will save you a hell of a lot of frustration with scope, and missing and overwritten variables down the line
- Returning a string for error checking isn't really that strong, because you then have to further check that string for errors.

You can do this two ways, easily
#1 - Via exceptions - simply throw an exception when you receive bad data, and catch it on the other side, or in the parent class, depending on your heirachy.

#2 - PHP4 Compatible: Have it return a boolean for the results, and let the user fetch them (ie, if (!$helloWorld->GetHelloText('1')) { // error code } else { $helloWorld->GetResult(); }

and so on.
These things become increasingly important as your classes get more complicated - it's important to do it from the ground up.

Using __construct() is very important, too.

The problem, at least in my interpretation, w/ OOP in PHP is that it's not as strict as say Java or c++, meaning that it can be done poorly, which leads to headaches later on.

In any case though, kudos for posting this - there aren't many coders (esp on this board) that are much more than scripters, even less than those that understand design pricinciples and flow (specification, implementation, verification, documentation, etc), normalised db designs, and the big one: security. The number of scripts that I see getting passed around on here that are insecure is scary.

Anyhow.. didn't mean to sound like a grumpy old bastard, the merit of your post inspired me to reply.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-07-2009, 01:33 PM   #21
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by quantum-x View Post
There are a few things that could be built on / improved. Not sure if you left them out because it was a simplistic example, or because you don't use them.
What you posted is almost exactly how I'd "scale" the class as it becomes more complicated and/or becomes production code. I can't believe we haven't worked together before on something! Be sure to light up my ICQ.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.