C considered harmful

I hate C and think it should be 99% banned. Fight me Sup Forums.

Other urls found in this thread:

en.wikipedia.org/wiki/Correlation_does_not_imply_causation
quora.com/How-do-you-declare-a-string-in-Java
en.wikipedia.org/wiki/Fast_inverse_square_root,
blog.llvm.org/2011/05/what-every-c-programmer-should-know.html
blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html
blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html
youtube.com/watch?v=lCUfGWNuD3c
redox-os.org/
twitter.com/NSFWRedditGif

Fight you?
You're 100% correct
We shouldn't allow software to be written in a virus prone language like C.

i love c and i think it should be banned too

You better shut up or else

don't you fucking do it

don't you fucking dare

Rust faggots need to be banned from the internet

OP here. Rust is garbage. Just use C++.

He's not gonna do it

You can ban C all you want. It doesn't respect your boundaries.

I WARNED YOU

...

Not gonna lie, former C programmer here. This is fucking hilarious watching C segfault and crash. But in all seriousness we can't let these buffers get more overflows.

No programming language, no matter how vulnerable of programs it is capable of producing, should ever be banned. Keep government regulations out of programming entirely!

Who said the government had to be involved? Fucking paranoid Americans.

underrated post

Let me ask you something... you want to "ban" programming in C. Okay. What happens when someone decides to program in C anyways despite your ban? What punishment should be given to them? What group should enforce said punishment? What should happen if programmers, by and large, decide to ignore your ban due to an inability to enforce it?

There is no association of telling programmers what they can and can't do. You can say programming in C is now banned, but that would be meaningless, because I can still type in this:

#include

int main(void)
{
char tinybuf[4];
gets(tinybuf); /* I'm so fresh you can suck my nuts */
return 0;
}

And now what? What are you going to do about it?

>And now what? What are you going to do about it?
Calling the cops enjoy your jail time and b&

...

Holy shit you are fucking retarded. It's as simple as saying, "No C in the repo, please." Companies can ban C easily.

>implying anyone is going to start rewriting kernels and libraries in Rust, D, or C++.
>implying anyone has an issue writing safe C except brainlets
McFucking kill yourself.

DUUUUUUUUUUUUUUUUUDE

>writing safe C
No such thing, the only way to write safely in ANY language is to type your shit in something like Coq and then export it to your target language.
t. professional C and OCaml shill

Github should forbid C projects and kick out the disrespectful Linux kernel developers that just milk their infra and contribute nothing back.

>retarded libertarian tripfag thinks "banned" means the Programming Gestapo kicking down your door and snatching your keyboard away
This is why nobody takes you seriously. You can only think in absolute, childish, paranoid fantasy.

Any reasonable person would interpret "banned" to be a standards body that says "Want to contract with us? Then no C allowed."

>only brainlets write vulns in C
why does Linus accept commits from brainlets, then?

>what is frama-c
>what is compcert

