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

What would you change in C?

Name: Anonymous 2009-08-26 13:44

It's the time for the next revision of the C standard and for some reason they want your advice. What do you add, remove, rename, etc ?

Name: Anonymous 2010-04-29 12:01

>>120
C already has that, you dumbshit: #undef hello.

And right, if you don't use a constant in a switch it's no more efficient than if.

ITT people who need to learn fucking more about compiler design.

Name: Anonymous 2010-04-29 14:39

>>92,120
As >>120 speculates using constants produces much faster code. I remind myself of this every time I am inconvenienced by it. (The problem isn't so much evaluating a matching expr here or there, it's in eliminating it when it doesn't match--you might as well if-else if- cascade performance-wise. There's also the issue of expression overlap which muddies the notion of a switch, but that's just a nit.)

Name: Anonymous 2010-04-29 15:54

There’s this thing that’s alwasy bothered me… Why in the world do I have to end a struct or enum declaration with a semicolon? The declaration is already enclosed in curly braces, no need for anything more than that.

Name: Anonymous 2010-04-29 15:58

>>123
It's necessary because you can also declare with struct and enum, not just define. Besides that, semicolons terminate statements.

Name: Anonymous 2010-04-29 15:58

The language is fine, but the standard library sucks.

How can there be a FILE* and size_t types? unlink function? Are you kidding?

Why do I need to use an upper–level library just to get some consistency?

Name: Anonymous 2010-04-29 16:19

Make all numbers hexadecimal by default, and digital only if you put 0d in front of them.

Name: Anonymous 2010-04-29 16:48

Make all numbers binary by default, the only other allowable numeric format/representation will be base64

Name: Anonymous 2010-04-29 16:58

>>126
You should try Common Lisp.
You can do this just by setting or binding *read-base*/*print-base* to 16 and maybe *print-radix* to t(only set those that you want. print is for output generated by your application, read is for read input, which also includes the source code which is to be compiled. *print-radix* will allow the base to be included in the output, #x for hexadecimal). I used to try setting them both to 16, but that proved to be a bad idea, some variables got treated as numbers (think of :a,b,c,d,e,f,ab,deadbeef,fade,babe, etc). It's best that hexadecimal numbers be prefixed by something, so that that they don't conflict with normal indentifiers. So currently, I don't rebind/set *read-base* unless I absolutely need it, and I know it would be safe. I do however set *print-base* to 16 and *print-radix* to t, as I prefer numbers to be printed in hex by default.

Name: Anonymous 2010-04-29 17:01

>>126
digital
That's not the word you were looking for.

Name: Anonymous 2010-04-29 17:01

>>126
I like this idea. Well, a little.

Name: Anonymous 2010-04-30 5:10

>>121
I know you can undef, I want scopes so I don't have to have as many damn undefs as my defs.

Name: Anonymous 2010-04-30 5:11

>>131
Oh and I know you can achieve this already by separating files, but sometimes I like having files with more than 1000 lines of code in them.

Name: Anonymous 2010-04-30 5:39

Make all numbers hexadecimal by default, and digital only if you put 0d in front of them.
so numbers would be analog unless they have 0d in front of them?

Name: Anonymous 2010-04-30 8:38

The only thing C needs, really, is native quaternion support.

Name: Anonymous 2010-04-30 9:16

>>134
I also miss unicode support and/or TeX-like markup, so I could name my variables \psi and \lambda and my editor would show them as proper symbols, ideally even storing them in the file as such (i.e. UTF-8 encoded). Without this C just feels slightly antiquated and inadequate for my specific requirements.

Name: Anonymous 2010-04-30 9:36

Little thing with a few example includes I'd like to see:
Also, this is mostly taken from C++ and Python
/********
** ++C **
********/

// Types - string?
//    native comparison
string foo = "FOO!!!"
string bar = "BAR!!!"

if(foo == bar) { //True
   foo[0] = 'B'; // Still accessable as a char array
   printf("%s\n", foo);
}

if(foo < bar) { //False, 'O' > 'A'
   printf("LOL HIGHER\n");
} else if(foo != bar) {
   printf("Example Password: %s DENIED\n", bar);
}


// Types - bool
//    simple single-bit variable
bool example = 0; //1-bit taken
bool exampletable[20] = 0; //20-bits taken

// bool exampletwo = False;
// True and False are not keywords, only ints 0 and 1 for bools


// Single-line comments:
// just because of the useful


// Namespaces:
//  #insert <namespaces.cpp>
namespace lol {
   int epic_lulz;
}

lol::epic_lulz = 2;

using namespace lol;
epic_lulz = 9001;


// OOP
class board {
   init:
      // I like the 'init:' header, but this will
      //  need to be changed in order to work properly
      initclass(int boardCols, int boardRows) {
         int boardX = boardCols;
         int boardY = boardRows;
      }
        
   private: //As C++, but can use vars from init:
      int boardX;
      int boardY;
     
   public: //As C++, but can use vars from init:
      bool board[boardX][boardY];
     
}

class board gol(20, 30);
gol.board[18][2]

Name: Anonymous 2010-04-30 9:39

>>135
IIRC there's nothing in the standard that says that source files can't be UTF-8, and your "TeX-like markup" is an editor misfeature, not part of the language.

Name: Anonymous 2010-04-30 10:49

>>136
Several of these features ruin C for the tasks where it's the most useful.

If you want a high level language, start with Python, Lisp, or Haskell.

Name: Anonymous 2010-04-30 11:09

>>136
Fucking AIDS.

Name: Anonymous 2010-04-30 11:32

>>137
You should read the standard again. Identifiers cannot contain unicode (or backslashes, incidentally).

Name: Anonymous 2010-04-30 11:38

>>140
IDENTIFY MY ANUS

Name: Anonymous 2010-04-30 13:09

>>138
I'd rather start with J.

Name: Anonymous 2010-04-30 13:15

>>136
Improvements you'd like to see for C that are taken from Sepples? GENIUS!

Name: Anonymous 2010-04-30 13:27

- Add integral types of specific sizes int16, int32 etc.
- binary literals e.g. 0b101010

Name: Anonymous 2010-04-30 13:38

add directx to the standard lib so u can use it to make games
make it so u dont have to remember the ; everywhere, when its a new line it should now what i mean lol.

Name: Anonymous 2010-04-30 13:56

>>145
when its a new line it should now what i mean lol.
C99 already added significant whitespace, so it's a small step.

Name: Anonymous 2010-04-30 14:48

>>136
single line comments are already in C99

>>144
integral types of specific sizes are specified in C99's stdint.h
also, not sure why you would need binary literals; hex representation is so much nicer and I can do the conversions in my head

Name: Anonymous 2010-04-30 15:17

>>146
C99 has FIOC? Explain.

Name: Anonymous 2010-04-30 15:54

>>148
Significant whitespace doesn't necessarily mean FIOC. Assuming that >>146 is Xarn, then his complaint is probably // comments

Name: Anonymous 2010-04-30 21:26

>>149
Which everyfuckingcompiler has had as an addition to C syntax nearly forever.

Considering even BCPL had // comments, I'm not sure what the point was of not having them in C in the first place.

Name: Anonymous 2010-05-01 9:04

>144
- typedef some stuff in your global.h
- gcc already added that extension

Name: Anonymous 2010-05-01 12:12

>>151
You don't even need typedefs, just use stdint.h ffs

Name: Anonymous 2011-02-03 0:08

Name: Anonymous 2011-02-04 12:01

Name: Anonymous 2012-02-23 22:42

c would be perfect if it had perl-like hashes.

Name: Anonymous 2012-02-23 23:06

>>156
It doesn't mix very well. Any kind of advanced language construct with an opaque implementation in C gets all fucked up and weird when combined with all the low level weird shit you can do in C. C by itself can be complete and make sense. If you want better features, you can delegate them to a library and use some advanced data types. Then if you want to, maybe introduce some syntactic sugar that would translate to use of the library.

Name: >>157 2012-02-23 23:07

>>156
in short, use C with nice libraries and a nice macro system.

Name: Anonymous 2012-02-23 23:57

s-expressions

Name: Anonymous 2012-02-24 5:06

I agree, c#/.net is bullshit for web (public internet) development, JS+PHP is superior here.
But for Internal networks in companies, c# is pretty good.
Microsoft regularly provides security updates, tech support is important for companies, and C# can provide an easy and secure server-client model. No need for an external HTTP server.
Personally, I only use JS/Jquery/PHP/HTML for my public websites.
Not only because it's the best for it's job, but also because private persons can't really afford a windows server to host a homepage or web services.
And that's because linux, php and JS are free, and they do their job really good.
We conclude: Websites: HTML/JS/PHP, Web Services, Private Networks: May be in C# etc.

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