

Help - Getting started with coding web apps - bjoernw

I am sure you get this often so I apologize. I want to get into coding my own web applications. I know html, css, and have taken some stabs at learning php. My problem is that all of the tutorials are so abstract and I don't see how I can apply some of the basic stuff. So my question is: What programming language should I be learning to write solid web apps and where could I find some resources for beginners that help me apply the basics.<p>This newbie appreciates the help.
======
cschwarm
As a hobby programmer I had the same problem some years ago. IMHO, any
programming language currently used to write web apps enables you to write
"solid" web apps.

But I am wondering why you find all tutorials to be "abstract" although you
already looked into some PHP tutorials. PHP has a very flat learning curve and
there are tons of easy newbie tutorials out there. It's PHP's biggest
advantage! One can hardly call PHP consistent or concise. But its
documentation and general support is best. So why should you have problems?

After all, programming is very much all about abstraction, isn't it?

Let's say, there's a web site with 10 or 20 static pages. It's "abstraction"
to replace their common header and footer by a simple PHP print statement, so
you wouldn't have to edit each page for one change in the header/footer. It's
abstraction to save the content of each page into a database and to add some
sort of dynamic navigation. It's abstraction to design the database for "news
entries" that will be displayed in a list or a detail view.

So I may be wrong -- and I apologize in advance if I am --, but maybe you
simply lack some basics?

In this case, I'd advise you to start with Python. It's a consistent, concise,
and well-supported language. A series of steps may include:

(1) Learning Python: <http://www.ibiblio.org/obp/thinkCSpy/>

(2) Learning DB normalization:
[http://www.databasejournal.com/sqletc/article.php/1428511/Da...](http://www.databasejournal.com/sqletc/article.php/1428511/Database-
Normalization.htm)

(3) Learning basic SQL: <http://en.wikipedia.org/wiki/SQL#Language_elements>

(4) Learning Regular Expressions:
<http://en.wikipedia.org/wiki/Regular_expression>

(5) Learning Django 1.0: <http://docs.djangoproject.com/en/1.0//>

After (1), you should be able to write simple command line apps to help you
simplify computer usage. (2) is necessary for understanding Relational
Databases and (3) for understanding SQL, later. (4) is a prerequisite for the
final step, (5). Django is a web development framework comparable to Ruby On
Rails.

From a newbie point of view, it has the following advantages: It comes with
its own small web server, so you don't need to deal with Apache yet. It also
comes with a template engine, so you learn to organize HTML into templates. It
also comes with database abstraction so you need no real SQL in the beginning,
just the basics of step (2) and (3). It also comes with an admin interface and
several other build-in features so you don't need to deal with these. It has
lots of add-ons called 'apps' you can study to gain a basic overview on
typical problems when developing web pages.

