Discussion in 'C Programming' started by Ioannis Vranos, Mar 10, 2008.

  1. Ioannis Vranos

    Richard Guest

    K&R style is easily the most maintainable and easiest on the eye I have
    ever used. It just "makes sense. header, body, footer. e.g

    Richard, Mar 10, 2008
    1. Advertisements

  2. LOL. I prefer the "more sense" to me

    /* ... */

    style. :)
    Ioannis Vranos, Mar 10, 2008
    1. Advertisements

  3. Perhaps he formatted his hard disk at some time, and his backup was a
    bit old...
    Ioannis Vranos, Mar 10, 2008
  4. Ioannis Vranos

    santosh Guest

    This tends to waste vertical space. I tend to prefer your style for
    function's opening and closing brace and use the K&R style for other
    purposes, except for code blocks.

    if (condition) {
    /* ... */
    else {
    /* ... */

    /* some code */

    santosh, Mar 10, 2008

  5. More space sometimes means more readable.

    I like complete consistency myself. You know how this stuff goes,
    everyone has his/her style.
    Ioannis Vranos, Mar 10, 2008
  6. santosh said:

    That's the disadvantage (for those who consider it so, of whom I am not
    one). The advantage (for those who consider it so, of whom I am very
    definitely one) is that the braces very obviously line up with each other,
    visually reinforcing one's perception of the block scope.

    Richard Heathfield, Mar 10, 2008
  7. Ioannis Vranos

    Default User Guest

    Yeah, I was unaware that vertical space was in short supply.
    My personal preference is Whitesmiths style:

    /* code */

    The braces are part of the compound statement, and I like them at the
    same indent level as the code.

    Alas, the coding standard we use these days prefers your style, so I'm
    shifting even my personal code to that style.

    Default User, Mar 10, 2008
  8. snip

    Keith this wouldn've worked before c99. What did people do before C99 ? In
    C89 if I'm right there was no time.h or time_t type. This answers a previous
    question of mine.

    Bill Cunningham, Mar 10, 2008
  9. Both the <time.h> header and the time_t type are present in C89.
    Harald van Dijk, Mar 10, 2008
  10. Ioannis Vranos

    Randy Howard Guest

    Somewhere, in a dark whole, is someone still left on an 80x25 terminal.

    Get a widescreen monitor that supports rotation, and run it vertically.
    All the vertical space you need and then some.
    Randy Howard, Mar 10, 2008
  11. There's no way in hell you're a professional programmer bound by any
    coding standard at all - with your idiotic attitude you'd be drummed out
    of any shop I've ever experienced before you could say "don't top post".
    Antoninus Twink, Mar 10, 2008
  12. Is srand(time(NULL)); an effective solution for seeding rand(), or is
    If you use this approach to generate random numbers for a game of chance
    (such as, say, blackjack or craps) and make it available to the public
    to play for real money, you're going to go bankrupt.

    This is true for this method of seeding _any_ pseudo-random number
    Gordon Burditt, Mar 11, 2008

  13. What is your suggestion?
    Ioannis Vranos, Mar 11, 2008
  14. Although the commandment talks about parameters, I can't
    help but notice the parallels with advice given to those
    who cast malloc in clc.

    No conforming compiler is allowed to _enforce_ prototypes,
    but those who deliberately prefer to use compilers with
    broken conformance in this regard are chastised heavily
    for doing so.
    Peter Nilsson, Mar 11, 2008
  15. Ioannis Vranos

    santosh Guest

    Bill Cunningham wrote:

    No, both time.h and time_t were there in C89. And the same method that
    Keith explained will work for all versions of standard C.
    santosh, Mar 11, 2008
  16. Is srand(time(NULL)); an effective solution for seeding rand(), or is
    Use specialized (and probably expensive) hardware based on physics
    that is currently believed to be true random due to quantum effects.
    This includes things like detection of radioactive decay and thermal
    noise of a reverse-biased diode. Some processors (certain models
    of Intel Pentium) have this built in, but I'm not sure how good it

    Also, use a seed much bigger than 32 bits. And you probably want to
    use the time down to picoseconds.

    Keystroke timing probably doesn't alone provide enough randomness
    for online gambling with real money.
    Gordon Burditt, Mar 11, 2008
  17. Ioannis Vranos

    Morris Dovey Guest

    Hmm. I see a light up there. Hellooo?

    The link below leads to my latest project. Scroll to the bottom
    of the page...

    Morris Dovey, Mar 11, 2008
  18. Ioannis Vranos

    Default User Guest

    I still use them when I telnet in places. That just seems the "right"
    size for that.

    Default User, Mar 11, 2008
  19. Ioannis Vranos

    santosh Guest

    Well, for my personal programming I prefer 80x25 text mode, because I
    find that it minimises eye strain. I also prefer text mode due to long
    years with DOS and UNIX (without X).

    Most workplaces here are still full of old CRTs with terrible flicker,
    set inappropriately to something like 1024x768, minimising the refresh
    santosh, Mar 11, 2008
  20. [/QUOTE]
    It was too small 30 years ago and it's too small now.

    -- Richard
    Richard Tobin, Mar 11, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.