KillerSites Blog

Stefan Mischook

Book Review: Spring Into PHP 5

July 19, 2006

Not a bad book for people who have a little PHP knowledge … but if you are a total programming novice, you will need to get another book … or better yet, my php videos for novices! I don’t usually plug my own stuff … but what the heck.

The thing that stands out for me, is the way the author is able to cover various PHP topics in a concise manner. He has also chosen topics that I think would interest most PHP programmers – they are practical.

Some highlights:

  • The section on string manipulation is very good.
  • Great coverage on the powerful sprintf function – something you don’t see often.
  • HTML form processing (chapter 5) shines.

My only complaint:

… though the book says that all you need to know is HTML, this is clearly not the case. Most web designers will have problems if they try to tackle this book from scratch.

Final comment:

If you have a little PHP background, this is a good book to get. I’m happy to have it on my nerd-book shelves.

read more

Why do web designers need to learn to program?

July 15, 2006

Killersites.com was first made famous about 10 years ago (1996) when it taught web designers to use design principles when building websites.

In those days, dancing mice and ‘under construction’ animated gifs were common …

Years later (2002-2003,) web designers started to become very aware of the importance of good code, separation of styling (CSS) from structure (HTML/XHTML), usability, accessibility etc…

This may be surprising to some (who may be new to web design) but before then, most web designers barely understood HTML!

WHAT IS THE NEXT STEP?

Today I think the next challenge for web designers, is to learn to program.

I know, I know … many of you are probably have a 1000 reasons why you have no need, and no interest in learning a programming language like PHP or JavaScript.

But consider these few simple points:

  • Learning even a little programming will open you to a whole new world of possibilities with your websites.
  • Learning to program will teach you to think in new ways that can have great benefits in all aspects of life.
  • Learning to program will improve your understanding of web design – it will deepen considerably.

Besides what is listed above (with each being reason enough,) learning to program will give you a very marketable skill … you’ll be worth more!

MY GOAL

I’ve been dancing around the whole programming thing for a while with: the occasional article, video or podcast.

I’ve been slowly ‘priming’ you guys for the big move … the move into highest level of nerdom: programming.

My goal is to teach total non-nerd and artsy web designer types, how to write PHP. Not theoretical stuff; useful PHP that you can use in your own web projects.

Don’t worry, I am going to take it slow and do everything in my power to avoid nerd jargon. Or as I like to call it: ‘nerd-speak’.

KILLERPHP.COM LAUNCHED

To get the ball rolling, I’ve created what I call a ‘micro-site’ – a website dedicated to one narrow subject.

In this case, www.killerphp.com is dedicated to teaching web designers (not programmers) how to create database driven websites with PHP.

read more

WHAT ARE DATABASES – PART 1

July 3, 2006

WHAT ARE DATABASES?

Databases are programs that are built to store and manage information. You can think of a database as a virtual filing cabinet – with extra bells and whistles.

Types of databases:

There are several types of databases used today. The most common being:

1. Relational databases.
2. Object databases.
3. Flat file databases.

You can think of each type of database as a different way (conceptual and practical) to store and manage information.

Each type of database has its advantages and disadvantages. That said, by far, the most popular database type is the ‘relational database’. That’s why we concentrate on them here.

WHAT ARE ‘RELATIONAL’ DATABASES?

As I hinted at above, each database type has a different concept on how data/information should be stored and organized.

A relational database stores (and organizes) its data/information by creating relationships between different pieces of information (stored in virtual containers) that are … uh, related to each other.

To illustrate the point: if you had a brother, your mother would be the ‘key’ that forms the relationship between you and your brother.

With this analogy in mind, we can say that a relational database stores and tracks data by establishing relationships by using ‘keys’ (in this case, your mother) that are consistent between two pieces of information – you both have the same mother.

Popular relational databases include:

· MySQL (often used with PHP because it’s free)
· Oracle
· Microsoft SQL Server

WHAT ARE VIRTUAL CONTAINERS?

We all know that it’s much easier to store and find stuff/things (in your home) if you put the stuff into boxes and then label the boxes … much better than just leaving all your junk on the floor.

Though naturally a messy bunch, nerds have picked up on that fact, and realized that computer information should also be stored in boxes (virtual containers) that are labeled. In a relational database, we call these ‘boxes’: tables.

In a nutshell: the virtual containers in relational databases are called ‘tables’ and information is stored in tables.

MORE ABOUT TABLES

Database tables are virtual containers designed to hold and organize data. In many ways they look like spreadsheets where database tables have both rows and columns.

The difference between a spreadsheet (like Excel,) and a relational database table, is that the spreadsheet is designed (has built in capability) to manipulate data for the purposes of presentation – creating charts and reports etc.

Where on the flip side, a database table is designed (has built in tools/capability) to organize and maintain information and it can hold much, much more information than a spreadsheet.

So yes, you can store information in a spreadsheet, but it lacks many capabilities (and capacity) that you would find in a database.

We will learn more about the makeup of a table (purpose of the rows and columns) when we actually build one.

THE ‘RELATIONSHIPS’ IN RELATIONAL DATABASES

As I mentioned above, a relational database stores information in tables (the virtual containers) and then creates relationships/connections between the tables (and thus the data that is stored in the tables.)

This system/method of storing information (by creating relationships,) is efficient because of a few reasons; the most important being is that this style of storing information (in tables that are related to each other,) helps to prevent information from being duplicated needlessly.

A FUNDAMENTAL PRINCIPLE OF DATABASE DESIGN

One of the fundamental rules in database theory/design, is that information should not be duplicated:

… if you have multiple copies of the same information floating around, it takes up more disk space and can easily become a nightmare to organize.

