On Sat, Dec 19, 2009 at 02:51:32PM -0500, Nick Guenther wrote: > and just to add to the pyre... > > On Sat, Dec 19, 2009 at 8:38 AM, Claudio Jeker <cje...@diehard.n-r-g.com> > wrote: > > > > Ugh, a programming language where you can't copy paste from xterm to xterm > > without fucking up the program is just way to much pain to work on. > > > >On Sat, Dec 19, 2009 at 10:03 AM, Ted Unangst <ted.unan...@gmail.com> wrote: > > for many people who are a little suspicious of the whole > > whitespace thing, when your first taste of the language is hours spent > > fixing the whitespace, you aren't inclined to use it any more than > > necessary. > > Your losses then. Python isn't so much a language of recipes, it's a > language of ideas.
Oh my. A language of ideas should mean that ideas are concisely expressible in code, and that reading the code should convey the meaning. So you see an idea on the web somewhere and paste the idea into your code and it's broken? Idea fail! I like Python, but this "language of ideas" bit is silly. > On Sat, Dec 19, 2009 at 2:06 PM, Henning Brauer <lists-open...@bsws.de> wrote: > > * Floor Terra <flo...@gmail.com> [2009-12-19 19:10]: > >> > >> In my experience (mostly python and c), code that has been pasted has > >> a higher bug density. > >> > >> It's worse with Python because of the indentation (tabs vs. spaces), > >> but as a general rule I would say never copy/paste code. > > > > boo hoo. > > > > there are very valid uses of copied code, or extremely similiar code > > (copy & paste and change a few things). we have that many times in the > > tree. > > Python is about thinking about what you're doing. It's one of those > languages that forces you to work on a higher level (not that there > aren't lots of places where python is used as a scripting > language--that code tends to come out badly, but that's because it's > written just to get the job done). Python is regularly used by myself and others for scripting and it comes out just fine. Sometimes I work at a higher level and other times not, as the situation calls for. Doing things The UNIX Way(tm) means some programs are simple filters that do not benefit from large numbers of abstraction layers. Far from forcing me, Python allows me to write in a way appropriate to the task at hand. > Ideal code is abstracted code, what possible use does repeating > yourself in the tree have? I know drivers have to declare a common set > of globals and make some macro calls and various entry-points are > found by sticking to a naming scheme, but that's trivia, hardly enough > to justify "valid uses for copied code". Anytime I find myself wanting > to copy some code it's always meant I've stumbled over an abstraction > I haven't made yet, so what in the world is src/ doing that -requires- > copied code? Oh my. Python didn't invent abstraction. There's a lot of abstraction in the tree, you know, in plain old C. Some kinds of abstraction are easier in some languages, but there are often trade-offs. How many times per second does an ethernet driver get called when there's a lot of traffic? Really, Python doesn't paste well from the web and this can be a problem for newbies. This isn't about Python being a language of ideas, it's about Python choosing indent as meaningful and how sucky copying from a web page is in practice. Meaningful indent works really, REALLY well when writing python or reading python, but it sucks bad in this one instance. Not because Python sucks, but because embedding code in forum posts sucks. Tough cookies for python, because that's the shape of the world right now. -- Darrin Chandler | Phoenix BSD User Group | MetaBUG dwchand...@stilyagin.com | http://phxbug.org/ | http://metabug.org/ http://www.stilyagin.com/ | Daemons in the Desert | Global BUG Federation