View Full Version : How to improve your programming skills

Jon W
03-13-2009, 07:34 AM
Hello, my name is Jonathan. I've been programming off and on for the last few years. In that I time have learned HTML,CSS and enough PHP to get by. Although I know enough PHP to get by, I sometimes feel that my coding is still nubby coding. I'll give you example. I installed phpBB3 forums the other day, and I was looking around in the files and looked at one of their PHP files, and I was like "Huh, how does this all come together in work" I guess the parts that confused me the most is when they would have a script that would work somewhere in the range of:

$template->assign_block_vars('user_row', array(
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => $row['user_colour'],
'USERNAME_FULL' => $username_full,
'LASTUPDATE' => $user->format_date($row['session_time']),
'FORUM_LOCATION' => $location,
'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $session_id == $row['session_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '',
'USER_BROWSER' => ($auth->acl_get('a_user')) ? $row['session_browser'] : '',

'U_USER_PROFILE' => ($row['user_type'] != USER_IGNORE) ? get_username_string('profile', $row['user_id'], '') : '',
'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"),
'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']),
'U_FORUM_LOCATION' => $location_url,

'S_USER_HIDDEN' => $s_user_hidden,
'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false,
'S_USER_TYPE' => $row['user_type'],

That.... I guess I don't quite get what something like this is suppose to be saying...


I understand that the template is a variable, but then he pulls this number -> And I'm like... Okay, so that means.... And I really don't know how to ask people what would -> mean in a script without showing a code using it. I understand the rest of that stuff for the most part. I guess the whole point of this post and question is how can I improve my skills and just get better at what I enjoy doing so much. Is it all about asking questions? Because if so, I sure do ask a lot of them. lol So if you can explain I'm just wondering, what was the road that you took to become and know PHP so well?

I guess I should also mention is that I've never been to college for programming. So if you have then this question really doesn't apply to you. Although if you would like to comment then feel free.

Jon W

03-13-2009, 08:19 AM
Thats funny, I just answered an object based question. Completely different though.

-> indicates object member or method access. $template is a variable representing an object with the assign_block_vars method.

Learning is all about trying things out. Asking questions is good, but you can only learn so much from being told. Testing is IMO the best route, you'd be surprised what you'll find. Trial and error is how I learned PHP. I had already programmed in PHP for 6 years before I went to any computer courses, so they are not necessary either. What I did learn from school was how to program correctly, which is way more important than knowing the language (its easy to learn a new language).