

How I Learnt enough Python/Django to be Dangerous in 1 Month - eddy_chan
http://eddychan.com/post/15775730174/how-i-learnt-enough-python-django-to-be-dangerous-in-1

======
ca136
Nice post, I was in the same position about a year ago. It feels really good
when you get to the stage when you can launch a project, which doesn't take
very long with Django.

After a few months of working with Python/Django I realized how much else
there is to learn and how shitty my first attempts really were. I keep going
back over my old scripts every time I learn something new to see if I can
improve the code. It's sometimes depressing thinking about how much there is
to learn, but the power to create whatever you want is totally worth it!

------
j_baker
I realize that the author is probably joking in saying they "learned enough to
be dangerous", but I think it's worth pointing out that you can't really learn
enough Python to be dangerous. That's one of the nice things about it. If you
screw something up, it will let you know (albeit not necessarily as soon as a
more strongly typed language would).

My advice: stop worrying about being "dangerous", and be bold! Experiment with
any wild ideas you have and see if you can figure out a way to implement them
in the language as well as (or perhaps even especially) the libraries that are
included with the language. When you bring on a "real" programmer, they may
want to kill you, but that's how you learn. Plus, if you're really _that_ bad,
you probably won't have written enough code to make that programmer's life
miserable for long.

~~~
tswicegood
As long as you can `import os`, you can be dangerous in Python. :-)

~~~
j_baker
I would be curious to see an example of such dangers. It would certainly take
a lot of effort to do something stupid in such a way that your program won't
necessarily crash with an exception (I'm thinking things like segfaults, heap
corruption, etc). I don't doubt such a thing exists, nor do I doubt there's an
idiot out there who can exploit it, but I think the vast majority of newbies
out there are going to be more fascinated by other parts of the standard
library. Did you know you can make HTTP requests using urllib2? Or that you
can open a web browser using webbrowser? Or have you seen Django's automatic
admin interface? How cool is that?!

~~~
frankwiles
I know Travis and yes he knows those things.

What he means by "being dangerous" are things like os.remove(),
os.removedirs(), os.chmod(), etc. He wasn't talking about crashing your own
Python code, but being able to do dangerous things to the OS you're running it
on.

~~~
Ixiaus
Why is that anymore dangerous than knowing how rm, rmdir, and chmod work on
the commandline?

Python's os module is not exempt from permissions - it's obviously "dangerous"
if you run the interpeter as root then start doing silly things like passing
GET parameters to os.remove() directly... But that, IMHO, is no longer
dangerous - that's just stupidity.

Really, there's nothing remotely dangerous about Python - in terms of using
import os (excluding the above example which I consider idiocy), it's no more
dangerous than elevating to root!?

[EDIT] I would argue that _not knowing_ how something works is more dangerous,
but that typically falls under the banner of ignorance.

~~~
jerf
"Why is that anymore dangerous than knowing how rm, rmdir, and chmod work on
the commandline?"

To screw up is human. To screw up a million times per second takes a computer.

In absolute terms, the two are equivalent. But the capacity for your Python
program using os.whatever to unpleasantly _surprise_ you is much greater.

~~~
trafficlight
There's nothing like that sinking feeling you get when you do a DELETE FROM
and forget the WHERE.

~~~
weaksauce
That's exactly why begin transaction is awesome.

------
saltcod
I was extremely surprised when you said that you felt that there was more
resources out there for Python than for Ruby.

Not saying you're wrong, I was just very surprised by it.

It feels like there are amazing Ruby resources everywhere you turn. I guess I
hadn't clued into the Python world enough to notice.

~~~
Tobu
In my experience current Python culture takes documentation very seriously.
Popular projects like Django, SQLAlchemy, South, Pyramid, Fabric have
extensive narrative documentation (in the form of an overview, a tutorial, a
thematic guide, and finally a reference section). In contrast, I was pretty
frustrated using Capistrano and finding third-party documentation scattered
across blog posts and wikis.

This excellent culture is enabled by Sphinx, which makes it easy to publish
documentation as static html content (and pdf and epub). Hosting on python.org
and readthedocs.org makes it even easier to put great documentation online,
and it is one of the best ways to brand a project as something people can
build on.

~~~
hartror
On top of that there has been heavy use of Python for longer than Ruby.

------
crcsmnky
I'm always happy to read posts from people who've learned something new and
are excited to share it with the world. I feel like I don't make time to share
my own learning experiences.

I would love to the see the author go a step (or maybe multiple steps) further
and do some simple scale/performance testing. Essentially, how easy was it to
develop and then deploy a Django app into production? What happened when too
many requests came in? What did you do to diagnose?

Generally, I would love to see some simple performance measurement baseline to
compare experiences with diagnosing and scaling. Like a best practices guide,
maybe specific to certain frameworks of where to even begin when you're
preparing to deploy an app.

~~~
eddy_chan
I haven't got to that stage yet cos I'm still building the prototype with one
other designer. I plan to use one of those selenium based services that can
simulate a lot of requests at once. I need to do way more research here but as
they say I've gotta get the app functional first before I worry about scaling.

------
tocomment
That's a really great write up. It sounds like you were new to web programming
as well.

How difficult was it to learn the principles of web development? Did you just
learn that in the background as you learned Django?

~~~
eddy_chan
Thanks for the props, not sure what you mean by principles of web dev?

~~~
tocomment
Was it confusing to have to learn about HTTP, cookies, Javascript, HTML,
stateless servers, etc?

~~~
eddy_chan
I was a product manager for a CMS so i was already familiar with http, js but
I rely only designer cofounder to actually produce all of it, I just stick the
template variables, control flow and looping where necessary.

As for web programming practices i picked up the stuff on cookies, stateless
servers, sessions by reading up on django middleware along the way as i
started coding the app and had to add things like user registration.

------
mladenkovacevic
I'll be following your blog. I am on a similar journey but you seems to be
much more dedicated (quitting your job and all). I attempt to hack away
evenings and weekends or any other spare time I find.

Also thanks for pointing me to Django by Example. I hadn't run into that
resource before.

~~~
eddy_chan
Hehe the world is not fair. I'll be the first to admit that luck has been on
my side as i was a relatively early employee of the last startup that got
acquired. It gave me a largish 5 figure payout that's now giving me the
opportunity to devote the next 24 months to building my own.

------
mrcharles
Very awesome. I've been doing the same thing lately, except I've been building
up from very little linux knowledge at all.

But now I can set up ubuntu server from scratch, and set it to serve django
apps. Learned how from this link:
[http://blog.stannard.net.au/2010/12/11/installing-django-
wit...](http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-
and-mod_wsgi-on-ubuntu-10-04/) Which is lean enough to get me up quick, but
detailed enough to let me follow up and learn what's happening behind the
scenes.

I'm building my own model as we speak as well. I have to say, Django is pretty
damned awesome. It's worth it for the free admin interface and user system
alone. Plus as a bonus I get to continue learning python.

------
NnamdiJr
This is almost exactly the same path I've taken to learn Python/Django. Right
now I'm at where you were at the end of Week2 (stopped at Chpt8 in DjangoBook
for same reasons), and have been trying to narrow down a good next step to
help me fill-in some gaps in setting up a Django site I had in mind.

'Django by Example' seems like it's what I've been looking for, surprised I
missed it when gathering resources.

Good luck building your app and thanks for sharing, will be keeping watch of
your blog!

------
systemizer
I love this. A lot of my friends talk about creating a website and starting a
company out of it, but they are too scared to actually "code." Just the term
"code" is enough to scare them away. I wish you good luck in your endeavors
and let me know if you need any advice (I've created ~10 django websites).

------
darushimo
Thanks, Eddy. I hadn't seen Django by example before, and that's exactly what
I was looking for.

------
TDL
Good post. I'm also going through the process of learning Python, but with no
programming background. I found GOOG's class pretty straight forward (and so
far a better resource than Learning Python the Hard Way, which I was using up
to this week.)

