tags:

views:

740

answers:

10

I began learning Python with Dive into Python(I read some chapters), then I switched to Django using The Django Book and the Django Documentation. I made a simple web app, It worked fine but the code was a total mess.

In order to improve my skills I began reading and coding the projects of Django Practical Projects (I've recently finished the weblog).

Now, my plans are: 1) finish the apps of DPP - finish Dive into Python 2) read/code "Beggining Django E-commerce" 3) learn Javascript and some CSS 4) start my own project

I have doubts if this is a good path to follow because I don't catch all the concepts of the books by reading/coding along. Perhaps it would be better to start my own project right away, and learn by practice.

What do you thing guys?.

Thanks for your time, mF.

+2  A: 

I think that you've read a lot of very interesting stuff and now it's time to start your own path. Feel free to ask on SO when you have a question

luc
+7  A: 

From your position, the best way to learn would be trying to make something that you've always wanted to make, but didn't make it before.

I wouldn't worry much about learning CSS/Javascript. You can learn those as need-to-know basis while working on your project. Modern javascript frameworks like jQuery make client side coding really simple.

Imran
+1  A: 

Dive Into Python is a great start for learning python, although you can get pretty far in django without knowing much python.

After you've read http://djangobook.com/ and went through the original tutorial there isn't more left for you to do outside of working on your own project and learning as you come up with new things.

I think most people learn faster when they are enjoying what they are working on and its hard to really be emotionally invested in small tutorial applications.

I suggest you just get hacking on your project and come here to ask questions on problems that arise while you are coding :)

sontek
Thank you all for your answers. I would like to make a social network, something like sportsvite. Do you think I should begin with this kind of project or it's better to chose a simplier project?
mF
A social network is about people, not programming. It’s a great challenge, but I’m not sure it’ll teach you much about programming or solving problems.
Paul D. Waite
With django you can start with a social network, check out the Pinax project, which is everything to build a social network already.
sontek
+7  A: 

Make a project for yourself, try something that is not in the book. This will give you some real life experience, let you make yours the concepts you've learned, stumble on real-life problems. Books are good to begin with, but you've got to jump in at some point.

You could also play with tools that use Python/Django. For example, Google's AppEngine lets you use Python and Django.

Raphink
+2  A: 

The best kind of learning is learning by doing. Try to start your project. If possible, choose a small part to deploy first just to keep you motivated. If you get stuck somewhere:

  1. Search Google
  2. Go back to the reference sites that you have already found
  3. Ask SO :-)
jbochi
+4  A: 

"Perhaps it would be better to start my own project right away, and learn by practice"

This is what you are already doing. It's what you are doing right now.

"It worked fine but the code was a total mess."

This is the results of doing what you are already doing.

Why would this change? Any reason why continuing to do what you are doing will lead to better results? Any reason at all?

If you don't like the results you're getting, you have to change what you are doing. You cannot continue attempting to "learn by practice". If your code is a total mess, then you aren't learning the things you think you need to learn.

So stop this "learn by practice" and do something different.

You'll need to start reading (and understanding) existing well-written code as well as reading books.

S.Lott
+4  A: 

Learning by practice is essential. You won’t know how to write an application until you’ve written a few badly.

But learning by reading is also essential. Once you’ve made the mistakes, knowledge from others will show you ways to avoid those mistakes.

If you’re writing Django apps, you need to have a good understanding of Python on its own. Django is written in Python, and was intended to embody its authors’ interpretation of Python’s principles.

  • Learning Python by Mark Lutz is a great, comprehensive guide to the language itself.

  • Make sure you finish Dive Into Python as well, that’s great too. (There is Dive into Python 3 for the next version of Python, but I don’t think Django has a migration path to Python 3 mapped out yet, so it’s probably best to stick with Python 2 for now.)

  • Code Complete (2nd Edition) is a great, comprehensive and language-independent guide to better programming.

Paul D. Waite
I'm learning Python right now and I found these links really helpful. Thanks!
Liam
Aw, you’re very welcome. Best of luck learning Python — I kind of envy people who are picking it up now, learning it was one of the more enjoyable experiences I’ve had in computers.
Paul D. Waite
+2  A: 

There are a few ways to be able to write clean code:

  1. Ask

    If you have a piece of code that you think could or should be written better, don't be afraid to ask for help. Put your sample of code up on a website (like stackoverflow) and ask "Can this be done better?" This has helped me out on numerous occasions.

  2. Quality Education

    Something that has helped me out the most was to get a quality education. The data-structures course I took in college helped me tremendously in becoming a better coder.

  3. Research

    Looking at other people's code is another way that can get you into a better frame of mind to write cleaner code.

kzh
+1  A: 

Have a look at one of the library modules (python's difflib.py is nice, I don't know any good django modules but the sessions module looks promising) and try to figure out how they tick.

Look at the tests (and write a couple of additional tests yourself), draw up the architecture, see how the sessions module is used by Django, and maybe add some new functionality if you can.

wisty
+2  A: 

For your question, How to learn to program, the Truth, I have found is as follows,

Use git, branch, try new stuff, don't worry about screwing up. In fact, screw it up. Get stuff to work. Understand that you code is bad, read up on how to do that better, browse through github to find patterns to do that. For Django, Read James, Uswaretech, Ericholsher, Very own SO, Alex Gaynor and the entire community, and refactor your code in a different branch. Also make it reusable and put it up on Github. Repeat.

Lakshman Prasad