>something like
Also CompCert merely certifies the output is conforming to the sources (provided in bug in their frontend but at this point that's a very reasonable supposition). Don't try to fight me bro I spend my day getting shilled at INRIA

fuck off, we have this thread every day

1st amendment. Blow it out your ass.

That's not really a ban, that's just a company policy. And many companies already don't use C because their projects have no use for what C has to offer.

>standards body
>for programming
>that people actually give a fuck about
Excuse me while I laugh.

Underate and/or mentally handicapped spotted.

...

>implying anyone is going to start rewriting kernels and libraries in Rust, D, or C++
They should rewrite Linux in Python.

Ban C
delete all C books
fire C programmers

Is there any logical reason why you would fucking say that post is underrated? Has anybody expressed any kind of dissatisfaction or criticism at all against it? Are you delusional? Are you reading replies that are nonexistant? Maybe you come from communities with voting systems, but there is literally no way that you could know what other people think of that post you just replied to here. Maybe it's psychological. Maybe it's your own post you're replying to, like a 12 year old fucktard liking his own facebook posts thinking his swelling autism is going unnoticed. Maybe your self esteem depends on you tricking yourself into thinking someone out there thinks your post is worth something. Or maybe you are just a retard, the worst kind of retard, the one who thinks he's smart, the one who thinks he's the only one to have gotten the joke, to have understood the post. Well, guess what, faggot, that post is by no definition underrated so why don't you do the world a favour and go check out what the bottom of your toilet smells like?

It's simple. All C programs has to be rewritten in other safer languages. After gradually porting them to better and safer language we extarminate all C programs and books.

Sorry, my mom's husband taught me not to beat up retards.

I bet you think companies should also have COC.
Are you rust programmer?

I bet you think programs should have security vulnerability.
Are you a C todder?

git was made in C

Alright, I'll bite.

Why do you think C is harmful and should be banned? It's a powerful tool, and like any tool it can be misused. Banning tools just because they can be misused is retarded.

Ban everything except Intel x86 assembly. No abstractions allowed.

Because C is the source of all 0days in recend days

en.wikipedia.org/wiki/Correlation_does_not_imply_causation

Wordpress and PHP cause far more harm daily than all of the C buffer overflows combined.

>C is source
So, like a moron that you are you are blaming tools what about, actually making programmers accountable for their fuck ups?

0 days are caused by bad design, which is a vulnerability in *all* programming languages.
You might as well ban typos.

>0 days are caused by bad design
C doesn't provide 1 safety features to prevent vulnerability

Nonprogrammer here, been reading "Learn C on The Mac" while on the toilet for a few years. Have to say C as a language looks pretty sharp to me.

>Nonprogrammer
Found your problem. Go maintain a C program and you will know

>1 safety features
Go home, Pajeet.

Not an argument

>while on the toilet for a few years
You certainly have problems if you couldn't shit for a few years

Safety "features" are always result in restricting freedom.

If you want safety, go write all your programs in ADA. A couple days of writing code with your hands tied behind your back will show you what it means to pay the price of restricting freedom in the name of 'safety'.

It's like cutting up the rope you want to use to hold something, to prevent you from accidentally hanging yourself. See

>Safety "features" are always result in restricting freedom.
If you want occasional freedom, wrap them up with an unsafe block, no worries there
>If you want safety, go write all your programs in ADA. A couple days of writing code with your hands tied behind your back will show you what it means to pay the price of restricting freedom in the name of 'safety'.
Programming in C feels just like that. C lacks a lot of features that I shouldn't have to worry about in the current decade. I don't hate ADA.
>It's like cutting up the rope you want to use to hold something, to prevent you from accidentally hanging yourself.
Wrong analogy

I agree with you

What's wrong with tripfags faggot?

>If you want occasional freedom, wrap them up with an unsafe block, no worries there

I've got a better idea; don't write shitty unsafe code in the first place. The language always does what it's supposed to. It's YOUR responsibility as a programmer to use it in such a way that you don't shoot yourself in the foot.

>Programming in C feels just like that.
C is free. If you wanted to do inline assembly, cast a void* to char* to unsigned*, you very well could. If there is a hack that allows you to save computational time and memory, then by C you should be allowed to do it. But saying you should ban C just because it *allows* you to, is ridiculous. Ban the programmer who doesn't know what hes' doing instead.

>Wrong analogy
In exactly what way? You're proposing on banning a tool because it can be misused. Shall we go on to ban all cars next, because they could be used as massive, speeding bullets? This "ban unsafe things" logic can be taken to the ridiculous extreme.

They are retards in general

what if I want to write code to 4bit C4004 that is not compatible with the "safety" features that modern "safe" language provide?

We should ban all Hammers and instead use dildos on a stick.

>I've got a better idea; don't write shitty unsafe code in the first place.
Agreed. Safety should not be occasional
>The language always does what it's supposed to.
Not with undefined or unspecified behaviors, no.
>cast a void* to char* to unsigned*,
Doesn't look like very safe there
> But saying you should ban C just because it *allows* you to, is ridiculous.
We should ban guns without safety locks to civilians too
I would ban a loose hammer

>C lacks a lot of features that I shouldn't have to worry about in the current decade.

Like what, exactly?

ASM
Like strings

EVER SINCE I LEFT THE CITY
(YOU)

C has strings dump fuck.

String manipulation is super fucking easy in C, what are you talking about

string str = "Oh no"; //

so, when ASM then becomes only way to write MCU code, will you start spouting how unsafe ASM is?

Doesn't compile on java either, does that mean java doesn't have strings?

>String manipulation is super fucking easy in C
Write a program that takes any number of strings, joins them and prints out the memory address of the joined strings in C
you got 5 minutes

fight you? you already lost kek

what
String s1 = new String("hello");
String s2 = "hello";

>Sup Forums is presented a quantifiable problem that can be addressed with quantifiable results through practical measures
>Sup Forums responds with generalized moralizing among other non-arguments and offers vague admonishments in place of a solution

sasuga Sup Forums. They don't call this board brainlet central for no reason

Imagine if you ancrap retards were in charge of other things:

>research has shown that Pintos are exploding!
>umm, jeez maybe drive better?? Your car can't explode if you don't crash in the first place!

char *str = "your dump fuck";
Point was that


string str = "text";
[/code]
Doesn't compile on either in Java or C.

>I added new code

Oh, so adding code is allowed?

excuse me?
quora.com/How-do-you-declare-a-string-in-Java

>Agreed. Safety should not be occasional

It should not be iron-clad either. If a programmer wants to revolutionize the way things work with an unsafe optimization, they should be allowed to do so. See: en.wikipedia.org/wiki/Fast_inverse_square_root, which leads me to address the next thing...

>Not with undefined or unspecified behaviors, no.

The thing about C gives you enough power as a programmer to implement undefined behavior is exactly what makes it so powerful in the first place. And as Uncle Ben once said; with great power comes great responsibility.
blog.llvm.org/2011/05/what-every-c-programmer-should-know.html
blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html
blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html

>We should ban guns without safety locks to civilians too
And then we have armed, well-trained civilians dying because they had to turn off the safety mechanism while an armed robber was shooting at them.

>I would ban a loose hammer
That's also a bad analogy; a loose hammer doesn't do it's job. C as a programming language always does its job properly and malfunction of it is caused by YOU the programmer. There's no blaming tools allowed on mathematical and abstract trinkets here. They are not like hammers - they don't wear and tear or grow old.

yeah youre right I love the government especially MKULTRA
they just werx yknow?
youtube.com/watch?v=lCUfGWNuD3c

void niggers(char** strings, int stringcount)
{
int i;
int len = 0;
for (i = 0; i < stringcount; i++)
len += strlen(strings[i]);

char* joined = (char*)malloc((sizeof(char)*len)+1);
strcpy(joined, strings[0]);

for (i = 1; i < stringcount; i++)
strcat(joined, strings[i]);

printf("%p\n", (void*)&joined);
}

>It should not be iron-clad either. If a programmer wants to revolutionize the way things work with an unsafe optimization,
Nothing prevents anyone from using unsafe blocks user. However a C program itself is within unsafe block by default
> while an armed robber was shooting at them.
There are police just for that and armed robbery is not a daily occurence
> a loose hammer doesn't do it's job
It does if you poorly bind it together with tapes and careful enough, sounds likce C, doesn't it?

That's so much "easier" than
import std.stdio;

void main(string[] args){
String final_string;
foreach(arg; args){
final_string~=arg;
}
writeln(&final_string);
}

how to build latest gtk3 app statically on win?
should i git and compile every dependency into .a or .lib? is it possible?

>He took 10 minutes to join a string
Truly, authentic C experience

>bounds-checking is a Hoover-era FBI program that sought to subvert radical leftist activity
??

It's like 3am

>If everything is hidden behind libraries somebody else wrote, then that means it's better!

func main() {
println!("Where my Rustaceans at?");
}

>Java is easier
who cares?

>>If everything is hidden behind libraries some retarded potato pajeet wrote, then that means it's better!
ftfy

Are you saying you didn't use libraries in that function?
Really made me think

Also I could just as easily have written

char poopynappy[1024*stringcount];
strcpy(poopynappy, strings[0]);
for(i = 0; i < stringcount; i++)
strcat(poopynappy, strings[i]);


if I didn't want to care about memory usage

That's not even a whole program

>Nothing prevents anyone from using unsafe blocks user. However a C program itself is within unsafe block by default

There is nothing wrong with that. Put safe blocks around your code explicitly. C is not a tool for writing "safe" code to begin with; it is close to the metal and assumes that the people work with it care more about performance than safety. That is what it was made for. If you want safety at the expense of performance, use another language like Java or Ada.

>There are police just for that
You are either very naive or very dishonest. We both know that it (1) takes time for police to get to the crime scene and when seconds count, it simply doesn't compare to instant access to a gun, and (2) When guns are involved in domestic violence police are the ones to clean up the mess, not prevent innocent deaths (which is what unhindered access to guns are intended for in the first place).
>and armed robbery is not a daily occurence
Neither is access to guns. But arguing that they should be restricted for that simple fact is ridiculous. It's only appropriate that tools that should be used very rarely should be reserved for very rare occurrences, such as domestic robberies.

>It does if you poorly bind it together with tapes and careful enough, sounds like C, doesn't it?

Sounds like a problem with you. C would be the tapes and wood. Or are you going to propose we should ban those, too?

Let me rephrase that:

The way you wrote it, the string is being created, then new memory is allocated, the original string is copied over, then the new addition is added it.
You are creating and destroying strings every single time you concat onto it, which is hugely wasteful.
String manipulation is trash in any language, but it's not magically difficult in C.

#include
#include

int main(char** argv, int argc)
{
int i;
int len = 0;
for (i = 0; i < stringcount; i++)
len += strlen(strings[i]);

char* joined = (char*)malloc((sizeof(char)*len)+1);
strcpy(joined, strings[0]);

for (i = 1; i < stringcount; i++)
strcat(joined, strings[i]);

printf("%p\n", (void*)&joined);
return 0;
}


There you go, dingus

>calling people C todders

That's not even funny you fucking retard.

SHILL THREAD.

Shills plz leave.

>java
>not compiled into raw assembly
fn join(strs: Vec) -> String {
let mut concat = String::new();
for str in &strs {
concat.push_str(str);
}
concat
}

redox-os.org/

>Two header file calls
nice
That's not what people call rephrasing user. However, linking arrays for simple task such as that should not be a concern in the current decade. IF I cared about that theoratical performance gain I could have done the exact same thing in my code. The difference is I can actually choose not to while you can't

LANGUAGE FIGHT

>header file calls
>calls

Shows how little you know.

>The difference is I can actually choose not to while you can't
Sure I can.
I literally just wrote the code for it, and now I have the function for it.