By storing information in different tables, and linking that information to each other (that are related,) you avoid duplicating information. This will become clear when we actually build our first database … I know (that for now,) many of you are probably unclear about a few things … have faith, it will come!

Part 2 coming out soon …

Thanks,

Stefan Mischook

read more

PHP Videos and new website.

July 3, 2006

I hope all the American readers are enjoying the 4th of July holidays – happy holidays!

On to things nerd-like: PHP

I’ve managed to put out another video on PHP for you guys. It’s longer than the others (19 minutes) and it goes into getting your computer set up for learning PHP.

Because I am gearing up on PHP (don’t worry, we have the cool gang on the forum taking care of the HTML and CSS questions,) I decided to set up a new site specially for PHP. Naturally it’s called:

www.killerphp.com

Ok, not too original but I figure it fits.

FLASH ACTIONSCRIPT VIDEO

It has been a long time in coming, but finally, we have our ‘Killer Flash ActionScript’ video!

This video continues from where we left off in the first flash video and leads us into the true power of Flash – the scripting / programming. I should have several samples out this week.

You might have noticed a general trend here at killersites.com -> programming. I believe that every web designer (and soon everyone,) should learn to program .. at very least, some basics.

It is such a powerful tool to own (programming that is,) that I figured we would tackle it from both the PHP and Flash perspective. More on that later.

Let me know what you think of the videos!

Thanks,

Stefan

read more

Book Review: AJAX Hacks

June 25, 2006

A collection of AJAX hacks (recipes) coupled with intelligent discussions. A good book to buy for anyone interested in AJAX and modern web application development.

The book begins with a great introduction to AJAX and then provides a useful grab-bag of commonly needed AJAX applications.

For example:

  • Processing Web forms.
  • Validations: credit card numbers, email addresses etc …

What are AJAX ‘hacks’?

AJAX ‘hacks’ are concise code samples that can be used as ‘components (if you will,) that you can plug into your own work.

Besides the usefulness of having a reusable collection like this, you can learn a lot from the ‘hacks’, since each one is coupled with a good discussion.

Some highlights:

  • Ruby on Rails and AJAX discussions
  • Examination of the open source AJAX libraries like Scriptaculous and Rico.
  • The concise and clear coverage of AJAX basics.

As with all O’reilly books, the writing is clear and concise and well presented.

Note: this is not a beginners tutorial … you will need to be able to work with and understand JavaScript.

read more

Book Review: Programming PHP 2nd Edition

June 23, 2006

Co-written by the guy who invented PHP (Rasmus Lerdorf,) this is a must-buy book for anyone getting into PHP or web programming in general.

What can I say; this book is so well written and to the point, that I found that the information seemed to just flow from the pages.

Who is this book for?

This is not a book for someone just learning how to program; it is for everyone else though.

Both programmers new to PHP, or PHP programmers with (at least) a basic understanding of PHP, will find this book to be very handy to have around.

The book does not try to cover everything about PHP… though it does cover things like:

  • graphics
  • xml
  • pdf
  • databases

… instead it gives the best coverage of the core language I’ve ever read.

Buy the book.

read more

Book Review: Beyond Java

June 23, 2006

A small book that takes a critical look at Java and other languages (Ruby, PHP, ) at a moment in time.

I say ‘at a moment in time’ because this book will lose relevance very quickly – even more quickly than the typical nerd book.

In a nutshell:

  • You get a brief history lesson on languages and their problems.
  • You get a perspective of the problems that Java developers face.
  • You get perspective on the subject from interviews with several big-wig names in the field.
  • You get an overview of Ruby and Rails.

My complaints:

  • The author likes to introduce his chapters with kayaking stories that are suppose to reflect what he is about to talk about … I would just skip those parts because I am not into kayaking.
  • Question of accuracy: he mentions (page 174) that PHP does not have enough structure. This is a silly statement given that there are SEVERAL PHP frameworks out there that provide the exact same structure as Rails – some even copy Rails.

Conclusion:

I liked the book and it was a worthwhile read. It has a few problems but it does open your eyes to things.

That said, the title of the book should have been: ‘Beyond Java and why I love Ruby’.

read more

Book Review: Ruby For Rails

June 23, 2006

Ruby For Rails connects the dots between Ruby and Rails.

In a nutshell:

This book looks at how Rails uses Ruby, and in so doing, you learn a heck of a lot about Ruby programming.

Ruby For Rails goes into detail about basic Ruby, enough so that I think someone new to Ruby, could learn enough about the language to be able to build web applications. But, the book is not a comprehensive Ruby reference – there are things that are not talked about.

The thing I really liked about the book, is the way the author introduces a concept and then shows you how Ruby or Rails implements that concept in a practical application.

For example:

You are introduced to a Ruby construct called a ‘module’*.

  • You learn what a module is.
  • Why Ruby has modules.
  • How Rails uses modules and why.

I am glad to have this book and think anyone interested in learning Ruby and /or Rails, should get it.

* Ruby modules are programmatic constructs that are like classes (they have methods and constants,) but they are not directly instantiated like a true class.

Instead, modules are created to be inserted into to classes or objects to give the host class or object the extra functionality. Often modules are referred to as ‘mix-ins’ because modules are mixed in to classes.

read more

Spamtaculous-spamming clogging my blog!

June 21, 2006

I have to tell you, that this blog spamming is really getting out of hand – I even get dozens of Chinese spam clogging my blog every day. In total, I must get 200 / day!

Besides being annoying, blog and message-board spamming are next to useless, in terms of promoting websites …

Will they ever learn?

Answer: No.

There must be a way to fight back as we did against email spam. But how can we mount a counter-spam-attack on the spammers?

Geocities Jerks

One common tactic for spammers is to set up Geocities websites and then try to get people to visit them … Geocities has to come up with some better policing of their system.

read more