Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Other Topics > Programming

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 04-10-2012, 05:31 PM   #1
Pooh-Bah
 
z28dreams's Avatar
 
Join Date: Sep 2005
Location: Spammer
Posts: 4,974
Most practical programming knowledge

In short, I'm looking to improve my basic programming skills, and wanted to figure out the most efficient way to become competent enough to create solid code.

I'm already familiar with most basic concepts: variables, loops, arrays, and limited experience with objects.

Most of my work has been hacking around PHP and mySQL and writing crude scripts for basic database CRUD operations. My HTML/CSS knowledge is basic and gets me by. Javascript is very poor.

Goal: To be able to work on more dynamic websites with AJAX/etc.

What core concepts should I focus on hammering home?
- Model / view / controller : I've done nothing with this - definitely should learn? Where to start?
- Overall best practices - often times I'll code things up and be unsure on the best structure of the code. For example - should this be 2 php files or one? Should these functions be combined? Also need clarification on when to use methods vs functions and what the advantages in various situations are.
- Best practices for database layout. I've read a bit on normalization and optimization with indexes, but it's pretty basic.
- Best practices for DB abstraction layers or similar. I'm using mysql_real_escape_string right now for SQL injection protection, but it feels hacky to me. Also doing almost nothing to prevent other attacks such as XSS/CSRF.

Specific things I'd like to be able to do:
- Work with proper parsing (JSON/XML/etc). Haven't done much with this
- Use AJAX to fire off queries without reloading pages (use jQuery /libraries for this or just learn how it actually works?)
- Mobile: learn how to best dynamically resize pages
- Error handling: I've only done this in incredibly hacky ways. Need to learn how to properly use exception handling. From what I understand there are core exception classes that you can extend with your own errors or something
- DOM manipulation - for scraping sites, user layout, etc.
- Better form validation w/ JS or existing libraries


I'm probably missing lots more, but just wanted to build up some core skills. Thoughts on what I should prioritize?

I know there's a lot of hate for PHP, but I already have put some time into it and it seems like a good way to go for small, rapidly developed sites.
z28dreams is offline   Reply With Quote
Old 04-11-2012, 09:21 AM   #2
Carpal \'Tunnel
 
clowntable's Avatar
 
Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 39,728
Re: Most practical programming knowledge

The very simple answer is...write more code, read more code.

I guess a good starting point would be to compare PHP MVC frameworks for a day, think of something you want to build and hack away.

If you don't want to bother comparing stuff just go with CakePHP or something.
clowntable is offline   Reply With Quote
Old 04-15-2012, 01:10 PM   #3
adept
 
Join Date: Mar 2006
Location: San Diego
Posts: 1,098
Re: Most practical programming knowledge

I found myself in a similar situation to you about a year ago.

I'm a big fan of both PHP and Ruby but I must say PHP confused the **** out of me when it came to learning MVC and good coding practices. The reason for this is I think when it is time to learn MVC you have 100 different choices and 1,000 different conventions to make you question your choices along the way. To make matters even more complicated, most of the code you write in PHP before learning MVC and a framework is likely procedural and just about every PHP framework uses OOP.

Eventually I said enough is enough and decided I would rather learn MVC through Ruby and it's defacto web framework Rails. The great thing about doing this is that Rails prides itself on its conventions. It also turns out that these conventions are very good programming conventions in general which you can take with you onto other language endeavors.
RICHI8 is offline   Reply With Quote
Old 04-16-2012, 02:59 PM   #4
Is Right
 
NoahSD's Avatar
 
Join Date: Aug 2005
Posts: 18,795
Re: Most practical programming knowledge

Your vague description of your question and the specifics that you provided don't match up.

If you want a practical, general-purpose programming language, you want a nice convenient scripting language like perl or Python.

It sounds like you want to do pretty specific things, though, and those specific things all sound like they're what PHP (and various variants thereof) and Ruby were designed for.
NoahSD is offline   Reply With Quote
Old 04-16-2012, 03:31 PM   #5
Is Right
 
