 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
04-22-2008, 05:47 AM
|
#1 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
You must get worse, before you get better!
For.. f.. sakes...
I wish I had never started this.
The first 'major' script I decided to undertake since getting back into PHP was a user authentication system. I figured this would be a good idea, for a bunch of reasons. First and foremost, for the site I want to build, it would be the most basic building block I needed for everything else to function. Secondly, it would incorporate a wide variety of subjects I've been learning about, and wanted to improve upon... security, forms, sessions, et al.
So I wrote the basics, and it went great. I was impressed. Then I learned about OOP, and I built some classes, and everything was going fine. Everything worked. It was a bit messy, but somehow, I could register, log in, log out, track users, and have a bit of fun with it.
Then, it happened.
The singleton.
Uh oh.
Now that I've started to learn about design patterns, and more in depth about OOP, my brain has fried. Everything I once had mastered, has fallen apart, and none of it makes sense anymore. Why oh why, did I have to push myself? Why do I feel the need to try and learn new things every day?
I nearly threw everything out three times tonight to start over from scratch. I've come so far, but now that I have this stupid stupid idea in my head that I need to loosely couple my classes and develop some kind of design model and methodology to make sure that I can continually expand and increase the power of my lil baby, it all just looks so messy... how do I clean up the mistakes of my early days... how do I utilize what I've come so far on, and somehow turn it into the beast I envision?
WHO ARE YOU PEOPLE, AND HOW DO YOU MAKE ALL MY FUN TURN INTO MY NIGHTMARE? The problem is, it's still fun. Sorry, I just had to rant a little.
Anywho... back to studying.
-m
|
|
|
|
04-22-2008, 11:01 AM
|
#2 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
okay.. But, I think you should lay off the coffee, lol.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
04-22-2008, 11:27 AM
|
#3 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Trying to tackle such a major paradigm shift is certainly enough to confuse the noggin for a while. Take your time and don't try and become a super-duper OOP expert overnight; it just doesn't happen like that.
Keep learning little things and implementing them as best you can. Sooner or later it'll hit you without even realising it: "whoa, I'm doing it!"
|
|
|
|
04-22-2008, 11:29 AM
|
#4 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Salathe
Trying to tackle such a major paradigm shift is certainly enough to confuse the noggin for a while. Take your time and don't try and become a super-duper OOP expert overnight; it just doesn't happen like that.
Keep learning little things and implementing them as best you can. Sooner or later it'll hit you without even realising it: "whoa, I'm doing it!"
|
It took me about 2 months to start any Interfaces in oop, and it took me about a year to even understand abstract classes :P.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
04-22-2008, 02:41 PM
|
#5 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Buuuuuuuut ittt shoooooooooUUUuuuUuuld.
I'm not expecting it completely overnight, but I mean c'mon. Two nights at most.
I was really frustrated with all of it last night, but I realized afterwards all I need to do is slow down and work with what I already know. If, by the time I get done, it isn't extensible in the way I had hoped, so be it, then I'll take what I learned and start over at that point and build it better.
Sorry about that rant. Not really useful to the forums but I had to get it out somewhere.
-m
|
|
|
|
04-22-2008, 03:18 PM
|
#6 (permalink)
|
|
The Contributor
Join Date: Apr 2008
Location: Tampa, FL
Posts: 65
Thanks: 6
|
Actually, if you think about it, it could help serve as a warning to novice programmers....
that being...
Slow down, use what you know, don't try to force yourself, and with patience everything will come together in the end...
__________________
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
|
|
|
04-22-2008, 03:39 PM
|
#7 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
It came together. I'm not a novice, I'm a freakin Jedi.
I figured out what I was doing wrong trying to implement the singleton - I was still thinking in a fairly linear fashion of includes and global variables, and even though I have the proper functionality built into my parent class, I was still using it just like I would an included class.
Now I've got a bunch of work, but it's all syntax. Gotta go through and remove all references to global $database, $form, $etc; and replace it with $database =& kePhoto::getInstance('database');. Something just clicked this morning, and I'm liking this a LOT. Even if it's not being fully implemented properly, it's a damn sight better than what I had before. Now it only calls objects as needed, instead of calling every object, every time, like I had it before. Woo Wooooo.
-m
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|