Go back to "just C"

>Go back to "just C"
>Productivity goes up tenfold
>Performance gains x18
>Compile times are cut down x100

What's the deal with this language?

Attached: 1200px-The_C_Programming_Language_logo.svg.png (1200x1276, 74K)

Other urls found in this thread:

github.com/git/git/blob/master/banned.h
gist.github.com/bert/265933/e92f8c3f70a4643e0eed09e52bb726d8da35576b
twitter.com/SFWRedditGifs

It's the best and only good language.
>BAWWW C IS BAD
You don't understand C.
>BAWWW I UNDERSTAND C AND C IS BAD
You don't understand C.

b-b-b-but lil zoom said python is the future

absolute based op
this is chad's language of choice

but it's painful to manipulate strings, do HTTP shit and graphics in C

its a very simple language,
farm from perfect,
but simplicity is very good

Fucking zoomer, sprintf does all you've ever needed and more. Go be a python loving nigger somewhere else.

>sprintf
banned
github.com/git/git/blob/master/banned.h
and I don't use Python

>Let me say something so vague no one can disagree

>github.com/git/git/blob/master/banned.h
sprintf is banned for security reasons, while snprintf is perfectly OK (because it handles buffers in secure manner), just like asprintf.

ok kid

>C need at least 10 different version of print
the absolute state

Attached: 1541536056975.png (1200x1400, 502K)

Every language has so many variations of printing, it's just that usually it's hidden behind a garbage pile of abstraction ;)

>tfw using sprintf in R

That's why people should switch from C99 to blessed C11 with its generics and standarized multi-threading.

It just one step away from asm mnemonics, so the abstraction’s rather simple.
>Performance gains x18
>Compile times are cut down x100
If your project is small enough, sure.

C11 has generics?

>git programmers are too fucking stupid to use functions properly and safely so they have to LOLBANNED functions like a bunch of fucking amateur children
Jesus fucking shit, I didn't realize git was this fucking bad. Dropped.

Yes, it has something like a proto-generic thing (_Generic)

This is new to me too. Damn C is based homies.

>no standard (generic) containers
>no STL
>horrendous macros
>no namespaces, #include is transitive (!)
>cryptic compiler messages, difficult RAII and custom type system
Deprecated language, going back to C++

Are you retarded? Git has nothing to do with this.

It's not bad. It's just that newer C standards can't abandon some bad language design such as strcat or strcpy in favor of safer alternatives, such as strlcat and strlcpy

Just like my trading card games.

>not using C++17
Go back to bed gramps.

There is no reason to trust low level programmers with anything, they're humans and humans make mistakes. Easy for machines to audit people.

>git has nothing to do with this
>LITERALLY FROM THE SOURCE CODE OF FUCKING GIT
No, user, you are the retarded.

god I wish I knew C++

What lol? Just skim a few book and watch some cppcons.

>no standard containers
Built-in? You're right, there are none. However, you have external C libraries that provide it.
>No namespaces
Namespaces are retarded. In 90% of cases they're used in a way that they could aswell just prepend functions with "NAMESPACE_" for proto-namespace functionality and nothing would change.
>RAII
dropped
>cryptic compiler mesages
only in GCC, clang provides meaningful messages

You don't need generics. The only thing C++ has over C are shorthand quality of life things like operator overloading. But god help you if a library you're using decides to abuse it. I've seen shit where people are using [ and ] to fucking start constructors in UI markup IN C++.

>no STL
Yeah, go back to Pajeet++

I keep watching cppcons but I've no idea what any of them are about
I went through tour of C++ but didn't think I was ready enough to start a project
so I started C++ Primer and I can't force myself to read any more of it, think I'll just finish up the part on classes and just try to come up with something

You've never used a language with a good module system have you?

It's not generics. It's some shitty macro based function overloading.

I've used many languages with various module systems, but in most cases they're a clusterfuck to maintain.
t. guy using Python and Haskell at work

"just program good bro" just doesn't work. i like C but you need to deal with the safety issues somehow. linux does similar stuff too. they recently tore out all variable length arrays. they have been doing a lot of work to moderate the use of libc functions. and they have been auditing switch fallthroughs.
humans are just inherently bad at manually managing memory. pretending it isn't an issue is just going to lead to more security vulnerabilities.

