On Sat, Dec 19, 2009 at 3:19 PM, Claudio Jeker <cje...@diehard.n-r-g.com> wrote: > 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. >> > > Python is a bit like mother russia, it is thinking for you. > >> 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). >> > > Yeah, we C-programmers are just mastrubating monkeys poking the typewrite > till it produces compiling code. If you don't think about what your doing > you get the crap code you see everywhere and it is not depending on the > language used. > >> 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? >> > > Code abstraction is nice until you have to update a vendor driver or some > other highly abstracted nightmare. Been there, done that, got the > nightmares. Sometimes it is far better to copy a few lines instead of > abstracting an interface until it is unusable. > > No programming language will redeem people from thinking and designing > their projects correctly.
I should make it more clear what I was saying: knowing the basics of python can't force you to write good code (in fact the python stdlib is full of shitty shitty code--the web stuff is particularly terrible) but there's something about working in it that lets me approach problems in a different way then I would have otherwise. (of course the near-ultimate end of this line of thinking is lisp, where you can define syntax for any construct you want to abstract, but lisp personally I find lisp too wordy--that's just me though) And I didn't mean "abstracting" in the way that C++/Java people mean it. I've fought tooth and nail against indirection in the name of "simplification" before. Come on. On Sat, Dec 19, 2009 at 3:30 PM, Darrin Chandler <dwchand...@stilyagin.com> wrote: > 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. I'm sorry, I didn't mean to imply that scripting people wrote bad code. I was thinking more like the add-ons to QuantumGIS. >> 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. Ideas as in the structure of the program, not as in "communication". Yes you can write any data/dependency/etc structure in any language, but some languages let you do it easier, and I've found python to be the easiest that I've tried (which is, afterall, their stated goal). > 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? Yeah yeah, I would trust that there's abstraction in the tree (more in OpenBSD than most), but I didn't know why you wouldn't always try to make the smallest code. I hadn't thought about execution time, it's true, but even then I would think it's better to define a template and fill in the blanks somehow instead of copy-pasting. Anyway, enough /noise/, I can see that this is just going to end with misunderstood words. -Nick