NoahSD's Avatar
 
Join Date: Aug 2005
Posts: 18,795
Re: Most practical programming knowledge

Oh, whoa. I'm a dumbass who misread your thread title. Ignore me.
NoahSD is offline   Reply With Quote
Old 04-16-2012, 09:16 PM   #6
Carpal \'Tunnel
 
Gullanian's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 13,011
Re: Most practical programming knowledge

You say you've read about DB normalisation a bit, I'd definitely read a lot about this. A good DB is going to make the code ontop of it a lot easier to write.

Normalisation also teaches you good principles that you can use in code, for example class design.
Gullanian is online now   Reply With Quote
Old 04-18-2012, 12:59 AM   #7
rt1
adept
 
Join Date: Jun 2004
Location: just one rt
Posts: 1,099
Re: Most practical programming knowledge

Quote:
Originally Posted by z28dreams View Post
I'm probably missing lots more, but just wanted to build up some core skills. Thoughts on what I should prioritize?
I think your list is a little too buzzwordy. Just start coding and your list of things will fall into place.


When I am coaching people on web development we write one of the following applications in Rails:

1) A blog - Really good for intro to Rails and understanding the Rails MVC layers.

2) A car rental application - Really good for OO design patterns, system architecture, and best practice Ruby/Rails idioms.
rt1 is offline   Reply With Quote
Old 04-18-2012, 07:54 PM   #8
centurion
 
thunderchicken's Avatar
 
Join Date: Mar 2009
Posts: 197
Re: Most practical programming knowledge

Quote:
Originally Posted by Gullanian View Post
You say you've read about DB normalisation a bit, I'd definitely read a lot about this. A good DB is going to make the code ontop of it a lot easier to write.

Normalisation also teaches you good principles that you can use in code, for example class design.
A perfectly written set of code is useless against a database that sucks. Learning some PLSQL is helpful as well.

I've liked the Plural Oversight Videos. They're like $50/mo, but if you can get your employer to pay for them, they're worth it.
thunderchicken is offline   Reply With Quote
Old 04-19-2012, 05:01 PM   #9
centurion
 
Join Date: Mar 2009
Posts: 183
Re: Most practical programming knowledge

A question relating to this topic. I have started to learn C# as my first programming language and will start studying SQL as well later this year. I remember faintly a few things about it and relational DBs, although most of the little I used to know I have already forgotten. I was browsing some job adverts and quite a few had C# and SQL as requirements when work related to DBs. Is C# suitable general programming language when working with databases or should I move on quickly studying some language specially meant for DB after learning the basics of C# ?
vento is offline   Reply With Quote
Old 04-22-2012, 06:52 PM   #10
centurion
 
thunderchicken's Avatar
 
Join Date: Mar 2009
Posts: 197
Re: Most practical programming knowledge

Quote:
Originally Posted by vento View Post
A question relating to this topic. I have started to learn C# as my first programming language and will start studying SQL as well later this year. I remember faintly a few things about it and relational DBs, although most of the little I used to know I have already forgotten. I was browsing some job adverts and quite a few had C# and SQL as requirements when work related to DBs. Is C# suitable general programming language when working with databases or should I move on quickly studying some language specially meant for DB after learning the basics of C# ?
It really depends on the job. Some jobs will have a dedicated DBA that will help you write queries and will optimize the company's database. You can get tools to do the basic CRUD (Create Read Update Delete) portion which is typically most of the C# database type code you'll do. The real tool in learning anything database related is finding performance issues, like, why is this query taking 10 seconds, when it should be taking 1.
thunderchicken is offline   Reply With Quote
Old 04-22-2012, 11:24 PM   #11
Carpal \'Tunnel
 
Join Date: Sep 2002
Posts: 15,484
Re: Most practical programming knowledge

To OP, the title of your post should read

Most practical programming knowledge in order to be able to work on more dynamic websites with AJAX/etc.
adios is online now   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 11:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive