Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C style

Name: Anonymous 2011-05-31 17:44

Hey /prog/,

I know basic C and don't want a tutorial on pointers and that. I'm looking for a tutorial on style (e.g. it would be a nice idea to provide a <structure>_free function for any struct <structure>_t that I create, etc.) -- where can I find this? The GNU guideline doesn't discuss this.

Reading code might be an idea but I really wouldn't know where to start, and I could end up picking up bad style. So some kind of guide that you think is good would be nice.

Name: Anonymous 2011-05-31 17:46

Name: Anonymous 2011-05-31 17:51

>>1 check out the git source

Name: Anonymous 2011-05-31 18:10

>>1
C has no correct style, do what you want.

Name: Anonymous 2011-05-31 18:17

>>4
>implying any language has style

Name: Anonymous 2011-05-31 18:18

>>5
Lisp has a pretty natural style, Python forces his whitespaces down your throat until you choke on them and then rapes your dead body, Pascal, Java, C#, and other languages have a pretty ``standardized'' style (because their standard libraries don't suck as much as C's).

Also, go back to the imageboards.

Name: Fuck you, !Ep8pui8Vw2 2011-05-31 18:23

>>6
Lisp has a pretty natural style
AHAHAHAHAHA

back to the imageboards
Fuck off, ``faggot''.

Name: Go back to /b/, !uaVa00FkCs 2011-05-31 18:25

>>7
Go back to /b/, ``please''.

Name: Anonymous 2011-05-31 18:29

So, uh, say I still want to use C, what do I do?

Sure can't be the standard libraries' fault. Aren't there for instance "common idioms" on caller vs. callee doing memory deallocation?

Name: Anonymous 2011-05-31 18:30

>>8
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    █     ___                        █
    █    //  7                       █
    █   (_,_/\       WORSHIP THIS    █
    █    \    \   YOUR THROBBING GOD █
    █     \    \                     █
    █     _\    \__                  █
    █    (   \     )                 █
    █     \___\___/                  █
    █                                █
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Name: Anonymous 2011-05-31 18:38

Use whatever style that the projects you work on use.  If you are interested in GNU style, perhaps you can look at the source code for the GNU coreutils.

Name: Anonymous 2011-05-31 18:49

GNU coreutils
Worst C coding style ever.

Name: Anonymous 2011-05-31 19:06

>>12
While I agree, the OP mentioned the GNU Guidelines, so I decided to be productive rather than insult his tastes.

Name: Anonymous 2011-05-31 19:19

Uh yeah I just didn't know where to look. If there's other guidelines feel free to point them out.

Name: Anonymous 2011-05-31 20:37


    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    █     ___                        █
    █    //  7                       █
    █   (_,_/\       WORSHIP THIS    █
    █    \    \   YOUR THROBBING GOD █
    █     \    \                     █
    █     _\    \__                  █
    █    (   \     )                 █
    █     \___\___/                  █
    █                                █
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Name: Anonymous 2011-05-31 20:42


        ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
        █     ___                        █
        █    //  7                       █
        █   (_,_/\       WORSHIP THIS    █
        █    \    \   YOUR THROBBING GOD █
        █     \    \                     █
        █     _\    \__                  █
        █    (   \     )                 █
        █     \___\___/                  █
        █                                █
        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Name: Anonymous 2011-05-31 20:44

    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    █     ___                        █
    █    //  7                       █
    █   (_,_/\       WORSHIP THIS    █
    █    \    \   YOUR THROBBING GOD █
    █     \    \                     █
    █     _\    \__                  █
    █    (   \     )                 █
    █     \___\___/                  █
    █                                █
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Name: Anonymous 2011-05-31 20:44


    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    █     ___                        █
    █    //  7                       █
    █   (_,_/\       WORSHIP THIS    █
    █    \    \   YOUR THROBBING GOD █
    █     \    \                     █
    █     _\    \__                  █
    █    (   \     )                 █
    █     \___\___/                  █
    █                                █
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Name: Anonymous 2011-05-31 21:26

Name: Anonymous 2011-05-31 22:51

it would be a nice idea to provide a <structure>_free function for any struct <structure>_t that I create

Why?

Name: VIPPER 2011-06-01 3:50

You know its summer when /prog/ is shit.

Name: JORAGO MUSTAFO 2011-06-01 5:23

>>17-18
UM KWAT MUMFALA

UM KWAT MUMFALA

Name: Anonymous 2011-06-01 7:20

>>21
Oh fuck, it's summer~

Name: Anonymous 2011-06-01 8:02

>>23
lets go 2 teh bitch (taht means ur mom lol)

Name: Anonymous 2011-06-01 9:42

>>21
Would that mean it's always summer in /prog/?

Name: Anonymous 2011-06-01 10:18

>>25
Only when /g/, /lounge/, /b/, spammers and domyhoemworkzplzs take over /prog/.

Name: Anonymous 2011-06-01 12:06

>>21
SUMMER ALL YEAR ROUND

Name: Anonymous 2011-06-01 12:08

>>27
Good. Now you have the perfect excuse to wear your sisters black leggings out in public.  Because it's too warm to be wearing jeans.

Name: Anonymous 2011-06-01 13:00

It's ``bad style'' to name your structs <struct>_t, since POSIX reserves the use of *_t names.

Name: Autistic Duck 2011-06-01 13:20

>>27
ETERNAL SUMMER OF THE SPOTLESS PROG

Name: Anonymous 2012-07-13 1:16

>>23
lol u tk him 2da bar|?

Name: Anonymous 2012-07-13 2:01

>>12
GNU coreutils
Worst C coding ever.

Fixed

Name: Anonymous 2012-07-13 2:53

Good C style for a large project: Windows 2000

http://www.mediafire.com/?dkkqh480ervgewa

Name: Anonymous 2012-07-13 6:22

>>33
.zip.gz

Don't change these.
Name: Email:
Entire Thread Thread List