Re: OT: Why is C so popular?
On Mon, 2003-09-01 at 13:26, Colin Watson wrote: On Mon, Sep 01, 2003 at 12:53:55PM -0400, Mark Roach wrote: [snip] If you think that my goals are incorrect, or can show that it does not meet my desires in some way, then tell me how. X is better than Y is just silly. Perhaps if you gave more information on what constitutes better we could have an actual discussion. Looking back, the reason given for setting tabstop was: | So that when we hit tab it goes to the next multiple of... 4? If you have a particular goal to accomplish, it makes sense to use something which accomplishes exactly that goal. The tabstop option is documented as controlling the number of spaces that a Tab in the file counts for, while the softtabstop option is documented as controlling the number of spaces that a Tab counts for while performing editing operations, like inserting a Tab or using BS. On the principle of least surprise, I feel that using an option designed to do the thing I want, rather than using an option designed to do something else which happens to do the thing I want as well, is aesthetically better. I actually just tried sts=4 and it seems to work just fine. I can't say that it is any better a solution (for me) other than the fact that it takes fewer keys to enter manually. I guess I don't really care what the intended purpose behind a feature is as long as it accomplishes my goals. Also, Steve claimed that tabstop was the only way to do what he wanted to do. Based on what he'd said about what he wanted to do, I disagreed. I understand now. The way your response was worded - much better was the part that didn't make sense to me. After having tried both, they seem functionally equivalent, only with sts obviously being shorter. Taking the effect that ts=4 et has on files that use tabs (speaking only in terms of python editing here) into account, I would have to say that I would prefer those files that use tabs to be converted to use only spaces, so it is a nice side effect. There are some cases, such as where a file has a mix of tabs and spaces where doing so can screw stuff up. I think in those cases, the thing to do is bite the bullet and ts=4 et anyway and fix it. As it happens, setting the tabstop option to anything other than 8 does irritate me when editing files containing tabs. I like to keep source code within 80 columns, and mismatched tabstop settings have a habit of screwing that up even if the file doesn't mix tabs and spaces. I've edited files that were perfectly readable on an 80-column display with tabstop=4, and were obviously intended that way, but that were unreadable with a default tabstop. In languages where mixing tabs and spaces is merely a cosmetic problem, the situation is worse yet. Leaving the tab character to represent its historical default of eight spaces simplifies everyone's life and means you can spend your life on more productive things than worrying about different kinds of whitespace. I can see what you mean. That is part of why I try never to use tabs at all, especially in python code. I think both options have their appropriate uses, and that for python code where it is uncertain what tabs vs spaces will mean in terms of the code operation, spaces-only is a reasonable way to go. Am I still way off the mark? Have I missed some other inherent evilness in converting tabs to spaces? (Mind you, I am speaking only in reference to python coding which is what I thought the conversation was about. if not, my mistake) -Mark -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 10:19:18PM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 13:26, Colin Watson wrote: As it happens, setting the tabstop option to anything other than 8 does irritate me when editing files containing tabs. I like to keep source code within 80 columns, and mismatched tabstop settings have a habit of screwing that up even if the file doesn't mix tabs and spaces. I've edited files that were perfectly readable on an 80-column display with tabstop=4, and were obviously intended that way, but that were unreadable with a default tabstop. In languages where mixing tabs and spaces is merely a cosmetic problem, the situation is worse yet. Leaving the tab character to represent its historical default of eight spaces simplifies everyone's life and means you can spend your life on more productive things than worrying about different kinds of whitespace. I can see what you mean. That is part of why I try never to use tabs at all, especially in python code. I think both options have their appropriate uses, and that for python code where it is uncertain what tabs vs spaces will mean in terms of the code operation, spaces-only is a reasonable way to go. Am I still way off the mark? Have I missed some other inherent evilness in converting tabs to spaces? (Mind you, I am speaking only in reference to python coding which is what I thought the conversation was about. if not, my mistake) Well, I don't use Python, so I'm probably guilty of being a little off-topic. There's one project I maintain that historically used tabs for indentation before I came to it, and I haven't changed that since it would result in unreasonable diffs in revision control and make other things hard to track down. I actually rather like it in some ways: it forces me to keep the level of indentation down, which in turn seems to result in more generally readable code. Nowadays, on average I tend to use expandtab for new code, but converting tabs to spaces is still an operation that needs to be handled carefully with respect to revision control, so I don't apply it across the board. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Tue, Sep 02, 2003 at 09:37:27AM +0100, Colin Watson wrote: On Mon, Sep 01, 2003 at 10:19:18PM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 13:26, Colin Watson wrote: Nowadays, on average I tend to use expandtab for new code, but converting tabs to spaces is still an operation that needs to be handled carefully with respect to revision control, so I don't apply it across the board. Almost all decent revision control programs tend to let you ignore whitespace when doing diffs of a program. (Works fine in most languages as whitespace don't containing any information.) So for that reason it should still work to update the code to have better indention and get the full usage of the revision control. (As you don't use python.) / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Tue, Sep 02, 2003 at 11:43:19AM +0200, Anders Arnholm wrote: On Tue, Sep 02, 2003 at 09:37:27AM +0100, Colin Watson wrote: Nowadays, on average I tend to use expandtab for new code, but converting tabs to spaces is still an operation that needs to be handled carefully with respect to revision control, so I don't apply it across the board. Almost all decent revision control programs tend to let you ignore whitespace when doing diffs of a program. Other people working on the project still need to use that option, and it still makes annotate less convenient. Unnecessary cosmetic changes are always a pain, and if done at all they should always happen in separate commits to functional changes. (Wearing my code reviewer hat, I will jump up and down on your head if you mix cosmetic changes with functional changes. :)) -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Tue, Sep 02, 2003 at 11:12:46AM +0100, Colin Watson wrote: On Tue, Sep 02, 2003 at 11:43:19AM +0200, Anders Arnholm wrote: On Tue, Sep 02, 2003 at 09:37:27AM +0100, Colin Watson wrote: Nowadays, on average I tend to use expandtab for new code, but converting tabs to spaces is still an operation that needs to be handled carefully with respect to revision control, so I don't apply it across the board. Almost all decent revision control programs tend to let you ignore whitespace when doing diffs of a program. Other people working on the project still need to use that option, and it still makes annotate less convenient. Unnecessary cosmetic changes are always a pain, and if done at all they should always happen in separate commits to functional changes. (Wearing my code reviewer hat, I will jump up and down on your head if you mix cosmetic changes with functional changes. :)) Yes, it's good idea to keep it separate check ins. But that doesn't changed the main thing i they are needed, e.g. the code is in bad indention according to coding standard or something else like this. Make the change, run the test suit, checking the changes (with comment update to follow coding standard. or something like that) and then proceed with the other functional standards. Coding standard, tab/spaces and some on is usually something you like to do before you start a complex work. So that the the complex work gets a little easier. If you like to compare versions operated by a syntax changes that the ignore whitespace comes in handy. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 04:40:01PM -0500, Kirk Strauser wrote: At 2003-08-28T18:37:34Z, Nathan E Norman [EMAIL PROTECTED] writes: I'd guess the latter. I've seen what could have been good software engineering if management had been willing to work within the system. I wasn't thinking - 'nuff said. Yeah, I remember a particular manager that was duly impressed by the detailed and useful design documents that my team had developed. About 2 months into the 6 month project, he wanted to know what the project looked like. Oh, it's coming along well, we said. See, we've already implemented and tested all of these components. That's nice, said Manager, but what does it *look* like? Us: Huh? Him: Can you demo the interface? Us: Erm, no. We won't even start on the user interface for another two months. Him: YOU'VE BEEN WORKING FOR TWO MONTHS AND YOU CAN'T EVEN DEMO IT?!? Us: Well, I can show you how the modules look. See? I just frobnitzed the knob from 500 miles away! Him: So, I'm supposed to tell my boss that there's NOT EVEN A DEMO INTERFACE?!? Us: Well, right Do I know you? :-) Sounds like the place I worked, too. -- Nathan Norman - Incanus Networking mailto:[EMAIL PROTECTED] You see, the best way to solve a problem is to rigorously define it in terms of other people's problems and then run away quickly. -- Roland McGrath pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 11:24:41AM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 06:20, Anders Arnholm wrote: SO the reason is to inport bad fomrated code, and make that code better formated. For me thats dosn't make med have to change my editor. As this still needs a manual step, whan it happens I can change my tabstop to fix it in that buffer only. ... This has nothing to do with badly formatted code. I repeat, nothing. Here is the desired goal: Use 4 spaces for indent levels and have no tabs in the file. Here is a very easy way to achieve that which does exactly what I want every time: :set ts=4 et Why not: :set ts=8 sw=4 expandtab and NOT use tab? After all you don't *want* tabs, do you? Use ^T instead... -- Karl E. Jørgensen [EMAIL PROTECTED] http://karl.jorgensen.com Today's fortune: A definition of teaching: casting fake pearls before real swine. -- Bill Cain, Stand Up Tragedy -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
on Fri, Aug 29, 2003 at 01:18:57AM +0100, Colin Watson ([EMAIL PROTECTED]) wrote: On Thu, Aug 28, 2003 at 01:08:56PM -0700, Mark Ferlatte wrote: Ron Johnson said on Thu, Aug 28, 2003 at 02:16:22PM -0500: With tight budgets and tight schedules, I've *never* seen a project rewritten. Rewriting from scratch is dangerous anyway; you exchange all of the bugs you know about for a whole new set of bugs which you haven't discovered yet. Better to improve what you've got. This can result in a totally different codebase after a while, but at least you have been able to test and release along the way. Amen, brother. I spend a fair bit of my time in Debian trying to stop people from rewriting things and getting them to fix existing code instead. It's an uphill struggle: for some people rewriting from scratch seems to be much sexier. Literally, at times. One of Bdale's stories is of a Brazillian project to produce a distro (forget which), where a primary objective was not only to impress the girls, but was met ;-) _Brazillian_ girls at that. Add that to your ABM arsenal ;-) Peace. -- Karsten M. Self [EMAIL PROTECTED]http://kmself.home.netcom.com/ What Part of Gestalt don't you understand? Defeat EU Software Patents! http://swpat.ffii.org/ pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Wed, Aug 27, 2003 at 11:06:36AM -0700, Steve Lamb wrote: *cough, spit* I was able to grasp Turbo Pascal far before C. ...you're like a Spanish footballer, then - they obviously use Pascal; if they used C, Beckham's new club would be called float madrid(). -- Pigeon Be kind to pigeons Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x21C61F7F pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 02:06:53PM -0500, Ron Johnson wrote: On Fri, 2003-08-29 at 11:27, Anders Arnholm wrote: On Fri, Aug 29, 2003 at 08:35:25AM -0500, Ron Johnson wrote: On Fri, 2003-08-29 at 03:35, Anders Arnholm wrote: So if not using braces matching, how does one quickly jump to the end/begining of a block. Well, PageDown and the down-arrow usually work for me... It doesn't work for me, it only jumps to the end of the page and or a line down. When programing in C I'm used to when being at the beginin of a class/function/block being able to get to the end of this block by pressing % (e.g. matching brace) and continue from there. That makes navigation in the file fast and I need to keep track of a loot less bookmarks. I what a such functionality when editing Python code too. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 10:09:01 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: It doesn't work for me, it only jumps to the end of the page and or a line down. When programing in C I'm used to when being at the beginin of a class/function/block being able to get to the end of this block by pressing % (e.g. matching brace) and continue from there. That makes navigation in the file fast and I need to keep track of a loot less bookmarks. I what a such functionality when editing Python code too. http://www.vim.org/scripts/script.php?script_id=30 [[ -- Jump to beginning of block ]] -- Jump to end of block -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 01:46:37PM -0500, Ron Johnson wrote: On Fri, 2003-08-29 at 11:32, Anders Arnholm wrote: On Fri, Aug 29, 2003 at 08:33:40AM -0500, Ron Johnson wrote: On Thu, 2003-08-28 at 14:07, Pigeon wrote: set tabstop=4 So thats why all code form other Python programers look like shit and dont line up, not that a tab is 8 spaces wide and will stay that way for ever everything else is PLAIN fucking evil!!! Or as the vim help file puts it. Note: Setting 'tabstop' to any other value than 8 can make your file appear wrong in many places (e.g., when printing it). You conveniently ignored the fact that I also mentioned set expandtab There are no ^I characters when that is used. So why change tabstop? Is there any reason for that what so ever and I know that the file you send out didn't have any tabs, but the only reason what so ever for setting tabstop to 4 I could fingure out what that other programers working with the same files as you, did do this wrong! And as I interpited this as a reconedation, something in the enviroment whas wrong. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 12:30:24PM -0700, Steve Lamb wrote: On Fri, 29 Aug 2003 18:32:08 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: On Fri, Aug 29, 2003 at 08:33:40AM -0500, Ron Johnson wrote: On Thu, 2003-08-28 at 14:07, Pigeon wrote: set tabstop=4 So thats why all code form other Python programers look like shit and dont line up, not that a tab is 8 spaces wide and will stay that way for Nice try. You trimmed expandtab from the quote. Yes but why does you need it if you don't get bad files from other programers using tabs for spaces wides as indention? I saw and knew what expandtabs does, I don't have it my self most of the time, but in some projects it's nice however in most enviroment all progamers know NOT to change tabstop and then tabstop is always 8 wide in all files. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 10:23:38 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: So why change tabstop? So that when we hit tab it goes to the next multiple of... 4? -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 10:26:56 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Yes but why does you need it if you don't get bad files from other programers using tabs for spaces wides as indention? Because new people to Python haven't yet learned about no tabs? I saw and knew what expandtabs does, I don't have it my self most of the time, but in some projects it's nice however in most enviroment all progamers know NOT to change tabstop and then tabstop is always 8 wide in all files. Since we're talking Python here and since vim does autodetect quite nicely between Python and C (and Perl and.. and... and...) and one can set the tabstop, expandtabs and the like based on the file edited. What exactly is your point? -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 01:49:23AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 10:23:38 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: So why change tabstop? So that when we hit tab it goes to the next multiple of... 4? Then why not learn the editor :^) Whan hitting tab MY vim with tabstop of eight jumps to the next indention level, e.g. what I have in the shiftwidth variable that you also changed to four. If you have indent on that is what controls the behaviure of the editor when pressing tab. I can see no reason setting sw if not usint cindent an then the value of sw is used when you press tab. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 01:56:39AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 10:26:56 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Yes but why does you need it if you don't get bad files from other programers using tabs for spaces wides as indention? Because new people to Python haven't yet learned about no tabs? And most of the use 4 spaces wide tabs? Or just use one tab as indention level? In every case that still explans why python code found on the net other looks realy bad indented. Don't take it personal, it just explans for me why it look so bad. I saw and knew what expandtabs does, I don't have it my self most of the time, but in some projects it's nice however in most enviroment all progamers know NOT to change tabstop and then tabstop is always 8 wide in all files. Since we're talking Python here and since vim does autodetect quite nicely between Python and C (and Perl and.. and... and...) and one can set the tabstop, expandtabs and the like based on the file edited. What exactly is your point? If you feel that it's necessary to changes tabstop to four to get the code readable, then only reason to have tabstop set to four, then that explans why code found on the ner look bad. It's also stated in the Python language definition that tabstop is at 8 spaces, and changing this might actually changes the syntax of a program, given that the actually is a mix of spaces and tab in the source file. (And there is a recomendation not to have tabs for crossplatform compability.) / Anders -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 11:02:09 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Then why not learn the editor :^) Whan hitting tab MY vim with tabstop of eight jumps to the next indention level, I suggest you try that again VERRRY carefully. I just tried it. Entered the editor in Python mode :set shiftwidth=4 if foo:CRTAB 8 spaces, not 4. 8. 'shiftwidth' 'sw' number (default 8) local to buffer Number of spaces to use for each step of (auto)indent. Used for |'cindent'|, ||, ||, etc. Since we're not in cindent that doesn't count and since it is easier to set TS to 4 and whack tab once at a new block I prefer to do that than to slap space 4 times or hit . Furthermore this is born out in vim's own documentation of tabstop: There are four main ways to use tabs in Vim: [SNIP] 2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed. [SNIP] To get the behavior you describe you have to set tabstop to 4 so that it will go to the next multiple of 4. Shiftwidth works on reindenting blocks. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 11:18:14 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: And most of the use 4 spaces wide tabs? Or just use one tab as indention level? In every case that still explans why python code found on the net other looks realy bad indented. Don't take it personal, it just explans for me why it look so bad. Python standard indention is 4 spaces. If you want to go to the source on this here is what Guido van Rossum has to say about it here: http://www.python.org/doc/essays/styleguide.html --- SNIP --- Indentation Use the default of Emacs Python-mode: 4 spaces for one indentation level. For really old code that you don't want to mess up, you can continue to use 8-space tabs. Emacs Python-mode auto-detects the prevailing indentation level used in a file and sets its indentation parameters accordingly. Tabs or Spaces? Never mix tabs and spaces. The most popular way of indenting Python is with spaces only. The second-most popular way is with tabs only. Code indented with a mixture of tabs and spaces should be converted to using spaces exclusively. (In Emacs, select the whole buffer and hit ESC-x untabify.) When invoking the python command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended! --- SNIP --- For better or ill that is what the Python community has come to embrace. If you feel that it's necessary to changes tabstop to four to get the code readable, then only reason to have tabstop set to four, then that explans why code found on the ner look bad. It's also stated in the Python language definition that tabstop is at 8 spaces, and changing this might actually changes the syntax of a program, given that the actually is a mix of spaces and tab in the source file. (And there is a recomendation not to have tabs for crossplatform compability.) Yes, but vim uses tabstop to determine how many spaces to put in. Hence tabstop to 4, expandtabs on, shiftwidth to 4. Tabstops to know what to do when we hit tab, expandtabs on so we don't send it out to other people, shiftwidth to know what to do when we want to reindent. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 02:51:20AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 11:02:09 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Then why not learn the editor :^) Whan hitting tab MY vim with tabstop of eight jumps to the next indention level, I suggest you try that again VERRRY carefully. I just tried it. Entered the editor in Python mode :set shiftwidth=4 if foo:CRTAB Just tried, :set sw=4 class test:cr Four spaces no tab, ofcource I use cindent as default... Since we're not in cindent that doesn't count and since it is easier to And why don't you use cindent? Becouse you have something religus against the c in the name? / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 03:04:28AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 11:18:14 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Yes, but vim uses tabstop to determine how many spaces to put in. Hence tabstop to 4, expandtabs on, shiftwidth to 4. Tabstops to know what to do when we hit tab, expandtabs on so we don't send it out to other people, shiftwidth to know what to do when we want to reindent. SO the reason is to inport bad fomrated code, and make that code better formated. For me thats dosn't make med have to change my editor. As this still needs a manual step, whan it happens I can change my tabstop to fix it in that buffer only. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 1 Sep 2003 12:15:11 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: And why don't you use cindent? Becouse you have something religus against the c in the name? Because we're not programming in C and I'd rather not take the chance of it doing something stupid based on the presumption we are coding in C. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 02:51:20AM -0700, Steve Lamb wrote: To get the behavior you describe you have to set tabstop to 4 so that it will go to the next multiple of 4. No, you don't have to. Try setting softtabstop - much better. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 03:50:08AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 12:15:11 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: And why don't you use cindent? Becouse you have something religus against the c in the name? Because we're not programming in C and I'd rather not take the chance of it doing something stupid based on the presumption we are coding in C. Then you should look into what itäs doing and learn your editor, even tough it's called cindent i more of context indent the c language indent. Some parts of it works with python but autoindening the whole file doesn't of understandable reasons. Peronaly I have gorwn so used to cindent (or the simularity in emacs) that I can't program without. Well actually I didn't do any serius programing in vi untill vim came around with just that feature. Since then I haven't used Emacs more on some minor ocations par programing with other programmers. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 2003-09-01 at 06:20, Anders Arnholm wrote: On Mon, Sep 01, 2003 at 03:04:28AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 11:18:14 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Yes, but vim uses tabstop to determine how many spaces to put in. Hence tabstop to 4, expandtabs on, shiftwidth to 4. Tabstops to know what to do when we hit tab, expandtabs on so we don't send it out to other people, shiftwidth to know what to do when we want to reindent. SO the reason is to inport bad fomrated code, and make that code better formated. For me thats dosn't make med have to change my editor. As this still needs a manual step, whan it happens I can change my tabstop to fix it in that buffer only. Hello... I think you need to stop for a moment and actually read the messages you are receiving. This has nothing to do with badly formatted code. I repeat, nothing. Here is the desired goal: Use 4 spaces for indent levels and have no tabs in the file. Here is a very easy way to achieve that which does exactly what I want every time: :set ts=4 et It works. period. There is no better way. There is only accomplishes that goal, or doesn't accomplish that goal. This has nothing to do with other people's code. This is what I do for *my* code. Please understand that just because the word tab is used in the options that doesn't mean this actually has to do with the \t character -Mark -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, 2003-09-01 at 06:51, Colin Watson wrote: On Mon, Sep 01, 2003 at 02:51:20AM -0700, Steve Lamb wrote: To get the behavior you describe you have to set tabstop to 4 so that it will go to the next multiple of 4. No, you don't have to. Try setting softtabstop - much better. what could be better than works exactly as desired? -Mark -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 11:24:41AM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 06:20, Anders Arnholm wrote: On Mon, Sep 01, 2003 at 03:04:28AM -0700, Steve Lamb wrote: On Mon, 1 Sep 2003 11:18:14 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: Here is a very easy way to achieve that which does exactly what I want every time: :set ts=4 et It works. period. There is no better way. There is only accomplishes that goal, or doesn't accomplish that goal. This has nothing to do This one does one big problem IF you get a file from someone else that has mixed tabs and spaces. And is using a tabsize of the standard 8 spaces. Then in combination with Python you by editing the code you actually does changes the sysntax of the file. Then I don't see the huge difference to change into :set sts=4 et if thats what you actually whan't. with other people's code. This is what I do for *my* code. Please understand that just because the word tab is used in the options that doesn't mean this actually has to do with the \t character The difference between ts and sts is just that ts works on \t charachters imported in the files to, and sts doesn't. Setting ts without et is definitly wrong. Setting it with et just look wrong, but doesn't hurt so many else. (Or hopefully don't...) / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Mon, 2003-09-01 at 11:50, Anders Arnholm wrote: [snip] The difference between ts and sts is just that ts works on \t charachters imported in the files to, and sts doesn't. Setting ts without et is definitly wrong. Setting it with et just look wrong, but doesn't hurt so many else. (Or hopefully don't...) If they are using tabs, then I *want* their tabs to be corrected. Mixing tabs and spaces is the Wrong Thing to do. If they use tabs (no python programmer does for very long) and I want to modify their code and submit a patch, then I will use tabs too, because mixing tabs and spaces is still the Wrong Thing. Using sts solves a problem that just doesn't exist. -Mark -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 11:27:10AM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 06:51, Colin Watson wrote: On Mon, Sep 01, 2003 at 02:51:20AM -0700, Steve Lamb wrote: To get the behavior you describe you have to set tabstop to 4 so that it will go to the next multiple of 4. No, you don't have to. Try setting softtabstop - much better. what could be better than works exactly as desired? tabstop *doesn't* work exactly as desired for me. (Shall we continue with proof by assertion? :)) -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, 2003-09-01 at 12:15, Colin Watson wrote: On Mon, Sep 01, 2003 at 11:27:10AM -0400, Mark Roach wrote: [snip] what could be better than works exactly as desired? tabstop *doesn't* work exactly as desired for me. (Shall we continue with proof by assertion? :)) As far as I can see, no one was trying to prove anything. If I say that ls works exactly as desired for showing me a directory listing, it would not make sense for someone else to say, no, ls -l is better. ls produces my desired outcome. If you think that my goals are incorrect, or can show that it does not meet my desires in some way, then tell me how. X is better than Y is just silly. Perhaps if you gave more information on what constitutes better we could have an actual discussion. -Mark -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Mon, Sep 01, 2003 at 12:53:55PM -0400, Mark Roach wrote: On Mon, 2003-09-01 at 12:15, Colin Watson wrote: On Mon, Sep 01, 2003 at 11:27:10AM -0400, Mark Roach wrote: what could be better than works exactly as desired? tabstop *doesn't* work exactly as desired for me. (Shall we continue with proof by assertion? :)) As far as I can see, no one was trying to prove anything. If I say that ls works exactly as desired for showing me a directory listing, it would not make sense for someone else to say, no, ls -l is better. ls produces my desired outcome. If you think that my goals are incorrect, or can show that it does not meet my desires in some way, then tell me how. X is better than Y is just silly. Perhaps if you gave more information on what constitutes better we could have an actual discussion. Looking back, the reason given for setting tabstop was: | So that when we hit tab it goes to the next multiple of... 4? If you have a particular goal to accomplish, it makes sense to use something which accomplishes exactly that goal. The tabstop option is documented as controlling the number of spaces that a Tab in the file counts for, while the softtabstop option is documented as controlling the number of spaces that a Tab counts for while performing editing operations, like inserting a Tab or using BS. On the principle of least surprise, I feel that using an option designed to do the thing I want, rather than using an option designed to do something else which happens to do the thing I want as well, is aesthetically better. Also, Steve claimed that tabstop was the only way to do what he wanted to do. Based on what he'd said about what he wanted to do, I disagreed. As it happens, setting the tabstop option to anything other than 8 does irritate me when editing files containing tabs. I like to keep source code within 80 columns, and mismatched tabstop settings have a habit of screwing that up even if the file doesn't mix tabs and spaces. I've edited files that were perfectly readable on an 80-column display with tabstop=4, and were obviously intended that way, but that were unreadable with a default tabstop. In languages where mixing tabs and spaces is merely a cosmetic problem, the situation is worse yet. Leaving the tab character to represent its historical default of eight spaces simplifies everyone's life and means you can spend your life on more productive things than worrying about different kinds of whitespace. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 20:01:23 +0100 Pigeon [EMAIL PROTECTED] wrote: Oh, that's interesting - the for loop's running from 0 to 9, so it prints 81, not 100. Yes, range(x) does 0 to x-1. This is for stuff like this (and this is a bad example)... for x in range(10): baz[x] = foo[x] + bar[x] -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
Steve Lamb [EMAIL PROTECTED] writes: It's called maintainability. Who says *you* are going to be the next person to touch the code? We try to hire people with a basic knowledge of the language. I can see your concern with the fifteen different ways perl can represent ifs (at least the language doesn't have COME FROM) but this is a bit excessive? Do you also wrap if bodies in a few extra layers of parentheses, in case someone comes along and wants to add a || and forgets to? -- Alan Shutko [EMAIL PROTECTED] - I am the rocks. I'm leaking brain lubricant. - Calvin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 19:03:54 -0500 Alan Shutko [EMAIL PROTECTED] wrote: We try to hire people with a basic knowledge of the language. Which does not negate the fact that stupid mistakes happen. The common error of... if cond bar; baz; ...in C can be avoided by the braces being there. Furthermore once you get in the habit it really is no wasted effort. In fact it helps because you just do it instead of uhm, ok, this time I won't put braces, er, wait. I can see your concern with the fifteen different ways perl can represent ifs (at least the language doesn't have COME FROM) but this is a bit excessive? Do you also wrap if bodies in a few extra layers of parentheses, in case someone comes along and wants to add a || and forgets to? No because that's generally on the same line and you can see plainly whether it needs it or not. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
Steve Lamb [EMAIL PROTECTED] writes: Which does not negate the fact that stupid mistakes happen. The common error of... if cond bar; baz; Why is that a common error? It just looks wrong to me. Maybe I never[1] see this error because of two things: * I follow the BSD style of braces, so it's perhaps more obvious that the braces aren't there than it would be if the opening brace was on the same line as the if * I use Emacs, and I'd have to work hard to misindent like that. Maybe eventually more editors and IDEs will get decent autoindenting[2] and coping styles like this can go away. Footnotes: [1] And I mean, never... I can't remember myself getting bitten by this in the last 10 years of C. [2] As opposed to autoformatting. Eclipse will autoformat, but you have to ask for it, and I find that my cow-orkers never do. -- Alan Shutko [EMAIL PROTECTED] - I am the rocks. These guys have no future! - Butt-Head -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 11:53:14PM -0600, Jacob Anawalt wrote: Just my 2c on the rewrites from scratch. I also agree, and have one theory on why it happens anyway based on my experiance with other programmers who I've seen assigned to improve on existing code. I think often 'rewriters' give up before getting their head around the existing code and figuring out why it works the way it does. They feel it is taking them longer to understand the code than it would to write it their way. I've done a rewrite from scratch where the first step involved completely understanding everything the old code did, nonexistent comments, bugs and all... because the old source was about the only documentation on exactly what the system was supposed to do. Without the rewrite, it would have been possible to fix most of the bugs and work around the rest, but it would still have been horrendously inefficient - it was processing large batches of data, and the rewrite got the run time down from 6 hours to 20 minutes. I do agree about swapping old bugs for new ones... -- Pigeon Be kind to pigeons Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x21C61F7F pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 04:44:33PM -0700, Steve Lamb wrote: On Fri, 29 Aug 2003 20:01:23 +0100 Pigeon [EMAIL PROTECTED] wrote: Oh, that's interesting - the for loop's running from 0 to 9, so it prints 81, not 100. Yes, range(x) does 0 to x-1. This is for stuff like this (and this is a bad example)... for x in range(10): baz[x] = foo[x] + bar[x] ...so array indices work like C, then. OK! -- Pigeon Be kind to pigeons Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x21C61F7F pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 05:51:50PM -0500, Ron Johnson wrote: Note, though, Disabling Via external APIC routing and this: $ cat /proc/interrupts CPU0 0: 563586560 XT-PIC timer snip 15: 1311 XT-PIC ide1 I'd have noticed a long time ago if there were more than 15 IRQs. Yeah, I know - it's dead and chewed, but seems to be the best we can get at the moment... hmmm... haven't tried 2.6.0 yet. Shame there's not more choice of chipset on cheap MBs - anything other than VIA or nVIDIA is really hard to find, so it's buggy chipset vs. nasty non-freeness issues. The VIA bugs appear to have been rendered harmless, albeit not totally nullified - I've had no data corruption - so I'll stick with my policy of not supporting non-OSS-friendly hardware suppliers :-) -- Pigeon Be kind to pigeons Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x21C61F7F pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, 2003-08-29 at 20:58, Pigeon wrote: On Fri, Aug 29, 2003 at 04:44:33PM -0700, Steve Lamb wrote: On Fri, 29 Aug 2003 20:01:23 +0100 Pigeon [EMAIL PROTECTED] wrote: Oh, that's interesting - the for loop's running from 0 to 9, so it prints 81, not 100. Yes, range(x) does 0 to x-1. This is for stuff like this (and this is a bad example)... for x in range(10): baz[x] = foo[x] + bar[x] ...so array indices work like C, then. OK! Python is written in C (no surprise there!), but what is surprising to some is that so many C-isms are in Python. For example: IF FOO == BAR: PRINT 'YES' Also, many modules are full of methods that are nothing but wrappers around C library calls, and thus have roughly the same parameter lists and calling sequences. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA 4 degrees from Vladimir Putin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Ron Johnson wrote: On Thu, 2003-08-28 at 22:15, Jacob Anawalt wrote: [...snip...] I had only posted this because the full message had a complaint about it taking hours to debug C code because of the inconsistancy in indentation/placement of braces. My solution for that has been $ indent horribly indented code.c. And then when you check the file back into cvs, it grinds away at a whole-file differential... The solution, though, is an Organizational Standard that must be followed. And I'm fine with that. The origional complaint was that the coder didn't follow a standard so it was hard to debug the code. I ran indent to get it to a standard and committed it back to CVS that way. I agree that it is good to have a shared coding standard within a group. Even if one isn't settled or if that programmer who cant make his mind up on how he indents things is balking at CVS as well, I'm not going to push them over the edge complaining about the extra cpu cycles and lines in the file that the CVS server is having to process and store because they commit poorly formatted code. Hey, maybe they will learn to use the style I'm indenting to since they don't have a set religious coding standard preference (other than maybe anarchy) and they get nicely formatted code on the next cvs update. The worst thing I can think of is some petty arguments and spitefull coding when they get the code back in an organized fashion, but unless I'm the one to start the snide remarks, most times they also appreciate getting back better-organized code than they started with. Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
bob parker wrote: On Fri, 29 Aug 2003 19:18, Paul Johnson wrote: On Thu, Aug 28, 2003 at 09:06:23AM -0500, Ron Johnson wrote: Or the poster doesn't know much about Java. Having used Java, I'd say that Java isn't good for small programs/quick hacks. And what I've seen of the larger stuff in Java, it's horrably slow and unreliable. So if it's too elephantine for little stuff and two slow and warped for the big stuff, just what the heck is Java good for again? Seems to be a solution looking for a problem. Ok, I'm not arguing pro/con Java here, I just have question. What other option do I have for web browser enabled client/server communication without reloading the page* that I can use in Koqueror or other non-mainstream graphical** browsers? Jacob *Like real-time financial market quotes or a chat window. ** Just so I wouldn't get a 'ya, you're not using Java in Lynx. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
How to improve on this Python code. Was: Re: OT: Why is C so popular?
Ron Johnson wrote: But, of course, that's not an issue in The Clearly Superior Language, is it? Ok, if this thread has accomplished little else, it seems to have gotten a couple people, including myself to play around with Python. I have a simple little perl program at work. It parses a mailbox format file and extracts email addresses from it. The mailbox file is a bunch of bounced email notifications. The program uses a couple regular expressions to extract the data and a hash to hold a unique list of the emails. It then connects to a database to see if those people have already been flagged as having bad emails. I made a copy of this script, removed the database stuff, and stripped it down to the basic process of read the file, find emails excluding some admin type addresses and then print out the unique bounced addresses. Then I wrote a Python version. It didn't take very long to code, about the same time to write the perl code if I take out the time reading howto's and the language reference. $ wc bademail.mai 8414 29296 419796 bademail.mai Perl: parseContacts.pl -- my ($unique_emails,$total_emails); $unique_emails = 0; $total_emails = 0; my %badHash; my $filename = 'bademail.mai'; open(BADEML,$filename) or die Error opening $filename; while($isline=BADEML) { if($isline =~ /([EMAIL PROTECTED])/) { $eml = lc($1); next if($eml =~ /(postmaster|mailer-daemon)/i); $badHash{$eml} = 'bad'; $total_emails++; } } close(BADEML); foreach $bademail (sort keys(%badHash)) { print $bademail, $badHash{$bademail}\n; $unique_emails++; } print $filename: total bounced emails ($total_emails); unique ($unique_emails)\ n; $ time perl parseContacts.pl [...snip print email statements...] bademail.mai: total bounced emails (888); unique (217) real0m0.056s user0m0.051s sys 0m0.004s Python: parseContacts.py --- import sys, re, string unique_emails = 0 total_emails = 0 badHash = {} file = bademail.mai try: fi = open(file,r) print Tryied to open +file except (IOError, OSError): print Trouble opening +file sys.exit(0) email_pattern = re.compile(([EMAIL PROTECTED])) ignore_pattern = re.compile((postmaster|mailer-daemon),re.I) for line in fi.readlines(): email_mo = email_pattern.search(line) if email_mo:ignore_mo = ignore_pattern.search(email_mo.group(1)) if not ignore_mo: badHash[string.lower(email_mo.group(1))] = bad total_emails = total_emails + 1 fi.close(); for badmail in badHash.keys(): print %s, %s % (badmail, badHash[badmail]) unique_emails = unique_emails + 1 print %s: total bounced emails (%d); unique (%d)% \ (file, total_emails, unique_emails) -- $ time python parseContacts.py [...snip print email statements...] bademail.mai: total bounced emails (888); unique (217) real0m0.839s user0m0.818s sys 0m0.008s I was able to write both versions and they find the same emails. I guess I'll have to look at both scripts in six months to see which one I can still understand. I purposely left out all commenting I would normally do to see how well the code stood on it's own (but that is _very_ against my normal practice.) What did I do wrong to make the python code take over ten times as long? I thought the compiled regexp patterns were suppose to be an advantage over non compiled ones (although I believe Perl caches the compiled regexp if it's contents don't change). Is string.tolower() slower than perl's lc()? Am I using an inferior method of reading a line of text from the file? (I'm instructing Perl to read one line at a time as well, and not gobble the whole thing in one go.) If I cut the file down a bit the results are still over 10x apart: $ wc bademail.mai 4725 11919 282057 bademail.mai Perl: bademail.mai: total bounced emails (313); unique (68) real0m0.030s user0m0.025s sys 0m0.006s Python: bademail.mai: total bounced emails (313); unique (68) real0m0.532s user0m0.521s sys 0m0.010s $ wc bademail.mai 58 2822099 bademail.mai Perl: bademail.mai: total bounced emails (6); unique (2) real0m0.009s user0m0.004s sys 0m0.006s Python: bademail.mai: total bounced emails (6); unique (2) real0m0.044s user0m0.035s sys 0m0.008s I thought all that talk about speeding up python using those other programs or whatever they were was to get it on par with compiled code like C. Do I need to use them to get my Python code to run as fast as my Perl code, or am I doing something grossly incorrect? I used python, python1.5, python2 and python2.2 and they gave practically the same results. -- To UNSUBSCRIBE, email to [EMAIL
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 20:26:17 -0500 Alan Shutko [EMAIL PROTECTED] wrote: Why is that a common error? It just looks wrong to me. Because it does something other than what it looks like it does. And while you, nor I, have been bitten by it I *have* seen it happen and I rarely touch C code. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Sat, 30 Aug 2003 00:28:24 -0500 Ron Johnson [EMAIL PROTECTED] wrote: Python is written in C (no surprise there!), but what is surprising to some is that so many C-isms are in Python. For example: IF FOO == BAR: PRINT 'YES' Ah yes, but try to to do this fun one: if foo = bar: print 'yes' -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Aug 29, 2003 at 05:51:50PM -0500, Ron Johnson wrote: CPU0 0: 563586560 XT-PIC timer 1:3329762 XT-PIC keyboard 2: 0 XT-PIC cascade 3: 1461 XT-PIC usb-uhci, usb-uhci, ohci1394 4:9363329 XT-PIC eth0 8:522 XT-PIC rtc 10: 38402578 XT-PIC ide2 12: 18145483 XT-PIC PS/2 Mouse 14:7005607 XT-PIC ide0 15: 1311 XT-PIC ide1 I'd have noticed a long time ago if there were more than 15 IRQs. Umm, there is an interrupt 0. 16 IRQs. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/UHiCUzgNqloQMwcRAsjkAJ9jxF/ji0hgehgrSFwc4DdYb5uU9ACeKRLX RTrV0KyqLFWVNr4Fj9/MIYU= =NHAh -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Aug 29, 2003 at 11:42:17PM -0600, Jacob Anawalt wrote: Ok, I'm not arguing pro/con Java here, I just have question. What other option do I have for web browser enabled client/server communication without reloading the page* that I can use in Koqueror or other non-mainstream graphical** browsers? Go check out http://brunslo.com/, there's a chatbox on one side. It works well. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/UIHJUzgNqloQMwcRAjcFAJwJw06RS9vNc7USgU7qBdTJwjwEBQCfeMey aNNhSpMfm4mx6AnBIRXVvaw= =M9Yd -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 11:42:17PM -0600, Jacob Anawalt wrote: [...] } Ok, I'm not arguing pro/con Java here, I just have question. What other } option do I have for web browser enabled client/server communication } without reloading the page* that I can use in Koqueror or other } non-mainstream graphical** browsers? Flash. Not that I'm promoting it, I'm just saying it's an alternative. } Jacob --Greg -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Sat, 2003-08-30 at 02:38, Steve Lamb wrote: On Sat, 30 Aug 2003 00:28:24 -0500 Ron Johnson [EMAIL PROTECTED] wrote: Python is written in C (no surprise there!), but what is surprising to some is that so many C-isms are in Python. For example: IF FOO == BAR: PRINT 'YES' Ah yes, but try to to do this fun one: if foo = bar: print 'yes' Here's an area where the BD4L explicitly departed from Algol-like languages. foo = 5 bar = 8 if foo = bar: print 'yes' File stdin, line 1 if foo = bar: print 'yes' ^ SyntaxError: invalid syntax -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Whatever may be the moral ambiguities of the so-called demoratic nations and however serious may be their failure to conform perfectly to their democratic ideals, it is sheer moral perversity to equate the inconsistencies of a democratic civilization with the brutalities which modern tyrannical states practice. Reinhold Nieburhr, ca. 1940 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Aug 30, 2003 at 07:40:49AM -0400, Gregory Seidman wrote: } Ok, I'm not arguing pro/con Java here, I just have question. What other } option do I have for web browser enabled client/server communication } without reloading the page* that I can use in Koqueror or other } non-mainstream graphical** browsers? Flash. Not that I'm promoting it, I'm just saying it's an alternative. Why use flash when there's not much embedded objects and DHTML can't do? - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/ULPWUzgNqloQMwcRArZ2AKDikTyia/2PrNZZcucVR5BLyutHQACgpbNG GWk9Rx+G1eV3wdPLmk/XI0s= =gZlw -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Sat, 2003-08-30 at 05:12, Paul Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Aug 29, 2003 at 05:51:50PM -0500, Ron Johnson wrote: CPU0 0: 563586560 XT-PIC timer 1:3329762 XT-PIC keyboard 2: 0 XT-PIC cascade 3: 1461 XT-PIC usb-uhci, usb-uhci, ohci1394 4:9363329 XT-PIC eth0 8:522 XT-PIC rtc 10: 38402578 XT-PIC ide2 12: 18145483 XT-PIC PS/2 Mouse 14:7005607 XT-PIC ide0 15: 1311 XT-PIC ide1 I'd have noticed a long time ago if there were more than 15 IRQs. Umm, there is an interrupt 0. 16 IRQs. You try assigning a device to IRQ0. To anyone who's been around since the DOS/ISA days, there are 15 IRQs, since that's all that's usable. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Eternal vigilance is the price of liberty: power is ever stealing from the many to the few. The manna of popular liberty must be gathered each day, or it is rotten... The hand entrusted with power becomes, either from human depravity or esprit de corps, the necessary enemy of the people. Only by continual oversight can the democrat in office be prevented from hardening into a despot: only by unintermitted agitation can a people be kept sufficiently awake to principle not to let liberty be smothered in material prosperity... Never look, for an age when the people can be quiet and safe. At such times despotism, like a shrouding mist, steals over the mirror of Freedom Wendell Phillips -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Aug 30, 2003 at 10:15:32AM -0500, Ron Johnson wrote: Umm, there is an interrupt 0. 16 IRQs. You try assigning a device to IRQ0. To anyone who's been around since the DOS/ISA days, there are 15 IRQs, since that's all that's usable. I didn't say all of them were usable, just that there were 16 interrupts. 0 is always the clock and nothing else. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/UMCtUzgNqloQMwcRAsoGAKDU/rRsNpHZljNSBLtbutPCF91AfACgx87f SNVujpxX/fBC03OwzikUpo8= =AMpS -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
On Sat, 2003-08-30 at 06:40, Gregory Seidman wrote: On Fri, Aug 29, 2003 at 11:42:17PM -0600, Jacob Anawalt wrote: [...] } Ok, I'm not arguing pro/con Java here, I just have question. What other } option do I have for web browser enabled client/server communication } without reloading the page* that I can use in Koqueror or other } non-mainstream graphical** browsers? Flash. Not that I'm promoting it, I'm just saying it's an alternative. And a god damned fscking bad one at that! I utterly hate and *loathe* web-sites that have Flash-based advertising. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Millions of Chinese speak Chinese, and it's not hereditary... Dr. Dean Edell -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Aug 30, 2003 at 10:23:24AM -0500, Ron Johnson wrote: Flash. Not that I'm promoting it, I'm just saying it's an alternative. And a god damned fscking bad one at that! I utterly hate and *loathe* web-sites that have Flash-based advertising. apt-get install squid adzapper - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/UMxyUzgNqloQMwcRAh/WAKC3KRo5EgjUk+ocUp6gsc27+WaxSACguXVw EnDxbMKzGa4RwXj9dGfq1dM= =4fPg -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
Paul Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Aug 29, 2003 at 11:42:17PM -0600, Jacob Anawalt wrote: Ok, I'm not arguing pro/con Java here, I just have question. What other option do I have for web browser enabled client/server communication without reloading the page* that I can use in Koqueror or other non-mainstream graphical** browsers? Go check out http://brunslo.com/, there's a chatbox on one side. It works well. form id=frmchat action=/content.php?node=Big+InfoChat method=post onsubmit=chat.value=textbox.value;textbox.value=''; Um, I must have done something wrong, or maybe you overlooked my 'without reloading the page' requirement. The whole page reloads when I click 'say'. Since the examples of my requirements were snipped, here they are again: *Like real-time financial market quotes or a chat window. ** Just so I wouldn't get a 'ya, you're not using Java in Lynx'. Just to make my question/point clear, a frame is not an acceptable answer - inline or not - to my question. A second window that is reloading and talking via JavaScript could be a solution for some, but not what I'm after (besides the pop-up might be blocked or the user might close that window - ya ya ya and they might have Java disabled). I'm talking about something like a market data quote and news ticker or something similar that doesn't rely on an auto-reload interval. Real-time quotes with people re-connecting to download the whole page (or frameset) every second is not a good idea if you want to scale well. If there's something else besides Java out there that runs on Konqueror and would be sutible (to me, see above) for a market data and news ticker, point me at it. Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
Gregory Seidman wrote: On Fri, Aug 29, 2003 at 11:42:17PM -0600, Jacob Anawalt wrote: [...] } Ok, I'm not arguing pro/con Java here, I just have question. What other } option do I have for web browser enabled client/server communication } without reloading the page* that I can use in Koqueror or other } non-mainstream graphical** browsers? Flash. Not that I'm promoting it, I'm just saying it's an alternative. } Jacob --Greg Have Konqueror installed? Been here with it? http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlashP5_Language=English There may be some way to get it in Konqueror, but MM isn't saying how. Shockwave does some nifty stuff and I've played some fun games on 1+ Ghz systems. If you get the latest version on the latest browser. I find it more than frustrating to get you need a newer version of flash to use this site on my older Macs. Installing Java isn't always a piece of cake either, but it hasn't failed me yet. That aside, and despite the fact that I had summarly dismissed flash in my mind when I made the post, I will grudgingly accept it as a solution. Any others? Any that are eligible to be included in the Debian archives (I know this kicks Java out, I'm just saying if the solution passed the requirements to be part of Debian, and was functional, I'd prefer it) Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Steve Lamb wrote: That's just it, I don't like C indenting any more, period. It isn't someone else's style that is the problem, it is the fact that it is the antithesis of how I've grown to like to code. Lemme put it this way: C: if foo bar; That's bad style unless you have a reason to know for sure that you will only ever need exactly one statement in the if. Since there's no benefit to leaving out the braces and you'd have to think hard every time you did, it's better to just avoid this C misfeature entirely.. It boils down to this. In Python if I want something to be in a block, I smack tab and don't even need to worry about my editor doing the right thing. Then you just hit open brace, and let the editor worry about doing the right thing. -- see shy jo pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
I wrote: There are no organizations without internal politics. Mark Ferlatte writes: I disagree (and am happily working for one with a stated policy against such wastes of effort and time)... Oh, well. That's different. If it's against policy then of _course_ it can't happen. ...but obviously I'm not going to convince you otherwise. I'm afraid you won't have much luck arguing against half a century of experience. -- John Hasler [EMAIL PROTECTED] (John Hasler) Dancing Horse Hill Elmwood, WI -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Kirk Strauser [EMAIL PROTECTED] writes: I agree. When I was learning C, I was taught to *always* use brackets, even when they weren't necessarily, specifically to make it easier to expand: I've never understood people who are religious about that. It's the same amount of effort whether you do it when you first write the if, or when you add something to it (ie, minimal). The only difference I see is that if you _don't_ later add something to the if, you've wasted that effort. -- Alan Shutko [EMAIL PROTECTED] - I am the rocks. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 01:08:56PM -0700, Mark Ferlatte wrote: Ron Johnson said on Thu, Aug 28, 2003 at 02:16:22PM -0500: With tight budgets and tight schedules, I've *never* seen a project rewritten. Rewriting from scratch is dangerous anyway; you exchange all of the bugs you know about for a whole new set of bugs which you haven't discovered yet. Better to improve what you've got. This can result in a totally different codebase after a while, but at least you have been able to test and release along the way. Amen, brother. I spend a fair bit of my time in Debian trying to stop people from rewriting things and getting them to fix existing code instead. It's an uphill struggle: for some people rewriting from scratch seems to be much sexier. I've seen maybe one or two occurrences where rewriting from scratch was actually worth it. Before that's the case, the existing code has to be a complete nightmare and you have to have a deadline to add some new feature or other to it. It does happen, but it is (and should be) rare. -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 05:01:05AM -0500, Alex Malinovich wrote: On Thu, 2003-08-28 at 04:41, Steve Lamb wrote: --snip-- Yeah, on supported languages. I don't see the point of having a tool to shoehorn the code into one bracket style and another tool to shoehorn it into a different bracket style (and hope it remains decent) when one could just get rid of the bloody brackets and be done with it. Hence my last stanza of pseudo code showing all of the different styles being all the same code without the brackets. But see my last paragraph in my previous post. Those brackets which make things so hard for you to read are the same brackets that make it easy for me to read. I look at Python code and I get lost. I guess my eyes are out of alignment or something, because I can't just look at indentation and see what corresponds to what. (Especially so with 4 nested ifs, loops, etc) With bracketed languages, however, I can just keep a count of brackets in my head and always know where I am. Though I'm afraid that I do at least have to agree on the multiple ways of bracing. I much prefer method C in your descriptions, and method A I can deal with, but B drives me up a wall! Now if someone would devise a language with an extremely solid OO structure, good garbage collection, easy interfaces to C libraries, and most importantly, forced type C bracketing, I'd be in heaven! :) I pretty much agree with this. I want the braces, in order to be sure that I've read it in the same way as the compiler will. Personally I use method C, partly because I think it looks neater and partly because it uses fewer lines, so you can get more code on the screen at a time. As far as reading other people's code is concerned, as long as the block between the braces is indented - which it invariably is - I don't let the positioning of the braces worry me too much. But I do insist on the braces being there! The Python method fails for me on several counts: - There isn't an explicit end-of-block delimiter. A tab to start a block; what ends it? A tab that isn't there? Yuck. - The delimiters are not visible characters. I want to *see* something that says the block STARTS HERE and ENDS HERE. { and } are fine. begin and end are OK. if-then-else-fi, while-do-done and the like are bearable, though I prefer to use the same delimiters for everything. Having the actual meaning as seen by the compiler/interpreter change according to something as vague as how far across the screen the line starts just fills me with a total lack of confidence that the code is going to do what I want. Indentation is great as an *aid* to *human* reading of the code, but for it to actually control the flow of execution is RIGHT OUT. - A corollary of this is that non-visible characters get munged. Yes, I know this *shouldn't* happen, but it *does*. Too many passes through stupid software that performs bad end-of-line translation between LF / LF-CR / CR when it shouldn't, and you end up with a file with its line structure wiped out. With explicit delimiters, it'll probably still compile, and it's not too hard to whack line breaks in at appropriate points to make it more-or-less readable. With delimiting based on whitespace and line breaks, you've had it. - A personal subset of this is that I HATE TABS! Each different application that renders tabs has its own setting for how to do it, so a file containing tabs looks fine in one app and looks like shit in another. They result in booby-trap areas in the editor where the cursor moves erratically and text jumps around the screen when editing in an infuriating manner. They make some peculiar indentation tasks, such as indenting switch statements in C neatly, really awkward. I always turn them off, type multiple spaces to indent, and get really annoyed when editing makefiles. Guess I'll be sticking to C for a while yet... -- Pigeon Be kind to pigeons Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x21C61F7F pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
Alan Shutko writes: It's the same amount of effort whether you do it when you first write the if, or when you add something to it (ie, minimal). The only difference I see is that if you _don't_ later add something to the if, you've wasted that effort. The problem with omitting the braces is that people sometimes add something to the block and forget to add the braces. -- John Hasler [EMAIL PROTECTED] (John Hasler) Dancing Horse Hill Elmwood, WI -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thursday 28 August 2003 18:05, Mark Ferlatte wrote: John Hasler said on Thu, Aug 28, 2003 at 04:16:28PM -0500: Mark Ferlatte writes: If your company tolerates internal politics, well, you're going to be in trouble when your competitor, who doesn't tolerate that kind of crap, comes along. There are no organizations without internal politics. Okay. I disagree (and am happily working for one with a stated policy against ... It appears to be true that There are no organizations without internal politics. -- Mike Mueller 324881 (08/20/2003) Make clockwise circles on the floor with your right foot; now, without looking at your foot, use the index finger on your right hand to draw the number 6 in the air -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, 2003-08-28 at 14:50, Steve Lamb wrote: On Thu, 28 Aug 2003 16:35:25 +0200 Francois Bottin [EMAIL PROTECTED] wrote: Compare it with SUN's recomendations for Java (but useable also for C): if (cond) { block; } else { block; } In this case I find it much better than the GNU Coding Standards, and there is only one line more than Python... Except the else does not line up with the if and it is too easy to skip over that line with your eyes and miss what it is. Actually, that's exactly my preferred coding style. The closing brackets always line up with what they're closing. Using the long approach of if (cond) { block; } else { block; } Has the same effect, but that's way too much wasted space. I think it all just boils down to personal preference and what people can see most easily. I can easily pick out an } else { while my eyes get confused with having to line things up over long vertical distances. Other people have the opposite problem. I think people should just use whatever they're most comfortable with that's possible in their environment. (e.g. I don't think it's possible to do a } else { line in python even when using comments because you'd have comment code comment on one line) -- Alex Malinovich Support Free Software, delete your Windows partition TODAY! Encrypted mail preferred. You can get my public key from any of the pgp.net keyservers. Key ID: A6D24837 signature.asc Description: This is a digitally signed message part
Re: OT: Why is C so popular?
John Hasler [EMAIL PROTECTED] writes: The problem with omitting the braces is that people sometimes add something to the block and forget to add the braces. Wow. I've worked with some dunderheads, and not even they have done this. You've really had experience with folks like this?! -- Alan Shutko [EMAIL PROTECTED] - I am the rocks. You came into this world a mechanoid and a mechanoid you'll always be. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Steve Lamb wrote: On Wed, 27 Aug 2003 23:52:35 -0600 Jacob Anawalt [EMAIL PROTECTED] wrote: Was this code on a Unix system, or did you have one nearby? Did you know about the indent program at the time? (man indent) It _seems_ to work for me to convert someone elses sytle (or lack of it) in coding C into a format that I like (KR). That's just it, I don't like C indenting any more, period. It isn't someone else's style that is the problem, it is the fact that it is the antithesis of how I've grown to like to code. Lemme put it this way: [snip] Hence it is not other people's style I dislike, it is the freakin' braces. Good thing there's Python for you and other !brace people then. Maybe someday I'll catch onto the concept. For now, I'm OK with braces. :) I had only posted this because the full message had a complaint about it taking hours to debug C code because of the inconsistancy in indentation/placement of braces. My solution for that has been $ indent horribly indented code.c. Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
bob parker wrote: On Thu, 28 Aug 2003 16:13, Jacob Anawalt wrote: bob parker wrote: C is easier to learn than shell scripting, the elements at least, much less Perl. I personally find it quicker to code a dirty fix in C than anything else and would not really consider shell programming for anything other than glue for a sequence of other commands. Just my 2 bits. Another great example on why the variety is a good thing. I agree on the C vs shell. The only way I write shell scripts is by example. I don't understand it well enough to write a script from a blank page. On the otherhand, I _so_ find myself wishing I could use regexp's this way in C/C++: Try man regex. Seems that there are regex libraries for the C hacker. Never had need to use them myself yet but someday?? Thanks, but I already had. compile my regex, then execute it, check for errors then free it. _That_ made me look for a C++ class, but I didn't find one that overloaded the =~ s/pattern/pattern/ operator :P Maybe the class is out there, and maybe there are some good examples of using regcomp(3). If it is, point me at it. I think in JavaScript I can assign a regex string (ie s/pattern/pattern/) into a regex object. I was almost able to do with that what I do with regex patterns in Perl. It didn't seem to make the group expressions available after matching though. That's a nice feature in Perl. Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, 28 Aug 2003 17:29:52 -0500 Alan Shutko [EMAIL PROTECTED] wrote: I've never understood people who are religious about that. It's the same amount of effort whether you do it when you first write the if, or when you add something to it (ie, minimal). The only difference I see is that if you _don't_ later add something to the if, you've wasted that effort. It's called maintainability. Who says *you* are going to be the next person to touch the code? By sticking to structures that are expandable down the road you avoid two things and improve a third. 1: Avoid unneeded effort to reform the code to do what needs to be done. 2: Avoid the possibility of a bug. 3: Make the code far more readable. Hey a few years back when I was starting to learn Perl I thought TIMTWOWTDI was peachie keen. That's until I had to maintain Perl scripts, more often than not my own. This is nice when you first get into the language: if foo {bar} unless foo {bar} bar if foo bar unless foo Nice that is, until 6 months down the line when you're pawing through code trying to figure out what's going on and hit an if followed by an unless and one of them contains the reverse of block before condition. Now your brain, instead of being able to read and process 1 construct in three different forms is dealing with 3 constructs. I've come to appreciate the fact that if it is a conditional it is going to be in this format: if cond: block elif cond: block else: block And no other. I don't need to worry about my brain trying to wrap itself around 4 different forms which are contrary to one another. This is a good thing. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Aug 27, 2003 at 04:15:13PM +0200, Sebastian Kapfer wrote: On Wed, 27 Aug 2003 13:50:11 +0200, Paul Johnson wrote: While I haven't learned much C yet (I can read it better than I write it), I do have to ask this one: It's possible to write non-braindamaged code in C++ without learning C first? Of course it is -- it's just more difficult :-) So, in practice, no, right? - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/Tum+UzgNqloQMwcRAmWDAJ9ujLRNrXw9VHiCWdd+TjfZxZxuMACfb1mD +pF37QfI7KZC4KIC7E1huoY= =iGaw -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Aug 27, 2003 at 10:14:14AM -0500, Kirk Strauser wrote: Absolutely. In fact, it's probably a good idea to learn C++ without knowing C first in that you'll probably be much more comfortable with the style if you're not subconsciously viewing it as just C with some extra stuff. I seem to recall the entire point of C++ was to be C with some extra stuff, as told by the creators. Wouldn't it make sense to think the same way? - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/Tup5UzgNqloQMwcRAiCWAJwIEc1RHNYLndz23lUNV9ND6/dX/ACgmte/ Wkdsg+ZbnryPlCxoZt1o7V0= =WkQa -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Colin Watson wrote: On Thu, Aug 28, 2003 at 01:08:56PM -0700, Mark Ferlatte wrote: Ron Johnson said on Thu, Aug 28, 2003 at 02:16:22PM -0500: With tight budgets and tight schedules, I've *never* seen a project rewritten. Rewriting from scratch is dangerous anyway; you exchange all of the bugs you know about for a whole new set of bugs which you haven't discovered yet. Better to improve what you've got. This can result in a totally different codebase after a while, but at least you have been able to test and release along the way. Amen, brother. I spend a fair bit of my time in Debian trying to stop people from rewriting things and getting them to fix existing code instead. It's an uphill struggle: for some people rewriting from scratch seems to be much sexier. I've seen maybe one or two occurrences where rewriting from scratch was actually worth it. Before that's the case, the existing code has to be a complete nightmare and you have to have a deadline to add some new feature or other to it. It does happen, but it is (and should be) rare. Just my 2c on the rewrites from scratch. I also agree, and have one theory on why it happens anyway based on my experiance with other programmers who I've seen assigned to improve on existing code. I think often 'rewriters' give up before getting their head around the existing code and figuring out why it works the way it does. They feel it is taking them longer to understand the code than it would to write it their way. Maybe it's hard to understand because comments suck in the code or the coder used two spaces when you are use to seeing four, but I've found that if I add my comments as I study the existing code I understand it much better. My understanding is that a similar line of argument is used for why the Linux kernel doesn't include a debugger. To force potential developers to get their heads into it and understand what others have already figured out. Jacob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Aug 27, 2003 at 12:02:23PM -0500, Michael Heironimus wrote: The world jumped off the IBM PC cliff, so we're still dealing with some of the design mistakes IBM made the first time around. And then people discovered they didn't have to jump off the retarded PC-BIOS cliff and started ignoring it for the most part. I think the only people who still have to deal with bios retardation are WinDOS folks. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/TuvFUzgNqloQMwcRAhi1AKCnZxRn95WYJdPk0Wnj53YO+cWXFACeMnrw d8ujBwF0Mk22PpqPS0U2oKo= =zTPY -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Aug 27, 2003 at 01:59:57PM -0700, Deryk Barker wrote: Nor does it help that the best-selling C book ever is, ahem, less-than-superbly-written. Yeah, the New Testament needs to be reworked seriously (would it get nicknamed Book of Mormon?) into something a little bit more approachable to today's audiences. Incidentally Paul, C was derived from B (derived from BCPL) in order to *re*write Unix, which was originally written in assembler. Not quite the way Dennis has explained it, but OK. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/TuzEUzgNqloQMwcRApO6AKDfMVCQiH09AidFJhGiTEVipi5LzQCfeHWY d4HU7rnPL7EldCbFkgUZMjc= =MkBE -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Joey Hess wrote: Steve Lamb wrote: That's just it, I don't like C indenting any more, period. It isn't someone else's style that is the problem, it is the fact that it is the antithesis of how I've grown to like to code. Lemme put it this way: C: if foo bar; That's bad style unless you have a reason to know for sure that you will only ever need exactly one statement in the if. Since there's no benefit to leaving out the braces and you'd have to think hard every time you did, it's better to just avoid this C misfeature entirely.. not sure whether it is fair to call it misfeature. which brings us back to topic: IMO part of the popularity of C is that it has bunch of pretty simple but consistent rules that are taken to extreme (you can really apply them any way you want, if you can live with absurdity of it i[3] and 3[i] :-). that way you have a system (language) that can be used in ways undreamt of by inventors (authors?). e.g. everywhere you have a statement you can have compound statement (because, after all, it's just a statement), everywhere you can have variable you can have expression etc. so it would be quite inconsistent to suddenly say that in some special cases you can have compound statement but not a simple statement - it would screw the consistent application of simple rules. that said I also consider it better style to use if(something) { f(): } erik -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 04:35:25PM +0200, Francois Bottin wrote: Compare it with SUN's recomendations for Java (but useable also for C): if (cond) { block; } else { block; } In this case I find it much better than the GNU Coding Standards, and there is only one line more than Python... I tend towards KR style from the little bit of C I've dealt with. Allman style tends to make me read an extra { that isn't there (because I'm expecting it on the same line as if (cond), not the next line. I tried GNU style, but I find it hard to type and harder to read. For those who have no idea what I'm babbling about... http://ursine.ca/jargon/html/I/indent-style.html - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/Tu4kUzgNqloQMwcRAm7xAJ9WYdR0pNOqMjRDK39bSdTohuk7fACeKH7X RzwVqAMrzHxbF6+QxeCVL4Q= =umAl -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
Ron Johnson wrote: Speed is over-rated. Lets take my MUA, Evolution, for example. It's not processor intensive. Why couldn't it be written in Python? Ok, I refrained from the last Evolution comment about if CLI program X had menus, I'd drop Evolution, but It's not processor intensive, that I can't let go. The copy of Evolution (1.0.3-6, not up-to-date so maybe they've optimized it) I have on my K6-2/450 makes it cry when it starts up. It's not as bad as say, watching 2000 boot, but being able to read each item initialize 'loading bla, loading more bla, loading mail...' or fall asleep as it starts up, that's a little slow. Reminds me of starting an old copy of StarOffice on that machine. Oh well. Mozilla keeps me happy for the moment. Good thing Evolution is there for others who like/need it. Maybe the day will come when I'll use it again because I need the other features integrated together with my mail program or I'll get sick of something in Mozilla mail. This version doesn't have a spell checker (I could sorely use one) and though it does many things I need it for very well, It would be cool if it would do a few other things a little better, like post attributes and showing the plain text version of everything if I'm composing in plain text. So many potential bugs related to pointers and null-terminated strings would be eliminated. The SLOC count would be lowered, and that means a lower bug count and quicker development. (Many studies have proved that bug count and speed are soley related to SLOC, no matter what language is used.) For the necessary GUI stuff, use the existing wrappers python-gtk2 and python-gnome2. To keep this sorta on topic, I guess I'll ponder on why it wasn't and if it couldn't be written in python. Maybe the group who developed it wasn't enlightened in the ways of the snake. Maybe they were scared of not having braces to hang on to. It looks like they coded a multi-threaded CORBA/Glade/GDK using C. Maybe they chose C because there was good documentation on using CORBA/Glade/GDK for C, or more likely they were seasoned C hackers. I don't know the specifics on how performance would differ if it was written in language python or some other script/interp language. If it just altered the initial start-up time by a second or three I wouldn't care. If made the software seem unresponsive then I would care. The fact that Evolution is in C doesn't make it snappy on my 450. I don't worry about what something's written in until I look at either extending it or hoping to help fix a bug. I guess if I saw that the program I wanted to help fix was written in COBOL (no offense, just not my cup of tea) then I'd skip submitting a patch and just complain about the bug or find another program. If I don't have to change the source to extend it, but can use a scripting language I'm familiar with then again I don't care if the source is from COBOL. I thought it was cool that a lot of the redhat-config-* programs were python/tk(?). That got me looking at python but my steam ran out. Maybe another day. On the other hand some of those tools on RH7.3 have bugs that are still there. Odd that some RH using Python gurus didn't get a patch submitted and working within a month of 7.3's release if it is so easy to debug. Then again maybe the bug is in the windowing toolkit (I dont remember if it's tk or something else) and not the Python code, or maybe they submitted the patch and RH didn't take the time to implement it. There is hopefully no reason why you couldn't write a program like Evolution in Python. Maybe one is already out there or will show up next month. If it kicks butt because new features can be added faster and bugs squished quicker due to the superiority of the language and it's ability to help people think about the algorythms and not the code then more power and masses to Python which would then mean more and better programs in Debian with less effort. Sounds good to me. I look forward to seeing a slew of these super programs. I've played a coupe of Python powered games on this system, an Athlon 1800+ running unstable. SolarWolf plays fairly well. Much better than Shockwave games on a K6-2/450, but shockwave games on this system are snappy. Sometimes there is a hesitation responding to my input playing SolarWolf, but so does defendguin which uses SDL and is probably in C. Until then int main(void) { ...[cut]... if ( C != NULL there_is_c_documentation) { if ( (size = snprintf(msg, 127, I will code in C ;)) == -1 ) { perror(snprintf()); exit(EXIT_FAILURE); } if ( (size == send(socket, msg, size, 0)) == -1 ) { perror(send()); exit(EXIT_FAILURE); } } else { if ( (size = snprintf(msg, 127, Crum! I hope I've learned something better by now...)) == -1 ) { perror(snprintf()); exit(EXIT_FAILURE); } if ( (size =
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 05:29:52PM -0500, Alan Shutko wrote: I've never understood people who are religious about that. It's the same amount of effort whether you do it when you first write the if, or when you add something to it (ie, minimal). The only difference I see is that if you _don't_ later add something to the if, you've wasted that effort. Why bother protecting against buffer overflows? It takes longer to code, and if nobody ever manages to overflow the buffer, you've wasted that effort. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/TvU3UzgNqloQMwcRAt4GAJ9Ms50EAuC7x02mMBQl90/n9vvjvgCfRGg1 sNjSuIxHGD71MBCM9zWrYa0= =t50A -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 10:44:13PM -0700, Steve Lamb wrote: It's called maintainability. Who says *you* are going to be the next person to touch the code? Yeah, but some people also like to ensure their job security, apparently. http://www.exmsft.com/~hanss/badcode.htm - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/Tvb3UzgNqloQMwcRAmMRAJ9gEN3KkrHgRmrV138JQBZZmdZp0wCdExnK 2aeCylEbt3ydoOKvXbAnE5o= =ROfz -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 08:06:22PM +0100, Colin Watson wrote: Starting up KDE applications outside KDE (often?) requires starting up a number of random daemons which are normally running if you use KDE for everything. Better than each program reimplimenting the world. If you have more than one KDE program running, you save on a lot of resources since every program after the first is halfway there before you start it. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/TxAGUzgNqloQMwcRArnCAKCW6d6ougt205IhxA+gXUq+DbEpRQCgoF0x xgH9PL405dzSsJU07EKE2m8= =eoFw -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 02:10:10PM -0500, Kirk Strauser wrote: At 2003-08-28T18:15:09Z, [EMAIL PROTECTED] writes: SDLC! What a joke! OK, I'll bite. Does everyone here honestly hate software engineering? Or is it that they haven't seen it done well? Name a project, open or closed (you'll get better results if you pick a closed-source project), and I'm sure at least one person will respond to tell you exactly why it sucks. - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/TxElUzgNqloQMwcRAkEaAJ9VYO7WUceZUVp1SA3R1JbrcdkivQCgpPHa UZ33Hh+8KWV111XGEzHZx1s= =W3/I -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 01:32:07PM -0500, Ron Johnson wrote: On Thu, 2003-08-28 at 11:06, Alan Shutko wrote: Anders Arnholm [EMAIL PROTECTED] writes: So, basically, you don't like Python because your text editor is junk. Fix it or go find a real editor! Heck, vim in default mode (no syntax coloring) is Good Enough. Thats about what I'm using, but vim i cmode is aloot more powerful tool to C programing than vim in Python mode. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 02:26:11PM -0700, Steve Lamb wrote: On Thu, 28 Aug 2003 13:20:07 -0700 Erik Steffl [EMAIL PROTECTED] wrote: Indention isn't magically lost and you're speaking of copies. The problem in all those cases lays in the transport or in the person who doesn't know what he is doing, not the code. 2+ years of working with Python and your scenerio has come up exactly 0 times in my experience. So you don't copy from example web-pages and so on when trying to learn about a new feature, area and so on. I do that aloot and thats is the biggest problem with Python. The other parts of the languange however sometimes for some works make this a minor problem that I can live with. As I can live with a some of the problems in Perl, C, C++, Java, bla. and so on. No languange are perfect, not even Python, many have problems with the witespace in languanges that use them, thats is a fact. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 12:55:56PM -0400, Mark Roach wrote: On Thu, 2003-08-28 at 09:10, Anders Arnholm wrote: On Thu, Aug 28, 2003 at 06:46:09AM -0500, Ron Johnson wrote: Lets take my MUA, Evolution, for example. It's not processor intensive. Why couldn't it be written in Python? One of the main reasons is that Python leaves a loot of the resolving to runtime, that means that the code actually has to be run before you can see tha actuall typo found at compile time in languanges as C. This is such a fallacy. It's very easy to make code that compiles but crashes. Compilers just compile code, they do not give it a magic This program is well written certificate. Use pychecker, be happy. or better yet, test your code. PyChecker, I'll have a look at that. But that still doesn't change than main think if you say test you code that applies to any other langunage too, and we ahve lint for C. In the real world testing to often gets pushed to far away in the developemnt, I know what I'm talking about I have been working almost all the time since 1998. Mostly developing test enviroment for different products. There is no such magic that makes it possible to test everything. PyUnits is a good test engine but I leaves some parts that stilla are hard to test, that could contain runtime errors. Testing also is a hard bussinis to figure out whar the heck is going to happen in runtime. The tools at the meoment for C is far more advances that the availible tools for Python. Yes that kind of problem would be removed, but Python code has other parts that may as well fail. Many being simples problems of types that simply isn't resolved untill runtime and as all code isn't run all the time it may burry it self long down and hidden. I think that is bad for large projects. how is that different from some C code casting inappropriately deep in the bowels of your app? In python, you at least get a useful exception, in C you just get a nasty segfault and fun with the debugger. Well the usefullness of this messange (or the more commonly seen exception in Java or C++) could be discussed. The bottom line is that in all languages good disipline and good rutines for testing is the most importand. You will always have a loot of trobles, you will always leave someting that you didn't expect to happen. All probrams in all languanges have the problems, changing langunage will not with any magic make this go away. So making a office/mail suit using Python insteda of C wount make it any better or less likely to crash for the user becaues the problems are not in the language it in something else. There bu not saying that Python might not be a good languange for the work or that C might not be a langes for this kind of work. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 09:06:23AM -0500, Ron Johnson wrote: Or the poster doesn't know much about Java. Having used Java, I'd say that Java isn't good for small programs/quick hacks. And what I've seen of the larger stuff in Java, it's horrably slow and unreliable. So if it's too elephantine for little stuff and two slow and warped for the big stuff, just what the heck is Java good for again? - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/Txp9UzgNqloQMwcRAqiCAKDV90Nf3vUCsPQJDTQziZzvoJ1YRgCfTx5J ZtUX34b58xaqEkiqhcsMFX0= =gySC -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 10:47:10AM -0400, David Z Maze wrote: Java is garbage-collected That's not entirely true, or Java would have self-collected before I hit high school. 8:o) - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/Txr3UzgNqloQMwcRAuZxAKCnybHpGPFSBEOr9wQaneJqQ5974gCfaMr9 YI5jXXeRCWt4KBc38f+vws0= =0xdx -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: FW: OT: Why is C so popular?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Aug 28, 2003 at 06:01:54PM +0200, Thomas Krennwallner wrote: For me its clear: use the language you think is good for completing a given task. I know you cannot always make this decision but if you have the chance, choose carefully ;-) But if you're considering using Forth (outside of a MUCK), or FORTRAN (at all) you're probably wrong. 8:o) - -- .''`. Paul Johnson [EMAIL PROTECTED] : :' : `. `'` proud Debian admin and user `- Debian - when you have better things to do than fix a system -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/TxtzUzgNqloQMwcRAjaCAJ4g61rUZhwnezqPrRFWCjc/F5fkJwCgx9vw hprTffpfb+z2qQ+6u0C4hOM= =u4e3 -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, Aug 28, 2003 at 12:46:43PM -0700, Steve Lamb wrote: On Thu, 28 Aug 2003 15:10:33 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: One of the main reasons is that Python leaves a loot of the resolving to runtime, that means that the code actually has to be run before you can see tha actuall typo found at compile time in languanges as C. This is offset by the fact that the code-compile-run cycle is reduced to code-run. Furthermore a lot of prototyping of code can be done interactively. When I run into a situation where I'm not sure exactly how I want to do something I open another window, fire up Python, import the appropriate libraries and twiddle with the code until I get a form that works. Then I take that and put it back into the main code. The difference in work cycle isn't that big, in Python I usally do ./verifyProgram and in c mostly make test. If I need to test something in C usally just fire up a new file and type in the needed code and run, or use my nice c alias that takes c code from stdin and runs the resulting binary. (And no I have never liked typing in code interactivly, I store everything in a file. But thats is an area of personaly liking.) / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 10:41:45 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: So you don't copy from example web-pages and so on when trying to learn about a new feature, area and so on. I do that aloot and thats is the biggest problem with Python. I do and it hasn't caused me any problems. Might I suggest you learn how to use vim before citing problems based on your own ignorance[1]. Furthermore until you figure out how not to send mail both to me and the list when I am clearly reading and replying here correspondence between you and I is at an end. [1] Prime example being vim not able to fold Python code when I've seen it done. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thursday 28 Aug 2003 20:16, Ron Johnson wrote: The SDLC and corporate politics are independent. Academics should take corporate politics into consideration when coming up with these theories. Why? The SDLC (as defined in academia) is nothing to do with corporate software development, it is about applying common engineering practises to _any_ software development, commercial or otherwise. Academia is not supposed to be about providing for coporations (although often it actually is nowadays), it is about generating new and interesting (obviously not to everyone) knowledge and ideas regardless of whether they have the potential for future practical application. If they do, thats a bug bonus, if they don't they will often at least inspire some other person to follow an interesting an idea and generate some more knowledge. Look at how much pure research goes on today in many branches of science (physics and maths are good examples of this), things like research super gravity and such don't help me grow better food to feed the family, or build a nicer house, or make my day _easier_ but thats not the point. phew, drinking till the wee hours seems like a great to activate my rant mode. Ill have to find the switch that turns that off ;) Tom -- ^__^ Tom Badran (oo)\__Imperial College (__)\ )\/\ ||w | || || Using Debian SID pgp0.pgp Description: signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 01:34:14AM -0700, Paul Johnson wrote: On Thu, Aug 28, 2003 at 08:06:22PM +0100, Colin Watson wrote: Starting up KDE applications outside KDE (often?) requires starting up a number of random daemons which are normally running if you use KDE for everything. Better than each program reimplimenting the world. If you have more than one KDE program running, you save on a lot of resources since every program after the first is halfway there before you start it. I didn't express a value judgement on it; I was just explaining to Ron why it takes longer to start up KDE programs outside KDE. -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Friday 29 Aug 2003 11:09, Tom Badran wrote: If they do, thats a bug bonus Before anyone jumps on this i obviously meant 'big' but im very hungover and cant be arsed to proof read my emails. Tom -- ^__^ Tom Badran (oo)\__Imperial College (__)\ )\/\ ||w | || || Using Debian SID pgp0.pgp Description: signature
Re: OT: Why is C so popular?
On Fri, Aug 29, 2003 at 02:36:26AM -0700, Steve Lamb wrote: On Fri, 29 Aug 2003 10:41:45 +0200 Anders Arnholm [EMAIL PROTECTED] wrote: So you don't copy from example web-pages and so on when trying to learn about a new feature, area and so on. I do that aloot and thats is the biggest problem with Python. I do and it hasn't caused me any problems. Might I suggest you learn how Then tell me how you do it, if it's that easy that I shuld have know aboutis, but I still use vim as vi almost only using the vi compatible functions with some small additions that happens to make it more usefull. There might be a simple concept not documented of described in a obvius way that I have missed, but for me it gets into a painfull reindening line by line (or sometimes marking the block and using the shift operators to get it right, sometimes it's hard to know how many steps you should shift the code so I still think it's a loot harder than just =%, and using = is realy bad on python code, then you have changed the syntax of the file). to use vim before citing problems based on your own ignorance[1]. Furthermore until you figure out how not to send mail both to me and the list when I am clearly reading and replying here correspondence between you and I is at an end. I got a message in my inbox, and as it looked more personal I replyed to it. This message is only going to the list, [1] Prime example being vim not able to fold Python code when I've seen it done. I don't yet (or at least inte version of vim that I are useing had the autofold function for Python code). Checking the currect documentation show that now I can do it. At least on this computer. SO I stand corrected that has been added and is working. / Balp -- o_ Anders Arnholm, HiQ - Consultant o/ /\[EMAIL PROTECTED] Phone : +46-703-160969 /|_, \\http://anders.arnholm.nu/ http://www.hiq.se / ` pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Wed, 27 Aug 2003 19:00:15 +0200, Sebastian Kapfer wrote: On Wed, 27 Aug 2003 13:50:11 +0200, Paul Johnson wrote: While I haven't learned much C yet (I can read it better than I write it), I do have to ask this one: It's possible to write non-braindamaged code in C++ without learning C first? Of course it is -- it's just more difficult :-) Just noticed that a little prefix called non escaped me when I read your mail. What I really wanted to say is: It is more difficult to write brain-damaged code in C++ without learning C first. -- Best Regards, | Hi! I'm a .signature virus. Copy me into Sebastian | your ~/.signature to help me spread! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 2003-08-29 at 00:59, Paul Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Aug 27, 2003 at 12:02:23PM -0500, Michael Heironimus wrote: The world jumped off the IBM PC cliff, so we're still dealing with some of the design mistakes IBM made the first time around. And then people discovered they didn't have to jump off the retarded PC-BIOS cliff and started ignoring it for the most part. I think the only people who still have to deal with bios retardation are WinDOS folks. No, you're wrong. Unless you've got APIC running, if your Linux box is x86, you're still carrying baggage from 1981. Namely, the limited number of IRQs. This problem has been mitigated over the years, first, partially, sometimes, after much waving of Dead Chickens, by Plug-n-Pray, and then by PCI, and then by OSs that allow IRQ-sharing. Even then, though, the Dead Hand Of 1981 hangs over Linux: perform- ance suffers if too many PCI devices (whether cards or devices built onto the mobo: IDE, USB, ieee1394, SCSI) share the same IRQ. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Spit in one hand, and wish for peace in the other. Guess which is more effective... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 11:42:18 +0100, Tom Badran [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]: On Friday 29 Aug 2003 11:09, Tom Badran wrote: If they do, thats a bug bonus Before anyone jumps on this i obviously meant 'big' but im very hungover and cant be arsed to proof read my emails. ..why bother, would have deprived us of watching your neat piece enter the hall of fame in the classic art of cool cockups. ;-) -- ..med vennlig hilsen = with Kind Regards from Arnt... ;-) ...with a number of polar bear hunters in his ancestry... Scenarios always come in sets of three: best case, worst case, and just in case. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Thu, 2003-08-28 at 21:54, Alex Malinovich wrote: On Thu, 2003-08-28 at 14:50, Steve Lamb wrote: On Thu, 28 Aug 2003 16:35:25 +0200 Francois Bottin [EMAIL PROTECTED] wrote: Compare it with SUN's recomendations for Java (but useable also for C): if (cond) { block; } else { block; } In this case I find it much better than the GNU Coding Standards, and there is only one line more than Python... Except the else does not line up with the if and it is too easy to skip over that line with your eyes and miss what it is. Actually, that's exactly my preferred coding style. The closing brackets always line up with what they're closing. Using the long approach of if (cond) { block; } else { block; } BSD or Allman (since he did it at UC-Beserkeley) style. Has the same effect, but that's way too much wasted space. I think it all just boils down to personal preference and what people can see most easily. I can easily pick out an } else { while my eyes get confused with having to line things up over long vertical distances. I solved that problem by putting my VT220 emulator in 132x48 mode! When I use xterms, I just make them nice and long. Other people have the opposite problem. I think people should just use whatever they're most comfortable with that's possible in their environment. (e.g. I don't think it's possible to do a } else { line in python even when using comments because you'd have comment code comment on one line) I wouldn't be surprised if most Python programmers prefer BSD style. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Our computers and their computers are the same color. The conversion should be no problem! Unknown -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 29 Aug 2003 08:19:10 -0500 Ron Johnson [EMAIL PROTECTED] wrote: I wouldn't be surprised if most Python programmers prefer BSD style. I find it the worst of the three I presented. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thu, 2003-08-28 at 14:07, Pigeon wrote: On Thu, Aug 28, 2003 at 05:01:05AM -0500, Alex Malinovich wrote: On Thu, 2003-08-28 at 04:41, Steve Lamb wrote: --snip-- Yeah, on supported languages. I don't see the point of having a tool to shoehorn the code into one bracket style and another tool to shoehorn it into a different bracket style (and hope it remains decent) when one could just get rid of the bloody brackets and be done with it. Hence my last stanza of pseudo code showing all of the different styles being all the same code without the brackets. But see my last paragraph in my previous post. Those brackets which make things so hard for you to read are the same brackets that make it easy for me to read. I look at Python code and I get lost. I guess my eyes are out of alignment or something, because I can't just look at indentation and see what corresponds to what. (Especially so with 4 nested ifs, loops, etc) With bracketed languages, however, I can just keep a count of brackets in my head and always know where I am. Though I'm afraid that I do at least have to agree on the multiple ways of bracing. I much prefer method C in your descriptions, and method A I can deal with, but B drives me up a wall! Now if someone would devise a language with an extremely solid OO structure, good garbage collection, easy interfaces to C libraries, and most importantly, forced type C bracketing, I'd be in heaven! :) I pretty much agree with this. I want the braces, in order to be sure that I've read it in the same way as the compiler will. Personally I use method C, partly because I think it looks neater and partly because it uses fewer lines, so you can get more code on the screen at a time. As far as reading other people's code is concerned, as long as the block between the braces is indented - which it invariably is - I don't let the positioning of the braces worry me too much. But I do insist on the braces being there! The Python method fails for me on several counts: - There isn't an explicit end-of-block delimiter. A tab to start a block; what ends it? A tab that isn't there? Yuck. As a long-time Python programmer, I must say, Huh?. What's so hard about this: i = 1 for i in range(10): i = i * i print i - The delimiters are not visible characters. I want to *see* something that says the block STARTS HERE and ENDS HERE. { and } are fine. begin and end are OK. if-then-else-fi, while-do-done and the like are bearable, though I prefer to use the same delimiters for everything. Having the actual meaning as seen by the compiler/interpreter change according to something as vague as how far across the screen the line starts just fills me with a total lack of confidence that the code is going to do what I want. Indentation is great as an *aid* to *human* reading of the code, but for it to actually control the flow of execution is RIGHT OUT. You'd get used to The Python Way really quickly. Everyone does. - A corollary of this is that non-visible characters get munged. Yes, I know this *shouldn't* happen, but it *does*. Too many passes through stupid software that performs bad end-of-line translation between LF / LF-CR / CR when it shouldn't, and you end up with a file with its line structure wiped out. With explicit delimiters, it'll probably still compile, and it's not too hard to whack line breaks in at appropriate points to make it more-or-less readable. With delimiting based on whitespace and line breaks, you've had it. That happens occasionally, but most, going on all,) Python program- mers set their editor config files to this: set expandtab set shiftwidth=4 set tabstop=4 set smarttab - A personal subset of this is that I HATE TABS! Each different As do all Python programmer. See above paragraph. Guess I'll be sticking to C for a while yet... Try Python. You might like it. Really! -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Experience should teach us to be most on our guard to protect liberty when the Government's purposes are beneficent. Men born to freedom are naturally alert to repel invasion of their liberty by evil-minded rulers. The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning, but without understanding. Justice Louis Brandeis, dissenting, Olmstead v US (1928) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
On Fri, 2003-08-29 at 03:35, Anders Arnholm wrote: On Thu, Aug 28, 2003 at 01:32:07PM -0500, Ron Johnson wrote: On Thu, 2003-08-28 at 11:06, Alan Shutko wrote: Anders Arnholm [EMAIL PROTECTED] writes: So, basically, you don't like Python because your text editor is junk. Fix it or go find a real editor! Heck, vim in default mode (no syntax coloring) is Good Enough. Thats about what I'm using, but vim i cmode is aloot more powerful tool to C programing than vim in Python mode. Yeah, for things like braces-matching. But the need for that is eliminated in Python... -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Those who would give up essential Liberty to purchase a little temporary safety, deserve neither Liberty nor safety. or something like that Ben Franklin, maybe -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT: Why is C so popular?
At 2003-08-29T05:54:01Z, Paul Johnson [EMAIL PROTECTED] writes: I seem to recall the entire point of C++ was to be C with some extra stuff, as told by the creators. Wouldn't it make sense to think the same way? Yes and no. I mean, it's still the same basic language with the same operators, function call syntax, etc. However, designing a truly OO program in C++ is totally different than writing a procedural version in C. That's why I've heard recommendations that people who don't know either language, but who want to use C++, should learn C++ first to avoid becoming too accustomed to the C way of doing things. -- Kirk Strauser pgp0.pgp Description: PGP signature
Re: OT: Why is C so popular?
On Thu, 2003-08-28 at 22:15, Jacob Anawalt wrote: Steve Lamb wrote: On Wed, 27 Aug 2003 23:52:35 -0600 Jacob Anawalt [EMAIL PROTECTED] wrote: [snip] Hence it is not other people's style I dislike, it is the freakin' braces. Good thing there's Python for you and other !brace people then. Maybe someday I'll catch onto the concept. For now, I'm OK with braces. :) I had only posted this because the full message had a complaint about it taking hours to debug C code because of the inconsistancy in indentation/placement of braces. My solution for that has been $ indent horribly indented code.c. And then when you check the file back into cvs, it grinds away at a whole-file differential... The solution, though, is an Organizational Standard that must be followed. -- - Ron Johnson, Jr. [EMAIL PROTECTED] Jefferson, LA USA Spit in one hand, and wish for peace in the other. Guess which is more effective... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]