C

Beauty through perfection via simplicity

Attached: C.jpg (900x900, 60K)

Other urls found in this thread:

open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
cdecl.org/
codepad.org/sd6kLwkJ
en.wikipedia.org/wiki/ParaSail_(programming_language)
twitter.com/SFWRedditImages

Isn't that the see-sharp logo?

c is a language which is simple to imlement and simple to design. but c programs are not simple by any means. this is why the world's greatest c programmers routinely make huge errors that lead to massive security problems. c is not perfect, beautiful, or simple. unless you are implementing a c compiler, i guess

Outdated dinosaur language only used for maintaining legacy codebases.

>the world's greatest c programmers routinely make huge errors
nah, that's a meme
the real villain is the average programmer who knows just enough to work on big C projects but not enough to avoid all the possible pitfalls

so your conception of reality is that average and little known c programmers contribute code to large scale critical open soruce c projects, the code is then never audited by the 'really good' c programmers, and it just goes in the project, and this explains the routine security holes in programs like ffmpeg

Like linux kernel codebase.

Will be replaced by Fuchsia.

>perfection
How's that array decay, null termination, and pointer arithmetic all working out for you?

Neither apply to C. Try Forth instead.

Declare a function that takes an int and returns a function pointer to a function taking a double and returning void, without using typedefs and macros.

Come on, let's see this beautiful and simple language.

>not a legacy code base

the average programmers greatly outnumber the master programmers, and they also produce more code which only goes through basic checks because there's not enough time and/or eyeballs
many critical bugs only get exposed during audit
it's basic problems of scaling, really
>ffmpeg
ffmpeg has a massive attack surface simply due to its nature of being a framework that you plug foreign code into and it does its thing
that being said, ffmpeg is actually pretty decent at fixing bugs compared to the alternatives

Doesn't even qsort do that?

i think you are just changing the definition of who is a master c programmer and who is merely average to escape the criticism that the c programmers who are responsible for maintaining critical projects like these should not be the kinds of programmers who make these sorts of mistakes.

my original point is that c is not a simple language. its only simple to implement and design... actually writing c is much more complex than other languages, because it doesn't offer the tools other languages offer to deal with complexity.

if c is a simple language, so is assembly, or machine code

lol, why can't they use language features like macros or typedefs to do this? or those features not a part of c according to your standard?

>193 undefined behaviors
Picture unrelated?

>see-sharp

Attached: is-this-bait-19556929.png (500x410, 18K)

>the order in which you write #includes can influence the way your program works
Defend this.

Typedefs are, macros technically aren't, but if you need them to declare that in a readable manner, C's "simplicity" crumbles.

Inb4 hordes of Cniles start defending C declaration syntax even though dmr is on record saying it's one of the mistakes of C.

>no template metaprogramming
dropped

so you're the c preprocessor isn't a part of the c standard? thats pretty crazy lmao what makes you say that

>int* is a type but int* a, b doesn't declare two pointers like it should
Defend this.

The preprocessor is technically not part of the C language itself, just like printf isn't, since it is a function defined in the standard library. The former is a separate program executed before actual compilation takes place, that simply performs raw text substitution.
That's why I'm interested to see how that declaration looks using nothing but core language constructs, preferably without aliasing types.

Not only that, they even said in K&R that "C is often castigated for its declarations".

int *a, b;

I know what it does, I asked for the rationale of this.

> The preprocessor is technically not part of the C language itself,
Oh yeah? You sure? You sure you aren't talking out of your ass and lying to me?

Heres the c99 iso standard:
open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
You're telling me that this document verifies what you're saying?

" perfection is achieved, not when there is nothing left to add, but when there is nothing left to remove"

That's like saying Assembly is perfect because it is simple.

>the rationale of it not being to my liking.

By that logic C is flawed as fuck.
So they made C specifically for me to dislike it, gotcha.

int* a, b;

Does that make more sense

