![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
![]() 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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Dec 2006
Posts: 2,825
|
looks good... best of luck with it
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Join Date: Dec 2004
Posts: 17,513
|
I will hopefully never go to that blog
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2007
Location: 418194907
Posts: 3,134
|
Increase the font size on the code, dude. It's hard to read.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
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:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
So Fucking Banned
Join Date: Jul 2004
Posts: 3,644
|
Quote:
Ok, write about your blog on your blog, not here |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Such Fun!
Industry Role:
Join Date: Feb 2008
Posts: 13,900
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
your "put up or shut up" code example is a Hello World Class ?
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
Quote:
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. ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
![]() ![]() ![]()
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 | |
Permanently Gone
Industry Role:
Join Date: Mar 2004
Posts: 10,019
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |