Tip:
Highlight text to annotate it
X
A final question we've had is about project management and keeping your code
somewhat manageable and not into a crazy ball.
Sure, sure.
The code I've been writing--ASCII Chan and whatnot--actually resembles a crazy ball,
which is fine when you're starting out, but as your project starts to grow,
yes, you need to add some more organization.
I generally have a directory with all my templates in it.
I have another directory that'll have all my static files--my CSS, my JavaScript.
In this class, I've given you the little bit of CSS that we've used.
Then the rest of the Python files, I generally have one main file that is my controller.
It's basically the URL mapping and then the classes that those URLs map to,
what their basic handler is.
I try to put all of the database stuff in a separate files.
If I have a datatype for--in ASCII chan we have a datatype for art.
That would be in its own file that has a functions related to art.
I generally have a utilities file that has things like generating random strings
and creating hash values and secure values and all that stuff you're going
to see in the next lecture.
Just like when you're organizing any large programming project,
pulling things apart. It's easy to pull things apart into separate files.
Sometimes you get some weird dependency issues with tricky imports--
one file depend another, depends on the same file.
That generally means you did something wrong.
But you'll kind of learn over time how to structure things so it makes sense.
Lots of files is good. It keeps things clean. It keeps each file sane.
You know where to look for things and that sort of problem.
In the class, however, I've been working in the same file so you can see it all in one place,
but if the projects were getting much bigger than what I was working on now,
I would and I would encourage you as well to start separating things out
and organizing them a little bit better.
Okay. I think that's about all the questions we have for this time.
Is there anything else you want to add on at the end?
Just a quick thank you to everybody in the forums who has been helping us out,
explaining things. I know the permalink thing was tricky for a lot of you.
A lot of that is my fault so those of you who figured it out or already knew
what I was getting at, thank you very much for explaining that. It's been really helpful.
And thank you, Sean, for hanging out in the forums and keeping things going smoothly.
It's really helpful. This is my first time teaching a class.
I'm kind of learning along with you guys what works and what doesn't.
I think we're starting to trend in the right direction.
It's been pretty fun so far, and I think you'll enjoy Unit 4. That was one of my favorites.