Name one (1) flaw

Name one (1) flaw.

Other urls found in this thread:

tiobe.com/tiobe-index/
cplusplus.com/reference/cstdlib/qsort/
twitter.com/AnonBabble

The developer

Is not c++

Can't dinamically execute statements.

#include

void f1() {
int a=1, b=2, c=3;
}

void f2() {
int a, b, c;
printf ("%d, %d, %d\n", a, b, c);
}

int main()
{
f1();
f2();
}


Stack leaking

(void *)

That's a good thing

memory management

Flaw 1:
It's not C++
Flaw 2:
It's not C#
Flaw 3:
It's not Python

>3rd grade in school notes system
>not A

Can't compete with handcoded assembly in many cases, unless you run it through a superoptimizer.

null terminated strings
buffer overflows
segmentation faults

>b-but those are the programmer's fault
if a car is only safe to drive when the driver is an ace, there's something wrong.

naturally, the analogy isn't perfect, but still, C is ill suited for most tasks nowadays.

That's a feature.

That's why inline asm exists.

C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't have dynamic method loading/creatin
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry. If you want guaranteed memory exploits and security vulnerabilities in your program with timesink development period then use Assembly, not C.

>Flaw 2:
>It's not Poosoft Spybot shit
>Flaw 3:
>It's not interpreted shit

...

...

I have a hard time believing C++ is inherently spied on.

I can see an IDE being spied on. As a matter of fact, Notepad++ was confirmed to have a CIA backdoor by Wikileaks, but was fixed in a patch after the leak.

lacking standard library.
it doesn't even have simple data structures like hash tables, trees or queues.

>the world should be built for the lowest common denominator
>intelligent people just have to suffer for the safety of all
I hate mommy coder camp graduates.

No amount of squirming will make the list of flaws untrue, user.

???

I didn't even reference "Flaw 1: It's not C++"

>claims language is for overgrown toddlers who can't learn advanced things
>BITCHES THAT THE LANGUAGE DOESN'T INCLUDE "ADVANCED THINGS" PREBUILT BY OTHER PEOPLE
I bet you can't even FizzBuzz.

You were talking about poosoft spybot shit in reference to C, right?

What makes you specifically say spybot?

>Name one (1) flaw.

Functions like strcpy(), strcat(), etc. are unnecessarily unsafe. It would not have taken much to make them safer, yet still keep them simple.

>C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
It's still better and more efficient than any modern language(s)
>C doesn't have delegates
Useless high level concept
>C doesn't have resizable arrays
Realloc, do you speak it
>C doesn't have strings
Implement your own
>C doesn't have string concatenation
Implement your own
>C doesn't have namespaces
Useless high level concept
>C doesn't have exception handling
Useless high level concept
>C doesn't have closures in the standard
Useless high level concept
>C doesn't have unit tests
False, there's several frameworks in existence
>C doesn't have Function overloading
Use variadic functions
>C doesn't have memory safety of any kind
You're supposed to be a real programmer to use C
>C doesn't prevent memory exploits and has no bounds and runtime checks
You're supposed to be a real programmer to use C
>C doesn't have dynamic method loading/creatin
Useless high level concept
>C doesn't even have generics and templates
Useless high level concept
>C doesn't have meta programming
It has a preprocessor so by extension it has metaprogramming
>C doesn't have mixins
Useless high level concept
>C doesn't have higher order functions
Useless high level concept
>C doesn't have contract programming
Useless high level concept
>C doesn't have inner classes
Useless high level concept
>C doesn't have function literals
Useless high level concept
>C doesn't have array slicing
Implement your own
>C has a very limited support for implicit parallelism
Useless high level concept
>C doesn't even have string switches
Useless high level concept

>High level is useless
Babby's First Programming Ethic

>my college textbook said it's good so it must be

High level is not useless, but those concepts are useless in C. Simplicity is a hell of a drug.

I didn't say that

This graph looks fucky. They must have mixed C and Objective C. "C" in the graph starts dropping right when Swift is out. That source looks like shit. And I don't think C was ever that popular recently anyway. C is niche language for high performance, you can't add high level concepts without sacrificing performance.

tiobe.com/tiobe-index/

you don't have to like it but you have to deal with it. get over yourself and accept that type safety and other such abstractions aren't just meant to protect against incompetent programmers, but also to make programmers in general more productive. time not spent scrutinizing your code base for C's many pitfalls can be spent churning out more shit.

in the end, your tools should reflect your actual needs, not some clueless basement dweller's notion of what proper programming practice is.