>modules are "a clusterfuck to maintain"
>#Includes aren't

This is your brain on C

>pointing something and not providing actual argumentation
Holy shit, is this entire Jow Forums in 2k19 now?

Wdym that includes are hard to maintain? It's as simple as making a file, making a "#pragma once" on top of it and then listing which functions you want exported. It's not that hard, is it?

Hang on, I thought modules were meant to be the saving grace? Even C++ wants them in. Is there something wrong with them?

>#pragma once
Not standard C.

>external C libraries
Can you show me the best ones? Do they have any standards to live up to? Can I see their specifications? Are they at least as good as STL counterparts?
>"NAMESPACE_"
Not a valid solution, I don't want 10000 things on my tooltips menu. Plus, it breaks any sort of abstraction by filling my short term memory with implementation crap. No thanks, namespaces nicely sweep garbage under the rug.
>dropped
Keep writing broken code.
>clang
They leapfrog each other in my experience.
Yes, I do very well need generics, especially for concept-based algorithms. There is only one way to forward-iterate over a range. There is only one way to add an element at the end of a queue.
Show me your personal implementation of a generic hash map and an equivalent to std::hash. Remember, keep the syntax the same, don't reveal implementation details to the outside world.
You know, you should start at the beginning. Get a really stereotypical project like drawing polymorphic widgets on the screen. Don't actually render anything, just create, edit, delete, handle collisions and overlaps of different shapes, and get a draw() method that's just std::clog

>cryptic compiler messages
lol!
that's funny coming from sepples user.

There's nothing wrong with modules. It's just that suddenly adding them to C++ is going to create a total clusterfuck where you're not sure whether a library is using module system or not. On Python they're just a bit of clusterfuck due to how they sometimes have to work with C libraries.
If something works on all modern C compilers, then it's hard to tell that it's not a standard.

As long as you don't try being clever and keep everything by the books, you will get very specific errors.

Sure. Glib is the most known one. If you're not exactly into GTK-like code, then you have some public domain stuff such as stb libraries or sglib.

But why do you think STL is good for you?
I suck at programming, and I can outperform std::vector for example AND I don't have to deal with the compile time hassles.

When you really think about generics, it's a fools errand. Output and input can't be 'everything', it doesn't work. And I've seen it not work with strange floating point shit and casts inside templated functions.

user's kinda right. You either have a system where you have either strict types or some generic type as an overlay for void pointers or you have complex type systems that allow to define specifically what you're going to do with the data (e.g. in Haskell)

>not having header files auto generated before compilation

Yeah, that's possible too. I think even most systems include some tool for auto-generation of header files. However, sometimes you want some fine-tuning on what you would like to share.

>graphics
Almost all graphical libraries and APIs have C bindings.
>http shit
just use curl.
>strings
how hard is it to manipulate an array of characters.

>things that no sepples library developer does

I couldn't find any actual specifications for glib. The syntax is not comparable to C++ and I can shrink this program to about 5 LOC.
gist.github.com/bert/265933/e92f8c3f70a4643e0eed09e52bb726d8da35576b
>I can outperform std::vector
Well I'd like to see some examples, are you using C++17 style syntax?
>'everything'
For years we've hinted at class compatibility via typenames and SFINAE. Now c++20 should bring concepts, which very strictly define what groups of classes you can use. Think about it, there is only one way to quicksort a contiguous sequence of variables, with random acces to each, and correclty defined '

>how hard is it to manipulate an array of characters.
Apparently very hard for C programmers judging by the countless buffer overflows and array bounds related bugs/vulnerabilities found in C programs.

Strings are not arrays of chars. Arrays of chars are arrays of chars. Strings, in modern correct programming, are generic dynamic arrays of (ASCII/Unicode/etc) with short and/or long string optimisations, and a set of functions that don't randomly leak memory or cause undefined behaviour.

Alright, now how would you do that Folder class without std?
And then, how would you do it without a map?
Because I guarantee that you can write a better map, and then on top of that you'd be able to find a way where you dont even need the map anymore.