You may dislike cute girls and like dick instead, but does that make us care? No.

I'll give it a crack

void (*f(int n)) (double);

nah m8

quit blamin letters on ur problems lol

star sticks to variable not type, so it makes less sense

wellp, beats me, dat spiral rule dun work

what is it btw?

>star sticks
the fuck are you talking about

You're defining two integer pointers. A lot of people seem to use the syntax int *a; when defining pointers, but to me it makes less sense.

if you write it as int* a; you can clearly see the star is being "applied" to the data type, so it is an 'integer pointer'.

It also helps differentiate it from when you're dereferencing a pointer with *a = (some value here)

my two cents on the styling

Attached: photo_2018-11-19_19-30-40.jpg (750x1199, 73K)

I don't know desu I didnt bother to learn the left right rule shit.

All I know is the syntax for a function pointer is like
return_type (*name_of_function)(function_argument[s])

Declaration follows use. It's not hard faggots.

cdecl.org/

wish I had this two days ago thanks fag

>C
>simplicity

>you can clearly see the star is being "applied" to the data type
the star is a part of the declarator not the base type so it makes more sense to group it with it imo. if you group it with the base type then there's confusion as in the example of
int* a, b;

As far as C is concerned int* is a real type. Except when you declare variables, then it's not a type.

The following code does not define two int pointers. It defines one int pointer and one int. You're confusing things with a sane or well designed language. No, faggot, this is C.
int* a, b;

Oh and if you typedef int* intptr everything works as it should.

You need to do *a and a to distinguish between the two - one's a pointer, the other the actual variable/constant (or rather the former is technically a pointer to a pointer and the latter a pointer but whatever C's nomenclature is kind of stupid). Otherwise when typing int* a someone might get initially confused as to what you actually mean, and lost time is lost production time.

mate I think yer tellin me finonaccis

and here's the photo to support dis suspicion of mine:
codepad.org/sd6kLwkJ

yep, butt naked with the girly

oh shit, if u right then yea that's retarded

I'll just avoid defining two variables in one line then, miss me with that gay shit

whats a more redpilled language then

lisp

Ada, of course. Systems/embedded language designed by the US DoD to stamp out as many bugs as they could at compile time and to produce easily maintainable code. Hackers hated it. Engineers writing code that must be correct or people die, on the other hand, love it.

ya so you just pop the parameter list after the name but within the brackets, to make that the return type of the named function whose parameters are in da list you just popped in

da return type gone roun da outside, roun da outside, roun da outside

bip bip bawww bip bip baww

dat LA Calcaless go rown da outside rown da outside rown da outside

cappacino?

BASIC

Attached: 8QUEENS_SCRIPTBASIC.png (556x504, 21K)

>Ada
have it "next generation proprietary memory allocation techniques"?

C could be a very simple and elegant language. Could.

Could you rephrase that in English please?

Nah, standard practice in Ada is to use the stack, standard container libraries and RAII to avoid worrying about heap allocation. It's amazing what you can put on the stack with a cooperative language. Next gen memory allocation techniques are found in Parasail instead, which also has next gen implicit parallelism but sadly isn't quite ready for primetime.
en.wikipedia.org/wiki/ParaSail_(programming_language)

Yes, exactly, since that very document rightfully states that the preprocessor and actual compilation take place at different translation phases. It comes to no surprise that preprocessing directives have an entirely different grammar.

yea, now dis guy knos da score

"C is a razor sharp tool with which you can write good code or create a bloody mess"

or somethin to that effect

AN DAT AINT ME TALKIN DATS DA MAN BRIAN KERNYAN

bip bip baww

There's no reason for a preprocessor to be a different language. See Lisp.

>Beauty
no
>perfection
no
>simplicity
no

based hiphop bipbop baww poster

>heap allocation
is it use "next generation proprietary memory allocation techniques"?
very important question!