>Poosoft
>"What makes you specifically say spybot?"
The abstract syntax of C# might be botnet free. I wouldn't trust any aspect of its implementation to be.

w-why aren't you reinventing the wheel... I reinvent the wheel every day... why should you have it easier... it's not fair...

I don't get it user... won't it just print null 3 times?

>lacking standard library
Sorry, but THE Standard library is part of the C standard.

>does something stupid and get a stupid result
>C SUCKS GUYS

.net core is MIT licensed, and this includes the CLR as well.

I would not defend MS without a good reason but the fact of the matter is that the latest C#/.net tech is literally free as in freedom and available for you to peruse.

this is something we should commend lest people start thinking we're a bunch of partisan shitheads.

there's nothing wrong with C

there's something wrong with using C for shit that other tools would be better at because you're a thick headed nerd cunt

>get over yourself and accept that type safety and other such abstractions aren't just meant to protect against incompetent programmers, but also to make programmers in general more productive.

I'll grant that some high level language features improve productivity in many (not all) situations. But productivity has become a fucking meme pushed by people who love the sound of it, but not the part where you actually prove it with measurements.

Case in point: Java is a "high level" language with "safety and abstractions" which might make it productive if it wasn't for the 50 billion class Enterprise frameworks that make any Java project spaghetti code.

Case #2: I've done coding competitions in Python and C and I'm not convinced that Python is all that productive. Sometimes it is, but just as often it's not because you have to spend time tweaking for speed where the C version was lightening fast out of the gate.

>time not spent scrutinizing your code base for C's many pitfalls can be spent churning out more shit.

"Churning out more shit" is the appropriate terminology since so much software today is in fact shit.

>in the end, your tools should reflect your actual needs, not some clueless basement dweller's notion of what proper programming practice is.

I would agree with this. However, my "needs" do not include hiring Pajeets at a lower rate than real engineers.

>re-using variable names in completely different scopes
>"stupid"

good thing most C devs don't name all their iterators "i" or something

>t. pajeet programmer
Using uninitialized variables is the stupid part

I know it's www.tiobe.com. I can fucking read. But do you? Did you read this?:
>They must have mixed C and Objective C. "C" in the graph starts dropping right when Swift is out.
There is now Objective C in this graph. Apple is switching Objective C with Swift, that's why the """C""" in this graph is dropping. This graph is built by an autist.

Despite its potential flaws, is C a good choice for first programming language to learn?

Is not Python

because blindly pointing towards addresses is inherently better than simple zero-values

I get it, your half-century old technology can do no wrong whatsoever

Why is this a problem?

it actually is. afterwards you'll want to move on to something more modern though.

Except in the end, that's how the underlying architecture works. Everything else is an abstraction that will inherently be slower.

Thanks for enumerating all the useless bloat C doesn't have.

this is the most spakker shit ive ever seen

>I don't know how to use a feature
>Must be bloat