>Strings, in modern correct programming, are generic dynamic arrays of (ASCII/Unicode/etc)

They're also the cause of an assload of GC problems and performance instabilities.

>BAWW BAD PROGRAMMERS CANT PROGRAM C IS BAD
Fucking amateur. You get the same shit in every fucking language regardless of how much childproof, idiotproof safety gear the language builds in.

>Productivity goes up tenfold
placebo, you just suck at programming in other languages
>Performance gains x18
also portability x0.0000012925
>Compile times are cut down x100
why does this matter again?

>without std
>without a map
I would use a different language that has these syntactic and semantic equivalents.
>you can write a better map
No, I've tried several since college. I mean it, it's a big no-no. I get the asymptotics right and it works about 1/3 to 1/2 as fast, however standard library implementations, especially gcc's, are hilariously plastered with compiler hints, directives, long sequences of type specifiers, carefully chosen data locality, etc. I cannot possibly do that for every program. Just because today I hash files, and tomorrow - widget names, doesn't mean the process itself is different.
>dont even need the map anymore.
I think it's the best I could come up with. I needed a Folder class with constant-time lookups of file metadata by relative path and md5sum, so I made two hashmaps - for the md5sum and the path, concurrently pointing to elements of a vector of file_metadatas acting as an in-place allocator. I mended semantic bugs I'd never have realised exist, let alone find and debug, had I written multiple times the code for every C++ one-liner.
std::string has no GC or performance instabilities.

You fucking retard.

You fucking dumbass, I will kill you. I am calling the police, you super idiot.

>I will kill you. I am calling the police
Based 4D chess

>std::string has no GC or performance instabilities

You poor naive soul. Go have a look at what Chrome was doing a few years back with std::string.

I wouldn't know, I don't use chrome::string, I use std::string from libstdc++. I like Facebooks approach.

>I don't care about waiting 1 minute and 43 seconds for a half assed codebase to compile
>Portability
>On a native language

What am I even reading? I'll take the first one though. Fuck Haskell.

thanks
I really wanted to start at the beginning despite already covering c++ and oop in uni so I went with C++ primer but it really covers too many things which I already knew and I wanted to do all the exercises so that took up a lot of time. Feels like it would just take too much time when I can just look up cppreference when needed and figure it out from there.
Was hoping to use this as a break and move into some kind of c++ dev since I'm sick of my job and don't want to progress any further into webshit
also, why clog?

>std::clog
std::dilate

>I don't care about waiting 1 minute and 43 seconds for a half assed codebase to compile
correct
>portability on a native language
it's just a problem with C, if it managed to be portable then i wouldn't complain

>webshit
Good luck, C++ is better than ever. Especially now that Rust literally lit a fire up their asses. If you care about developing a sturdy philosophy over generic and conceptual programming, read Stepanov and McJones Elements of Programming. It's free online. Grasping it will slingshot you into what programmers will be doing in 2025-2030.

I really enjoy C, it's very comfy, but most people here have clearly absurd opinions. It has almost no capacity for abstraction and it's unsafe as fuck. Cool for systems programming (because everything will have a C interface), embedded stuff, and number crunching or whatever, atrocious for what most programmers actually do on a regular basis.
If you think "C can do everything other languages can do but with less bloat" or "modern languages are just C with syntactic sugar", you need to stop posting and go learn an ML language or Lisp dialect.

yea my plan was starting with c++ basics, get some kind of projects, do dumb shit, read the Effective c++ series and afterwards some general books on design and quality code
I'll check out that recommendation, thanks

>sprintf
>utf8
pick one

>Cool for systems programming, embedded stuff, and number crunching or whatever, atrocious for what most programmers actually do on a regular basis

You mean everything programmers do on a regular basis alongside the basis of programming

Ah I see, well don't read too much into those books. Skim them to get a general intuition on the topic and write a short yet exhaustive summary on each. I laser print my own large QR codes with the summaries and sticky note them on the boot covers.
GCC has several 'effective c++' flags which enable, in real-time, compiler warnings and notes based on the books. Phenomenal.
Uncle Bob has some books but he's a by-the-pound author. His Clean Code book is 40% good, fatherly advice, and 60% spirit of the cosmos and japanese culture.