~~~
zedshaw
Mind if I ask why you thought google's content was better and also what your
previous background was? Could you code already?

~~~
TDL
For me, not to knock your work, it was nice to see some working on it
visually. I should be much more clear here, I thought your book was very
helpful and your insisting that people actually type the code out [edit] is
very helpful. I have zero background in coding (or in any technical field.)

~~~
zedshaw
Ah, so it was the video aspect of the google course. Tell me, you watched the
video and read the code in the video, so can you think about why a video with
code in it was superior to a book with code in it? Was it the talking? The
active watching and typing? The inclusion of faces?

Thanks for your time. I also have videos but I want to redo them so they're
better. Any insight will help.

~~~
TDL
I believe it was the active watching and typing. Not sure why, but when I
watch someone actually doing something it makes more sense to me. Also,
watching very experienced people make minor mistakes removes some frustration
from the learning process.

~~~
tar
You should consider trying this (paid) video course by the author of LPTHW:
<http://www.udemy.com/learn-python-the-hard-way/>

------
brendoncrawford
Congratulations OP, and keep up the good work. Also, another good python web
framework to learn on is Flask ( <http://flask.pocoo.org/> ).

------
nachteilig
What exactly do "product guys" and "non technical" co-founders have to off to
early-stage startups? That's the real mystery to me.

~~~
3pt14159
Honestly I asked this question all the time. Until a couple months ago a
startup I know got a million dollar _grant_ (no equity). Dude spent more than
a year just continuously shooting for the stars with these applications and
finally hit.

------
caycep
i'm sort of in the same boat - i'm heavily versed in perl but would like to
learn python, if only that a lot of sci/research code is being written in it.
Is the google code course comparable or better to the tutorial on python.org?

~~~
frankwiles
If you already know another programming language I think the book "Dive into
Python" is the best way to get up to speed. Link is
<http://www.diveintopython.net/>

~~~
Tobu
Learn from <http://diveintopython3.ep.io/> which is fresher. You may end up
using Python2 due to library availability, but the differences aren't
enormous.

------
j45
Hi Eddy,

Nice post. I'm curious how many total hours did you put in during the 4 weeks?
Thinking about doing the same but I might have some time off and not sure if
you did as well.

~~~
eddy_chan
It was about 5-6 dedicated very focused hours per day, 5 days per week. I
didn't have the stamina to go beyond that each day because there's so much
learning and the mind (my mind) needed time to absorb the new material.

~~~
zack12
hey eddy, what's your background in programming? I see you have a degree in
software engineering.

~~~
eddy_chan
When I was at uni java was the language of choice for intro to programming,
basic data structures and algorithms. We used C for operating systems, C++ for
OO programming, oracle pl/SQL for databases. I wrote my thesis on formal
methods, they were very much the flavors of the day. I did touch on web
programming but we were using j2ee and I almost flunked that course. Overall I
achieved above average college student experience (which wasn't very much) in
all those things above and then I became an excel jockey at Accenture for my
first job and never coded after that

------
tocomment
Who did your graphic design, that looks nice on the blog.

~~~
joshuap
From the footer: <http://www.tumblr.com/theme/3292>

------
kenrik
The part about being "Dangerous" is either a joke or incredibly naive.

However I understand where he is coming from, it reminds me of when I learned
Objective C / iPhone. I made a decent (Read:Not Great) game in 3 months of
programming in my free time (Das Boot:The Hunt for U-505) The code was ugly
and terribly dependent but I made 3k right out of the gate and I still get a
deposit of around $50 a month from Apple 3.5 years later!

Objective C feels "easy" now and my code is clean, however it's hard not to be
humbled by what you still don't know. I have been doing a lot of
Server/Php/JSON/iPhone in my bootstrapping and it's really amazing how far
I've come.

The journey of a thousand miles begins with a single step. Keep it up!

~~~
mixmastamyk
Dangerous in the sense he knows how to break things, but not fix them. It's a
common expression for people who are getting past the beginner stage moving on
to intermediate.

There's also the dunning-kruger angle. He doesn't yet know what he doesn't
know.

