Earlier quoted context omitted.
I have programmed literally hundreds of thousands of lines of python without using classes or __metaclass__, as a counter example. When dealing in industry, we can't always hire the best talent, so there is no need to make things overly complex. Simple solutions work best for a lot of scenarios, and I haven't been limited by it yet. Not to bash Perl, but the whole reason we write in Python is because there were too m…
Don't blame Perl. Blame the programmers and your methodology that allowed them to do that.
Zed finishes Learn Python The Hard Way
101–110 of 115 posts
Re: Zed finishes Learn Python The Hard Way
#102Earlier quoted context omitted.
Is there a tutorial on learning simple one liners like this? I find myself frustrated after seeing simple and obvious solutions like the above, but can never bring myself to code them as such.
http://learnyouahaskell.com I'm only half kidding. The best way to get used to using functional concepts is to actually use them in their native setting, and then apply ( giggle ) them elsewhere. When you _have_ to solve problems this way, at some point, it clicks.
I can say that it has indeed improved my Python scripting as well.
Re: Zed finishes Learn Python The Hard Way
#103Very nice. I just randomly choose to view the arguments unpacking section and found a defect (no example given on pg 36 for passing in only two args instead of all three, but later cited as "see how I passed in two args"). Created a ticket.
Thanks, I think I fixed it but the ticket is kind of vague: http://learnpythonthehardway.org/tktview/08a86ff3098eae91d8c... Update it for me if I didn't understand what you think should be done.
python script.py only two_args
Just the traceback. It might be confusing to a newbie.Re: Zed finishes Learn Python The Hard Way
#104Earlier quoted context omitted.
You can always delay fixing a social problem by switching technologies.
You’re implying that language syntax is primarily technical rather than social. I’m not sure I can agree. The reason that Python code uses standard idioms most places you go is that the larger-scale Python community is committed to quite a different set of social norms than the Perl community. Pulling in that language-community momentum can definitely make a difference to the social/technical dynamics inside a smalle…
... if you have multiple developers who cannot or will not find some way to write maintainable code, you have a problem independent of language.
I've maintained some hideous code written by people who had no business being professional programmers. In every case, adhering to a handful of very simple rules would have improved their code dramatically. Only one case needed a language change, and that one was away from a proprietary 4GL.
Re: Zed finishes Learn Python The Hard Way
#105At the end of the day, it's not about functions or closures or monads. It's about building something interesting or useful. Whether you used php or arc is not relevant.
Re: Zed finishes Learn Python The Hard Way
#106The last chapter (Advice From An Old Programmer) is very thought-provoking and slightly unnerving for someone who is studying CS
It's a lovely chapter! Thanks for pointing it out. Programming as an intellectual activity is the only art form that allows you to create interactive art. ... . The world needs more weird people who know how things work and who love to figure it all out. It's inspiring to see him talking about the beauty of (software) engineering as a means of making which has the quality of an art.
Programming as a profession is only moderately interesting. It can be a good job, but if you want to make about the same money and be happier you could actually just go run a fast food joint. You are much better off using code as your secret weapon in another profession.
People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines.
I have always had the suspicion that this is the case but now I have some validation
Re: Zed finishes Learn Python The Hard Way
#107Re: Zed finishes Learn Python The Hard Way
#108I am learning python through this book at the moment. It is my first attempt at learning to code, so I have nothing to compare it with, but I must say that this book is very good. My only gripe is that he poses certain questions/exercises that he fully expects us to solve, one way or another. But if we cannot; we're screwed. He does not give the answer. It has only happened once so far, but that was enough for me to…
Hey, can you tell me which ones you got stuck on? I can try give a bit of help either here or in the book. One thing about those though is that if you can't complete them, then just move on and maybe mark it for later. You should try to figure them out for a bit, but sometimes you just can't and have to come back to it later. Finally, make sure you have this latest version of the book. I added a small section in the…
Example: http://stackoverflow.com/questions/3391998/pydoc-is-not-work...
Re: Zed finishes Learn Python The Hard Way
#109Unless I'm mistaken there's no chapter about functional programming in Python (lambda functions, filter(), map() and reduce()). I really think it's acceptable to introduce these function to newbies, I'll go as far as saying it's actually a good thing. I like the chapter on automated testing.
The Python community has frowned on functional programming, reduce isn't in basic Python anymore, and they almost took out lambda: http://www.artima.com/weblogs/viewpost.jsp?thread=98196
It's in a module in the standard library, a module which contains a bunch of tools for working with higher-order functions. Or, in other words, if you've got a Python 3.x installed, you've got a reduce function available. The only difference is that it's no longer in the default global namespace (map and filter still are, of course).
This matches up pretty cleanly with my actual experience of writing Python; I've written a hell of a lot of Python code these past 6-7 years and so far as I can recall I've never used reduce.
(and if you want to get picky about this, keep in mind how much of Haskell requires import statements to get at -- moving less-commonly-used stuff into standard modules is not a bad thing at all)
Re: Zed finishes Learn Python The Hard Way
#110Mongrel 2 and now a book on Python. The man is a machine.
I keep meaning to write some kind of blog about this, but I call it "time opportunism" as opposed to "time management". That's the best name I could come up with for this thing I do that keeps me creative and flexible yet still getting things done. In a nutshell, I quit trying to explicitly plan and organize my life (not that I was any good at that) and instead I have a giant bag of things I need to do. There's usual…