>C++20 concepts and constraints
Aren't these literally just Rust traits? How did they fuck it up? Are they gonna steal borrow checking next?

>Aren't these literally just Rust traits?
actually it's just sfinae
>How did they fuck it up?
see above
>Are they gonna steal borrow checking next?
clang seems to want to

>things that didn't happen

Proof? You just know you're wrong, but keep on pretending...

>not using asprintf

>clang seems to want to
That would make me more interested in properly learning C++, since there are already autists that promote RAII, borrow checking would just add compile-time enforcement of it.
Plus you could watch Cniles turn on a dime from "borrow checking is for retards" to "only retards don't use borrow checking".

It's because safety is a meme. Managed languages have memory leaks, garbage collectors have leaks, C, x64. The point is you manage your own, because anyone else isn't going to do it much better.

>NAMESPACES ARE SO AWESOME
>always use fully qualified names everywhere.
WHAT IS THE POINT THEN?

std_filesystem_path prefix;
std_unordered_map contents;

Fixed that for you, it's even 3 characters shorter.

>developers will always make mistakes
>therefore I should reject all of the audited code other people have made and do it all myself because I know everything

cniles != sepplesfags

Or just use using declarations, you fucking retard.

>use using
you fucking retard

Newfag here, literally just starting, how much time should it take for learning C? I choosed it as my first language.

what's your point?

The REAL reason to not use namespaces is that godawful syntax.
>::

Go learn Python. You'll have more fun.

yeah.
c = a car with no doors on it, no roof, no wipers.
python = all mod cons.
having to choose, redefine molecularly, the wiper motor, etc, battery, battery voltage, gets a bit tiring after a while. ... most of the 'wtf is a 'chad''s in here, want a FUCKING FERRARI (c), when THEY CAN'T EVEN DRIVE

To learn how it works, some weeks. To become proficient in it, years

2 lifetimes
then you have a product that is nothing like anything on earth, a hybrid, of "your design".
get real, get to the real world -- use python, as a beginner. with C, as a beginner, you are approaching things badly.

I have no idea why Rust copied it. Of all the things you could have changed about C++, that's what you decided to keep?

you end up looking a mess -- its what happened to gate, no design, anywhere, hes a fucking "elite"' 'c' programmer, who can't design for shit.

how it goes
"the dark ages of tech" = 30 years of microsoft.

>need to learn python for a class
>going through learn x in y and the official tutorial
>nothing makes sense
>strings aren't just character arrays
>no types
>formatting is tied into syntax
all these retardation comes from an hour of trying to learn it
what the fuck is this pythonbros?

got it in 1.
shelve it -- unless you are writing drivers 'systems programming' only .. even for embedded systems, why use C. C is 1 step up from ASM. its the meme to end all memes, here, in that it is somehow 'better' .. sure its faster, ASM is faster. C is an approach. its not the be-all and end-all. Look @ the low grade of software currently, after the dark ages of tech (m$).. in that gates, picked up an impression, what he saw in visiting xerox parc, of the competent, GUI, desktop. He knocked off that 'impression', in C. He made what he saw. He could make it fast, sure. But there was no underlying structure, no objectivity. Why, this day, all their software is a humungous mess. C gave him nothing. It will give 99.89% of the fking programmers, here, zero. In addressing the issues you will run up against fast, using C, you will not learn anything but systems/OS level ... you will not get any insights other than that which is systems/OS level. It is not real world, it is not "informational". It is, like vi, other tools, part of ancient infastructure. There are more advanced approaches, with C, you have to decide on your "structure", if you get one at all. Gates, the amateur "micro kid" got in because he was an elite, in that fashion. Its regressed human progress. You want to get on, you want to be productive -- C is not the thing to use

/thread (again)

>>no types
There are indeed types, they're just not written out. Learn to keep variable types in your head and everything is fine, if you still can.
>>strings aren't just character arrays
They're unicode-supporting now and you can do things like getting its length through an O(1) operation and split and manipulate and format them freely, isn't it great?
>>formatting is tied to syntax
You should indent your code anyway, what's the big deal?

>saying /thread to himself
Lurk moar newfag