Skip navigation

The screenshot below shows the top half of the code of the User.php file. The User.php file represents the users table in the database, and its business logic. Baiscally, it represents a user. You can’t see any of the actual coding but you can see the structure of the page 🙂
Near the top of the page you can see a weird structure. That’s actually one large array declaring an HABTM (has an belongs to many) relationship with another table, and another large one declaring the validation rules of form fields.
I use the lightweight Notepad++ text editor, which has a nice feature where you can hold down CTRL and use the mouse wheel to zoom in and out. It’s nice for seeing the overall structure of the page. I also use it to make the font larger when I start to get eye strain.
code scroll

code scroll

EDIT: I want to show you one more thing. Here below is another screenshot of the bottom half of the same page. The part highlighted in the gray is the search method that searches for other penpals based on search criteria input by users. Notice how large the method is! (this is a bad thing)

big method

big method

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: