GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   So, I started a personal blog ... (https://gfy.com/showthread.php?t=897418)

edgeprod 04-02-2009 01:58 AM

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.

PR_Sebas 04-02-2009 06:08 AM

looks good... best of luck with it

fris 04-02-2009 07:12 AM

whats a blog?

HorseShit 04-02-2009 07:59 AM

I will hopefully never go to that blog

Sands 04-02-2009 08:08 AM

Increase the font size on the code, dude. It's hard to read.

edgeprod 04-02-2009 01:22 PM

Quote:

Originally Posted by NwSebas (Post 15700888)
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 (Post 15701093)
I will hopefully never go to that blog

Agreed. :thumbsup

edgeprod 04-02-2009 10:38 PM

Quote:

Originally Posted by Sands (Post 15701123)
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! :thumbsup

edgeprod 04-06-2009 06:39 PM

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.

born2blog 04-06-2009 06:43 PM

Quote:

Originally Posted by fris (Post 15701040)
whats a blog?

I don't know, seems it's all the rave these days :1orglaugh

collegeboobies 04-06-2009 06:45 PM

Quote:

Originally Posted by edgeprod (Post 15714167)
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

Si 04-06-2009 06:58 PM

Quote:

Originally Posted by born2blog (Post 15714176)
I don't know, seems it's all the rave these days :1orglaugh

SHIT!

Didn't know :1orglaugh

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

thanks for teh tip :thumbsup

edgeprod 04-07-2009 03:54 AM

Quote:

Originally Posted by mobilefun1987 (Post 15714207)
SHIT!

Didn't know :1orglaugh

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

thanks for teh tip :thumbsup

:1orglaugh:1orglaugh:1orglaugh

That cracked me up.

2012 04-07-2009 03:58 AM

your "put up or shut up" code example is a Hello World Class ? :helpme :D

edgeprod 04-07-2009 04:07 AM

Quote:

Originally Posted by fartfly (Post 15715374)
your "put up or shut up" code example is a Hello World Class ? :helpme :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. :)

quantum-x 04-07-2009 04:13 AM

Quote:

Originally Posted by edgeprod (Post 15700567)
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)

2012 04-07-2009 04:17 AM

Quote:

Originally Posted by edgeprod (Post 15715396)
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

edgeprod 04-07-2009 04:19 AM

Quote:

Originally Posted by quantum-x (Post 15715408)
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. :)

Brujah 04-07-2009 04:19 AM

Quote:

Originally Posted by edgeprod (Post 15700567)
In the short term, I'll probably write about how to treat clients...

:1orglaugh:1orglaugh:1orglaugh

edgeprod 04-07-2009 04:19 AM

Quote:

Originally Posted by fartfly (Post 15715414)
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. :winkwink:

quantum-x 04-07-2009 04:39 AM

Quote:

Originally Posted by edgeprod (Post 15715418)
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.

edgeprod 04-07-2009 01:33 PM

Quote:

Originally Posted by quantum-x (Post 15715453)
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. :thumbsup


All times are GMT -7. The time now is 04:10 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123