So readable. In C++, it's simply
auto foo(int x) -> auto (*)(double) -> void;

When will C reach at least C++ levels of simplicity and clarity?

Yes, but we are not talking about Lisp right now.

Ugly convoluted inconsistent mess that everybody seems to use despite all that. English of programming languages.

that's pig disgusting

What is a cooperative language? Like coroutines and continuations.

>the cnile unironically thinks void (*f(int n)) (double); is better
Just admit you have Stockholm syndrome.

>C++

enjoy (You)r "next generation proprietary memory allocation techniques"

hahaha good one ya business boi retoid, come back when yer fisher's price virtual studio license EXPIRES and ur down to ur ankles in notepad, cmd, and mingw ready to cast the frills aside n write sumthin serious

bip bip bawww bip bip bawww

I'm not the guy making that claim.

Protip: most programmers lack the IQ and abstract thinking skills to write fast, efficient, secure, and reliable code. Even those that possess these talents are often under obscene management demands and timelines such that their work suffers.

High level languages allow for lesser skilled people with inferior educations to work in the industry at wages which undercut those who could engineer brilliant systems. General degradation in code quality (efficiency; reliability; security) over time has tracked this trend. I've been in the industry long enough to have witnessed this first hand, and it's truly depressing. Today's web pages are more bloated than OSes from the 90s, and perform simple tasks so slowly that they can choke processors capable of sustained multi-billion instructions per second operation.

tl;dr - it ain't C. The problems would exist even in those cases where you could substitute a higher level language for C (which is not often the case with lower level code).

Why can't we just

var a:int;
let b:int = 0;
let f:(a:int,b:int)->(int,bool){return (0,false)}

What the fuck why????? Fucking C.

>cant use C cause its too full of shit like that
>cant use C++ because it has even more bloat and shit
What do I do bros? I need C except it gant be actual C oe C++. Is there a C+—?

Also semicolons could be removed, they tell nothing the compiler doesn't know already.

Semicolon insertion is dangerous. Look what it did to Javascript.

>Semicolon insertion is dangerous
how
people are only clinging to this shit because of tradition

>wanting to declare 20 variables on one line
Declare each variable on its own line. It's easier to read, easier to search, and easier to edit.

>Protip: most programmers lack the IQ and abstract thinking skills to write fast, efficient, secure, and reliable code. Even those that possess these talents are often under obscene management demands and timelines such that their work suffers.
That is not an excuse to keep using a language that deliberately makes it hard to do so. Being "difficult" in itself is not an intrinsic merit.
The question is, what does this difficulty ultimately achieve?
And the amswer is, nothing that can't be done in other languages.
The truly smart programmers recognize this and use the language that allows you to achieve your goals with the least effort, not making their life harder for its own sake.

>tl;dr - it ain't C. The problems would exist even in those cases where you could substitute a higher level language for C (which is not often the case with lower level code).
Not true. Stuff like the existence of null pointers and null-terminated strings are intrinsic flaws that hinder safety.

foo()
{
return
{
bar : "baz"
}
}

Forgot the function keyword at the start. And it's JavaScript of course.

Eh, a variant of Pascal. A good choice, but assignment should be something other than =,

what is that supposed to illustrate?

they're both fugly

Named argument and return values fit this kind of declaration like a glove, and named returns are very useful for tuples.

>cnile
what does this slur mean and is it one incredibly butthurt person posting it over and over again or has it actually caught on?

C-- is a thing. Except its not really a thing. I think its for writing compilers?

>C--
useless

It means senile, Ranjesh.

Senile. C programmers are old boomers who cannot learn something newer and better.

It should be obvious. It means all you boomers who go around using an ancient 70s language are old and senile.

Attached: brainlet.png (645x729, 77K)

>useless
have you tried it? What was wrong with it?

senile isn't a noun Pajeet

Proving the memer's point.

Its just a DSL made by Haskelltards to write their own compiler