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

What C does /prog/ prefer?

Name: Anonymous 2010-08-28 19:43

[ ] K&R C
[ ] C89
[ ] C99
[ ] C1x

Name: Anonymous 2010-08-29 21:29

>>40
How do you deal with dynamic input, then?

inb4 Terribly!!

Name: Anonymous 2010-08-29 22:24

>>22 is right.

Name: Anonymous 2010-08-29 22:35

>>41
Text input is text, and numbers are numbers. Anything more complex than that is sent to a library.

Name: Anonymous 2010-08-30 9:25

>>43
Then how does the library deal with dynamic input?

Name: Anonymous 2010-08-30 10:50

C#

Name: Anonymous 2010-08-30 13:06

>>45
crappy proprietary language with platform lock-in is crappy

Name: Anonymous 2010-08-30 13:26

C99. The features I use over C89 are mixed declarations (and for loop declarations), inline, restrict, sepples comments, incomplete structs, and variadic macros.

Name: Anonymous 2010-08-30 13:27

>>47
Oh also, I use -Wc++-compat so it can be compiled as sepples on a certain compiler that doesn't support C99... :(

Name: Anonymous 2010-08-30 15:09

The only defensible aspect of C99 is the restrict keyword. I don't agree that it should be the programmer's job to micromanage compilers like that (and I'm violently opposed to the inline keyword), but having compilers figure this out automatically is equivalent to solving the halting problem.
Anyone who uses Sepples comments should be shot, by the way.

Name: Anonymous 2010-08-30 15:21

The only defensible aspect of C99 is the restrict keyword.
What's wrong with designated initializers, compound literals, and exact-width integer types?

Name: Anonymous 2010-08-30 15:27

>>49
Anyone who uses Sepples comments should be shot, by the way.
And why's that?

Name: Anonymous 2010-08-30 15:28

>>50
you forgot

for (int i = 0; ;)
    ;


just kidding. that is fucking disgusting.

Name: Anonymous 2010-08-30 15:31

>>52
Yeah, restricting scope to where a variable is actually being used sure is dumb.

Name: Anonymous 2010-08-30 15:34

>>50
designated initializers
If you're going to initialise something, initialise all of it. If you can't, it shouldn't be a single entity.

compound literals
They're less readable than doing the same thing with named functions or macros, because they overlap with existing syntax. They provide no benefit, they just make bad code cheaper.

exact-width integer types
POSIX already provided these.

Name: Anonymous 2010-08-30 15:44

If you're going to initialise something, initialise all of it. If you can't, it shouldn't be a single entity.
So you're saying
struct some_struct x;
x.a = &a;
x.b = NULL;
x.c = NULL;
x.d = NULL;

is better than
struct some_struct x = { .a = &a };
?

They're less readable than doing the same thing with named functions or macros, because they overlap with existing syntax.
Sure,
int a[] = { 1, 2, 3, 4, 5 };
/* 5 completely unrelated lines of code */
some_function(a);

is so much more readable than
some_function((int [5]){ 1, 2, 3, 4, 5 });

POSIX already provided these.
Not everyone wants all of POSIX, and exact-width integer types are very useful.

Name: Anonymous 2010-08-30 15:48

Answer the >>51‭, Xarn. And you you say something about Sepples comments being not portable and not supported in every compiler, I'm going to laugh.

Name: Anonymous 2010-08-30 15:52

>>53

#include <stdio.h>

int main(void) {
    {
        int i = 0;
        for (; i<10; ++i)
            puts("HAX MY ANUS");
    }
    return 0;
}


C doesn't need a shitty Java-like syntax-extension to do this.
your argument is invalid therefore, ``faggot''.

Name: Anonymous 2010-08-30 15:56

>>55
So you're saying
struct some_struct x;
x.a = &a;
x.b = NULL;
x.c = NULL;
x.d = NULL;
is better than
struct some_struct x = { .a = &a };
?

No, I'm saying both are signs of profound incompetence, and providing syntactic sugar to do it is retarded.

Sure,
int a[] = { 1, 2, 3, 4, 5 };
/* 5 completely unrelated lines of code */
some_function(a);
is so much more readable than
some_function((int [5]){ 1, 2, 3, 4, 5 });

You're an idiot who can't read.

Not everyone wants all of POSIX, and exact-width integer types are very useful.
Every single platform provides them already. I said POSIX because that's what every sensible person uses anyway. Nobody gives a fuck about Windows users, and Windows users don't use C.

And embedded programmers are a red herring. You aren't one and don't know any.

Name: Anonymous 2010-08-30 15:59

>>56
You know Xarn doesn't like Sepples comments, but you don't know why? How did you manage that?

Hint: it's about making newlines syntactically significant, idiot.

Name: Anonymous 2010-08-30 16:03

>>56
What Xarn actually said about C99 versus C89 is this:

C99 isn’t all bad, and some of the changes were long overdue, but given a choice, I slightly prefer C89.

Name: Anonymous 2010-08-30 16:20

>>55
struct some_struct x;
x.a = &a;
x.b = NULL;
x.c = NULL;
x.d = NULL;

Do you realize struct some_struct x = {&a, NULL, NULL, NULL}; is perfectly valid C89?

Name: Anonymous 2010-08-30 16:35

>>61
Yeah, until someone changes
struct some_struct { int *a, *b, *c; char * d; } to struct some_struct { char *d; int *a, *b, *c; }

Name: Anonymous 2010-08-30 16:45

>>62
And C99-style {.a = &a} breaks when someone changes the type of .a. What's your point? If you break things, things are going to break.
Really, they should break.

Name: Anonymous 2010-08-30 16:52

>>63
It's reasonable for things to break if you change the type. It's not reasonable for things to break just from changing the order.

Name: Anonymous 2010-08-30 16:57

>>64
Of course it fucking is. What the fuck is wrong with you?

Name: Anonymous 2010-08-30 17:16

The sooner C is replaced by C++/CLI, the better.

Name: Anonymous 2010-08-30 17:20

>>66
anyone using C99 might as well be using C++

Name: Anonymous 2010-08-30 17:21

>>65
He's used to Java.

>>64-chan, structs aren't dictionaries. It's not reasonable to expect them to behave as dictionaries. If you want that kind of behavior, stick to high-level languages.

Name: Anonymous 2010-08-30 17:32

>>59
Someone doesn't know about C's macro system.

Name: Anonymous 2010-08-30 17:34

>>67
Using C99 keeps the C++ programmers out, that's a big win to me.

Name: Anonymous 2010-08-30 17:34

>>67
Has anyone ever told you that you are not a very good troll? They probably didn't want to hurt your feelings, but someone really should have said something. The next time you see your friends, tell them it's not cool to let you continue to make a fool out of yourself.

Name: Anonymous 2010-08-30 17:53

>>69
Do we really have to have this discussion again? The C preprocessor and the C language are two different things.
And the argument you're about to try to make that a lot of compilers remove C language comments in the preprocessor rather than in the compilation stage is missing the point entirely.

Name: Anonymous 2010-08-30 20:42

>>72
The argument I'm about to make is that you're an ignorant buffoon who don't know what you're talking about, and that the distinction that you are trying to make is one which neither compiler writers nor users care one iota about, leaving you quite alone.

Name: Anonymous 2010-08-30 21:04

>>73
I'm not sure what you think ``ignorant'' means, but maybe you should look it up before you try to use it again.

Name: Anonymous 2010-08-30 21:14

Checking whether your C compiler can cast large floats to int32.
Checking whether your C compiler can cast negative float to unsigned.

Name: Anonymous 2010-08-30 21:49

>>74
What's the matter, too pleonastic for you? Then I shall strive to inform you of your incompetence more succinctly in the future.

Name: Anonymous 2010-08-30 22:36

>>76
``Pleonastic'' is another one you should look up.

Name: Anonymous 2010-08-31 5:00

>>74,77
Fuck off, Xarn. >>73‭-kun's use of §§ignorant'' was acceptable, if pleonastic.

Name: Anonymous 2011-03-21 13:25


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