Jump to content

Archived

This topic is now archived and is closed to further replies.

steelmanronald06

Repeat Code

Recommended Posts

Okay, so when I program something in PHP I normally end up just using the same funtions, but in a better way.  Sometimes this involves me using a new function, but not always.  therefore, here is my question. If all my coding projects use the same funcitons, and I try to use others but sometimes you only have one way to do it, how do you learn new functions?

I have considered taking on some kind of project, a big project, but what? Not another website, but maybe a software?  Forums are out of the question, but perhaps content management?  ideas on what I should do to learn new functions? I figured content managment because there is so much it has to be able to do, right?

Share this post


Link to post
Share on other sites
functions aren't something set it stone.  You should be able to program for whatever your current need is.  A function is just a procedure for a certain result.  There are very few things that I use over and over.  I write code according to what my current script needs.  I'm not really sure what you are trying to learn?  How to program?

Share this post


Link to post
Share on other sites
Ha ha. I'm not talking about functions I make myself. I'm talking about PHP's pre-defined functions.  date(), echo(), etc.  I know how to program, but I just find myself using the same pre-defined php functions over and over and over.  I was just wondering how everyone else got to learning some new and different functions that php has to offer.  I know some would say go read the manual, and blah blah, but i learn better from application and I like to apply it to a project or something that will hold my attention and keep me motivated.  Anyone else similar to this?

Share this post


Link to post
Share on other sites
smaller project i'd like to eventually start: making a really really good search engine with 5 million options.

larger project i'd like to eventually start: somehow making a 3d model of the internet. Not necessarily of every website out there, but maybe websites retrieved from a search, or something.  Or maybe of the whole damn thing after all.  I've always dreamed of surfing the internet in 3d.  Gotta love those sci-fi books :)

Share this post


Link to post
Share on other sites
i learnt most of the functions i use from 3rd party software and examples. I first downloaded phpBB and cross-referenced many of the functions i saw with the manual when i wasn't sure. also, when i'm stuck on a problem and see example code as a solution, i'll always make a point of making sure i fully understand how it works before just plonking it into my code.

otherwise, many of the other functions i've learned are from the php.net manual itself - especially from the bit that says 'See also...'. i just come across functions and think 'Ah, that'll be useful for what I'm doing'. I'm not worried though about not having 'mastered' it, as you get to the stage where you have enough under your belt to pretty much achieve anything you want. other functions exist to make things 'better' or 'easier', but there are so many that you can generally complete a good project without even looking at.

one thing i've also noticed in programming/coding is that when you're doing a project, sometimes you do think to yourself "there MUST be a function for this" - and then it's generally just a case of finding out its name and parameters it uses. like you already KNOW what the language can do without yet knowing the details.

Share this post


Link to post
Share on other sites
I pretty much consult the manual, if I want to do something with a string, I point my browser at php.net/strings and it lists all of the functions for manipulating strings with a quick description next to each function. If I want to mess around with an array, I go to php.net/array - And so on...

Share this post


Link to post
Share on other sites
I'm pretty much the same, but I usually end up getting to the point of saying to myself "there has to be a better way to do X".  So I dig through the manual until I find something that fits and is more efficient than my current method.

The other way I learned more PHP was being pushed by my co-workers to do more and better things.  My first login system was built after a request to have an application that was restricted on many levels.  My first big project in arrays was dealing with a graphing tool that I built to handle several tens of thousands of data points.  My first CMS came about from one of my personal clients wanting a way to update their own content without needing me.  Etc, etc.

Share this post


Link to post
Share on other sites
A friend of mine just creates free stuff just so he can learn the functions. Example, I helped him with some forum software. He then went on to create a smaller and 'cleaner' looking mysql admin system kind of like phpMyAdmin.. but like i said, much smaller. Then he created this mail thing for free for people to check their mail on their own site without having to leave.
He learned more MYSQL functions and SMTP functions by doing this. I still know basically nothing about SMTP and didn't even think about just doing it for kicks.
If your a hands on person that learns better by 'doing' rather than 'reading' then it'd be easier and better if you just created applications around certain functions. That way you learn every inch of the functions use.. or so you think :-P

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.