the cost of such an abstraction is negligible, and in most cases, even Java (which I'm not defending) is fast enough.

I don't deny that C still has many uses in this day and age, but C purists really need to commit suicide promptly

malloc
Ada is superior in almost every way

great for abstracting handles to stuff t. rtos dev

My point wasn't to argue against you, it was to confirm your point. See how high C is on that list.

default libs are ancient and miss most common use cases. Take a programming challenge I had for a job interview. Take an array and order it and remove all duplicate entries. literally a one liner in Python. Took me the better part of three hours to program a working implementation in C.

I still love C though

Yes because it will teach you to be strict as fuck about your code. Other languages will seem like toys after that.

>all these C doesn't have x comments

you don't understand neither C nor unix philosophy. read Dennis Ritchie.

>A language that doesn’t have everything is actually easier to program in than some that do.

C has flaws though, most of them became obvious as the language got older, it's 45 yo now and it's still relevant.

I programmed in C most of my programming life and the most important real life problems with C is the way strings handled and the lack of garbage collection.

I switched Go and i am more than happy now, it was a very smooth transition and many thing made sense immediately, almost like i already knew Go in another life.

The problem with this kind of threads is that people who use C for only homework assignment and never code something serious have strong opinions about it either in good or bad way.

oh look dis again

there is no need for it to exist

>took me 3 hours for a trivial task

Csharp is cancer
Microsoft is cancer

C# is surprisingly decent, apart from all the syntaxical sugar they keep shoving into the spec lately

and I say this as a huge GNU nerd who has to use it to put food on the table

the shit people make with it would give you nightmares though

no shit retard

Microsoft cant keep a reference page for shit though. Have you eber tried to look through microsofts library documentation. Shits a headache

If i actually didn't know how to use a feature would de because i never needed to know, and if i never needed it, it would be by defenition BLOAT.
So i dont get your point.
And I actually had to learn all that useless shit in my CS course.

>trivial means it should take no time at all
I'm sorry you're autistic

fflush

>O(n) or greater
>trivial
Kys faggo

Undefined behaviour. What's yer point, fag?

There are lots of things you don't "need" to do if you are doing things the hard way.

Beware the Turing tar pit, where anything is possible, but nothing interesting is easy.

There is no generic sorting algorithm better than O(nlogn) though

The cost of such abstraction is negligeble in most cases, not all.
And btw why is zero better for initialization than any other value?

Im talking best case here. Not average case.
Hence the "or greater"

The cost for abstraction like that is felt at compile tieme,

Shit tier library, even for what it does. In particular for what it does.
Bonuses:
1. header files
2. lack of decent metaprogramming

So.. bubble sort?

>negligeble
by whose standards?
The problem with abstraction is that once you start doing it, there is no clear indication where to stop. So you can quickly get abomination shit like javascript at your hand

Most stuff becomes the easy way with the right library and you dont need to do the most eficient code from the start. In C you can always go back and optimize the functions you need.

Are you retarded? Initialization of a variable with a specific value requires it to be written to memory.

>So you can quickly get abomination shit like javascript at your hand
The problem with JavaScript isn't abstraction.
It's called being vague (dynamic anything), automation (garbage collection) and running in a shit tier environment using a shit tier execution model.

pointers

So just use strncpy instead?

>doing bubble sort for a 10 minute interview question
Good luck even scratching that shit down on paper in that time.

Here's me redoing it in the time since I posted my other reply ()

#include
#include

int * foo (int * N, int size)
{
int I[size];
int * T = malloc(size * sizeof(int));
int temp;
for (int i = 0; i < size; i++) I[i] = N[i];
for (int i = 0; i < size; i++)
{
T[i] = INT_MAX;
for (int j = 0; j < size; j++) if (I[j]

for reference, here's my solution in python.

def foo (N):
return sorted(set(N))


def main():
N = [10, 1, 4, 6, 2, 1, 3, 4, 7, 9]
print (str(N))
print (str(foo(N)))

main()

Its handling of strings is lackluster.
And yeah, I know that someone is now about to say "but it's a low level systems language" or something to that effect, but that doesn't excuse it. It still has to parse and read text files to check its configuration. It still has to do logging. It still has to do a lot of string stuff even if it's a low level language.

>one of the most powerful features of C
>flaw

And a lot of other things. In fact, from the things missing, complete string handling is the least concern.

>brackets on a separate line
i puked

>The position of braces is less important, although people hold passionate beliefs. We have chosen one of several popular styles. Pick a style that suits you, then use it consistently.
It's okay to be a fucking child, but you should do it elsewhere

That's the most retarded style I've ever seen. You should fail the interview for having no taste.

see

>C programmers are actually retards in general
I think it's just the majority of programmers who are retards.

It's easy to find someone who can program in C, but it's hard to find someone who can do it well.

>for (int j = 0; j < size; j++) if (I[j] { }
Wtf are you doing, this is the first time ever I see this. Add extra brackets for clarity and don't nest statements like this. It's ugly as hell and obscures the purpose of what you're doing.

>segfault
>feature

>i can't program
>flaw

>every memory location in every language ever is initialized for you
>t. Sanjay
>Mumbai University

>the cost of such an abstraction is negligible
Except that it's not. We have billion instruction per second processors and solid state mass storage and there's STILL plenty of software which lags and makes the user wait.

>the shit people make with it would give you nightmares though
This is my problem with the whole God damn industry. Software engineering is supposed to be ENGINEERING. Not Pajeet or Mommy Coder.

>uses library sorting function in Python
>tries doing everything manually in C
>HURR DURR C IS SO DIFFICULT IT TOOK ME THREE FUCKING HOURS!
cplusplus.com/reference/cstdlib/qsort/

Printing ubinitlaized pointers contents and hoping they don't cross with initialized. Wow you're retarded.

T. Java fag

This is an interesting development.

I mash this trash code out in 15 minutes, and instead of legitimate criticism (such as my choice of variable naming, my extra for loops that can have their internal logic moved, my reuse of variables, my calling printf() twice in a row), Sup Forums decides to have an autist spasm about my choice to use the Allman indentation style

the question was to make a function. qsort requires that I write a second function to compare.