Django uses an MTV (Model, Template, View) architecture, so you can write CRUD
(<http://en.wikipedia.org/wiki/Create,_read,_update_and_delete>) functions
easily -- the core stuff of nearly all dynamic web applications.

But there are also some disadvantages: Its URL system needs an understanding
of regular expressions, thus you'd need (4). But it still may be frustrating.
Its documentation is rather good, but unfortunately not written with web
development newbies in mind. That especially holds true for "Tutorial: Writing
your first Django application".

To get around the second problem, read the following chapters in the following
order:

(1)
[http://docs.djangoproject.com/en/1.0//intro/install/#intro-i...](http://docs.djangoproject.com/en/1.0//intro/install/#intro-
install) \-- Installation

(2) <http://docs.djangoproject.com/en/1.0//topics/http/urls/> \-- This will
enable you to link URLs to certain "views" and thereby to design your URL
structure. You will need some understanding of Regular Expressions here.

(3) <http://docs.djangoproject.com/en/1.0//topics/http/views/> \-- This will
enable you to write "Views", a response for a URL call, in the beginning
probably just a "Hello, World" response.

(4)
[http://docs.djangoproject.com/en/1.0//topics/templates/#topi...](http://docs.djangoproject.com/en/1.0//topics/templates/#topics-
templates--) Templates will allow you to split your HTML into separate pieces
and make them more independent. If you have done this, you can alter the
responses from (3) to use the templates and return the content of variables.

(5) <http://docs.djangoproject.com/en/1.0//topics/db/models/> \-- This allows
you to model your data, for example some news/blog entries.

(6)
[http://docs.djangoproject.com/en/1.0//ref/contrib/admin/#ref...](http://docs.djangoproject.com/en/1.0//ref/contrib/admin/#ref-
contrib-admin) \-- This enables the Admin interface so you can enter some
example data for your models without SQL.

(7) <http://docs.djangoproject.com/en/1.0//topics/db/queries/> \-- This
teaches you make simple queries on the example data. At this point, you can
alter your Views again, to fetch some data and display this in your template.

(8)
[http://docs.djangoproject.com/en/1.0//topics/forms/#topics-f...](http://docs.djangoproject.com/en/1.0//topics/forms/#topics-
forms-index) \-- This lets you enter and edit data without the admin
interface. You may add some Views and Templates for this.

And there you are! That's the basics of web development: Fetch some data from
somewhere, maybe modify it somehow, then provide views on the results by using
a URL structure. Maybe, provide forms to enter and edit data if necessary.

The rest is basically just repetition thereof and some technical details
(Protocols, etc.) Most of the time, Django will provide an easy means to solve
these boring problems. If you got this far, you can dive into all the details:
Apache, SQL with PostgreSQL, Email, Feeds, User management,
Internationalization, Testing, different Content types, etc.

Of course, you may also switch the framework or language, then.

Again, I apologize if I misunderstood your question.

~~~
bjoernw
Thank you so much, I will dive right into this.

------
ideamonk
"What programming language should I be learning ..." Well working over a
problem is best way to learn and understand. Instead of aiming to learning a
programming language or something more, try applying the knowledge you already
have and come up with a small web-app that does something (anything! small or
big). As you walk this path of learning by doing, you will learn a lot more
than you might think you've learned after reading a book. Keep a tap on good
tutorials and inspirational articles - try shmashingmagazine, nettuts,
psdtuts, thinkvitamin... etc

After done with say, PHP also try getting a taste of MVC, try CodeIgnitor...

I notice no mention of MySQL or other databases mentioned by you.... do learn
them too, after all you would be playing around with data :) presenting it in
different ways.

------
SingAlong
PHP is a good start to take a stab at web dev. The fact that many web hosts
support it also means that hosting is cheaper for you go out and try
something.

Since you are starting out I would suggest you to write a couple of small
webapps before you go for the one you are into. I do this for every new
language I learn and it's helped me a lot. Just reading thru a tutorial
totally different from doing it and getting first-hand experience, especially
if you are going to work with Python and Ruby for webapps.

I had a odd but great experience when I first learnt PHP, that was around 4yrs
ago. Every time I did something, I found there was a better way to do it and
the PHP documentation on the website is great (and the comments for every page
on the docs)

And also learn Object Oriented stuff in PHP. Learn to use classes and objects.
This opens up a whoile new shelf of resources for you. Coz then you can start
using classes that others have created for specific tasks. phpclasses.org has
a pretty huge database of classes. Also as you go, just get started with using
an MVC. Use CakePHP (I use it and its good) or CodeIgniter or Kohana (as many
here suggest often).

I suggested PHP coz it also saves you the pain of learning how to deploy your
app. For PHP it's pretty straight forward, just upload the files and it works.
Good for starters.

P.S: Don't listen to me. Just do it your own way. Coz that's what you'll do
anyway. It's never possible to follow suggestions/rules, like a sworn monk.
And that's how you'll enjoy learning :P

~~~
ideamonk
"Don't listen to me. Just do it your own way. Coz that's what you'll do
anyway. It's never possible to follow suggestions/rules, like a sworn monk.
And that's how you'll enjoy learning :P"

That's true :) <http://www.satisfice.com/blog/archives/27>

------
safetytrick
I think its more important to find a starter application or site that you care
about. If you are interested you will find a way to make it work and learn the
language along the way. I ended up learning a lot from my first site,
scrapping the whole thing and rewriting twice. I think that's just how it
works. Find an idea that you care about and make it work.

