|
FrontLine posted:I wrote this short program as a cheap excuse to mess around with Python a bit more (only started learning about a week ago) and to screw around with VIM. Just wondering if there's any stupid newbie mistakes I've made or things I should watch out for. Considering it's pretty short I think I'm safe but just to be sure... After a quick once over (I've not tested the program) the first thing I noticed was the lack of input validation. For example, when asked how many images I want to download I type 'five.' what happens?
|
# ¿ Feb 23, 2008 17:34 |
|
|
# ¿ May 4, 2024 17:56 |
|
trashmatic posted:There is no excuse for a professor to be showing code like this in an intro class. The rest of the program is pretty bad, too, but drat..... To be fair it does say in the code comments at the top ## 1st look at USAGE OF FUNCTIONS AND SUBROUTINES (THAT WE CREATE): ## FUNCTIONS WITH NO PASSAGE OF PARAMETERS ## (notice the parenthesis with no variables inside) I can still remember attending required basic programming classes in python when I'd already taught myself C. In all seriousness some students *really* struggled with functions after writing simple python programs without them. It wasn't until they'd grasped functions and parameter passing that the whole "don't use global variables" stuff was introduced.
|
# ¿ Feb 26, 2008 20:31 |
|
deimos posted:or you can browse django's source and grab SortedDict. Though they're still having issues, I believe the ordering of dicts is what causes the following lovely bug (I believe): http://code.djangoproject.com/ticket/4193 http://code.djangoproject.com/ticket/6374
|
# ¿ Feb 28, 2008 20:56 |