[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: c-programming-language.jpg (143 KB, 1200x1584)
143 KB
143 KB JPG
Now that the dust has settled, can we finally agree that this book is a meme? It's hopelessly outdated and was meant for experienced programmers in 70s/80s who already knew languages like Fortran. It also recommends using libraries that are no longer considered safe.
>>
>C
We Zig now.
>>
>>100198678
>It also recommends using libraries that are no longer considered safe.
What are you even talking about lmao. The only library it even mentions is the C standard library.
>>
>>100198782
As much as people will call you a zigger for this you're right. Can't wait for 1.0
>>
>>100198860
I meant to say functions. And I was talking about scanf more specifically.
>>
>I was filtered by the book
ftfy

We all know C Programming; A Modern Approach is the superior book anyways.
>>
>>100198927
Knife-licking based.
>>
File: chads.jpg (87 KB, 700x454)
87 KB
87 KB JPG
>>100198678
kys
>>
>>100198678
>Now that the dust has settled, can we-
*kicks up dust*
ooh, what are you going to do now, big boy? gonna cry? gonna shit yourself? yeah you're going to shit yourself, aren't ya? hahaha little faggot op
>>
>>100198678
It is still relevant because the language hasn't changed and you benefit from learning how to efficiently work with procedures and pointers.
>>
>>100198782
>No memory safety, just don't corrupt memory, bro
>No automatic RAII, just manually defer it, bro
>No borrow checker, just don't forget to defer it, bro
>No generics, just coomptime it, bro
>No specification, just trust us, bro.
>Zig
Why do language designers keep doing this?
>>
>>100198891
Why isn't that safe?
>>
>>100199080
There is no such thing as a memory unsafe language only shitty programmers.
>>
>>100199132
https://sekrit.de/webdocs/c/beginners-guide-away-from-scanf.html
>>
>>100199156
>There is no such thing as a memo... SEGMENTATION FAULT
>>
>>100198678
dunno, it's still the best book about a programming language
>>
>>100198678
It's a fun book
>>
>>100198678
oh man i still have it around, used it a long time to learn C. As I remember it was a fantastic book!
>>
>>100199234
Skill issue
>>
>>100199319
can confirm
>>
>>100198678
I know Python, Java and worked professionally with Javascript and this book still filtered me.
Thankfully I got a bunch of other resources to learn C.
>>
>>100198678
What are some good books then?
>>
>>100199444
Yeah I too wanna see faggot op's idea of a good book.
>>
>>100199444
>>100199507
and this is the part where op mysteriously disappears and never replies to his thread ever again
>>
>>100199080
Because explicit languages with manual memory management and no hidden control flow have their place.

I fucking love zig as someone who works with microprocessors.
>>
File: Behold.jpg (252 KB, 719x714)
252 KB
252 KB JPG
>>100199444
>>100199507
>>100199717
Behold
>>
All programming books are memes.
>>
>>100199234
the segmentation fault is a memory safety feature, imagine if segmentation faults weren't a thing, retarded nigger
>>
>>100199772
the original bourne shell caught sigsegv and expanded its memory arena in the handler
and look where we are now
I hate modern software
>>
>>100199808
you get killed if you trespass, I'm not sure how this can cause any complaints, same happens in real life
>>
>>100199764
This. Real programmers learn a new language by brute forcing commands/syntax until we find something that works.
>>
>>100199886
https://learnxinyminutes.com/ exists for syntax, language references like https://en.cppreference.com/w/ (includes C and C++ and you can download whole thing to read it offline) exist too.
>but what about programming patterns
every problem requires a different solution.
>>
>>100199886
Stop spilling the greatest programming secret of all time, it's pearls to the swine.
>>
>>100198678
I fell for the meme, and the book took away my enthusiasm for learning C. I picked up another book recently, and I've been having much more fun with it -- it's called Modern C for Absolute Beginners, if anyone's interested. Recently got its 2nd edition.
>>
>>100199984
you haven't learned anything, just keep reading meme books to continue avoiding to actually learn anything
>>
>>100199995
Okay, what do you actually suggest then, smart anon? I'm interested in the low-level stuff.
>>
>>100200009
Have you considered actually programming? Kind of similar to how when you need logs to be split, you go ahead and split them with an axe instead of reading about it. But of course you zoomers would need to watch a youtube video to know how to do that.
>>
>>100200040
>youtube
No thanks, I know enough to seek out books rather than YouTube. But fair enough, I guess I need to come up with a personal project and stick to it.
>>
>>100200065
>I have no problems to solve on my computer
go outside nigger
>>
>>100200103
The problems I do solve for myself, I can do in Python. But Python is not very interesting to me, which is why I'm here. No need to be a jerk about it, I'm not aiming for "average zoomer" tier, I want to do more.
>>
Im in the same boat want to learn c but cant come up with projects
>>
>>100200161
so rewrite some of them in C, surely you have some that would be more efficient if they weren't in pyshit?
>>
>>100199923
Problem with this is that you need some sort of language to begin with so you can learn concepts and paradigms i.e. higher order functions or how inheritance works (prototypal vs class based)
>>
>>100200205
you will learn about them when you need them
>>
>>100199047
kek
>>
>it's *current year*
>the trannies are still seething a about C
If you manage to make something better, maybe people will start using it, too bad that there has only been demands to transition to other gender or other retarded noise like c++ or rust.
>>
>>100200402
>too low IQ to comprehend why C++ is superior
>noise
scientific papers also probably look like noise to you
>>
>>100198678
I have never read a programming book (the standard is not a book) and I never will. Complete meme
>>
anon wtf. this book was always real. looks like you havent read it yet. i fucking love the c programming language. i was working on c++ code the other day and got told off for doing things the c way, and now my code is more bloated. like fuck idk. we can zig if you want to or whatever. i own this book irl and it is precious to me
>>
>>100201000
>retard who read K&R can't program
imagine my shock
>>
>>100199080
>just don't corrupt memory, bro
>just manually defer it, bro
>just don't forget to defer it, bro
>just coomptime it, bro
>just trust us, bro.
This but unironically.
>>
>>100199156
Actually it's the reverse: there is no such thing as a memory safe language. Fucking baby programmers and senile old presidents can't get this through their dumb thick skulls.
- The CPU is not memory safe.
- The ISA is not memory safe.
- Any language that claims memory safety is an abstraction.
- Abstractions have bugs and fail.
>>
>>100199047
Lol
>>
>>100198678
you should be doing everything that is considered unsafe. Personally I have grown a sixth sense for these things, I can spot bullshit just like that
>>
>ctrl-f language spec promotes undefined behavior
>>
>>100199047
got me good anon
>>
>>100199156
Imagine how retarded you'd have to be to think the rate of memory related fuckups is equal for all languages.
Both can not help the situation.
>>
>>100199234
Segfaults are one of the easiest things to fix. Crashings is always better than not crashing while in development.
>>
>>100200419
>C++ superior
Kek
>>
>>100201000
Checked.
Relatable. C with classes and its consequences has been a disaster for the human race.
>>
>>100206435
yes
>>
>>100206483
Destroying the memory model
Name mangling
Crashing before main
Pretense of 'encapsulation' while every IDE autogens setters...

Cpp is shit, OOP is shit.. if sun did t spend 500M on the 90s to modularize your job, in order to pack it up and ship it out to india, you wouldnt be arguing for this garbage.
>>
>>100206537
soul.
>>
>>100200419
Many scientific papers are indeed just noise.
>>
>>100206537
>oop is shit and it's sun's fault
Done correctly OOP is awesome and a natural outgrowth of good code organization practices in languages up until that point. The problem with OOP is that properly modeling problems...breaking them down into reusable and extensible classes...requires a minimum IQ. Absent that min IQ you get
>over engineered academic enterprise object labyrinth
>useless objects that have to be rewritten over and over and/or bypassed in non-OOP ways
Oh, and Sun did not create it nor is Sun the reason for its widespread adoption. It took over as a paradigm during the 80s, before JavaSir.
>>
>>100198678
>Safe
Go get fucked by the janny tranny.
You gigantic faggot.
>>
>>100206616
Not really, there was smalltalk which did OOP based off messaging, then C with classes which did gay shit. Became bigger and became Cpp with classes/inheritance/encapsulation and the NEW OOP. The sun made java, tries to sell it as an already existing 'curly braces language' like Cpp, and spent 500M in advertising over that decade to get it in industry.

No other programing language/paradigm has had a budget at all, or one close to rivaling the institutional adoption of OOP. The managerial reason for this is to export/import modular units of labor...

And ofc non of that is 'messaging' based OOP like small talk invisioned.

Compare the usage of C vs C with classes over the 80s please, include smalltalk with C with classes for proportionality.
>>
>>100206693
>Not really, there was smalltalk which did OOP based off messaging
So low iq coders attempted a skill they suck at, aka class modeling and organization, and weren't good at it. Thanks for proving his point.
>>
>>100198678
I'm not good in reading books in general but I appreciate its no-bs approach. Works as a reference manual too, as intended. I like to pull it from my bookshelf to check a detail about a standard library function. And when you read technical books written in the 1970s, of course you have to take into account the half a century that has passed since the book was written.
>>
>>100198678
Kernighan recently started to contribute to Awk again. Nigga has 90+ years or something. Had to do it through email first because he doesn't know git.
>>
>>100206693
>Not really,
Yes, really. By the time JavaSir was released pretty much all desktop application development was in an OOP language. C++ swept both Mac OS and Windows development, as well as development on the various UNIX workstations. All EE courses taught OOP. And every competing language was either OOP from the start or added OOP to try and stay alive. The precursor to our phones, Newton MessagePad, was fully OOP. The web was just getting started as a simple hyperlinked page system. And to the degree that it offered any interactivity at all, it was done through CGI calls into server applications that were...OOP.

>The sun made java...and spent 500M in advertising over that decade to get it in industry.
Sun tried to make Java a write once/run any where solution for everything: desktop, server back end, and web apps before web apps were a thing. It failed miserably on two of those fronts for shit performance and shit GUIs. Certainly Sun pitched it as OOP because nothing was going to be adopted without that, OOP had already taken over. But that wasn't the selling point. Sun was hoping to monopolize all development with their new baby, and the hook was "write once."

>No other programing language/paradigm has had a budget at all, or one close to rivaling the institutional adoption of OOP.
I'm an old fag. I was a kid/young adult into computing across this time frame. OOP won before Java appeared. I lived it.

>The managerial reason for this is to export/import modular units of labor...
That would have happened without OOP. Again, OOP was an extension of how programs were being designed before OOP took over. Look at the classic Mac OS Toolbox or Win32. They're not OOP because they were created at the tail end of procedural dominance. But they sure as hell are organized as if they were OOP.

>muh pure academic smalltalk
I like the idea of messaging OOP. Obj C (NeXTstep) used this. But you don't need it to be OOP.
>>
>>100198678
>meant for experienced programmers in 70s/80s
the standards are much higher now unless you have a meme job
access to unlimited information + millions more programmers to compete with
also i learned C from my dads copy of this book when i was 13
>>
>>100207217
I learned c from the public library. not hard. just took a minute to learn about pointers, but I realized now that the books suck at explaining pointers in general. They overcomplicated it, which is why people like myself had trouble getting them for a bit.
>>
>>100207614
>not hard
correct, C is good because its easy
>>
>>100198678
C is trans (not type safe) and will 42% itself soon.
>>
>>100208428
c++ isnt hard either. the only annoying thing is the fucking syntax and obsession with :: and brackets. Shit becomes nearly annoying to read. I can get stuck on a line of code for a couple minutes trying to discern what the fuck it's trying to do syntax with some fucking template and other bloat keywords like noexcept and shit.
>>
>>100208467
the strength of C is you can read a short document (e.g. Gnu C manual) and no syntax will surprise you
as for C++, just use
// best practice, shut up
#include <bits/stdc++.h>
using namespace std;
typedef long long ll

Verification not required.
>>
>>100208624
#include <bits/stdc++.h>

Huh?
>>
>>100208639
includes everything you need (gnu feature only), e.g.
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> v = {1, 3, 6, 5};
sort(v.begin(), v.end());
}
>>
>>100208659
oh yeah. I love the fuck out of vector. I honestly dont go too deep into the deep stuff in c++. And I never thought you really need it. The most complicated stuff you need to know is memory management, Raii, and move mechanics. Literally the only "difficult" things.
>>
>>100208673
i only use C++ for competitive programming because it has every data structure you need
its very quick to write too (if you know what you're doing)
i really do love C though, C++ is just a convenience thing
>>
>>100199157
this didn't at all show how it's unsafe, if anything it has shown how safe it is. you dumb moron.
>>
>>100206375
Segfaults are almost never easy to fix. Quite often they are caused by heap corruption, which is a nightmare to locate.
>>
>>100208777
Technically, memory allocation and pool memory management processes fixes this, but no one thinks its worth the time to write one for c++ programs unless it's absolutely crucial. Perhaps in a safety process like aerospace. Im always curious how they test and deal with exceptions in a system that can lead to life or death. I should go study up on it.
>>
>>100208812
make a post if you find something cool
>>
>>100208812
Aerospace has their standards for c like MISRA standard
>>
>>100199047
lmao that'll teach him
>>
>>100208812
https://sdtimes.com/nasas-10-rules-developing-safety-critical-code/

I'm sure there's more and different interesting shit for other systems (i.e. aircraft). Although apparently Boeing has zero standards for commercial flight control systems now.
>>
File: 93b.jpg (118 KB, 960x720)
118 KB
118 KB JPG
>>100198782
>>100199080
I can't wait for Zig 1.0 just to see Ziggers and Rustrannies fight.
>>
>>100198678
It's a great book. Being based on C89 make it somehow """outdated""" but anything else other than the difference between C89 and C99, the book is still great, and have a lot of wisdom in it, you speak about a book written by elitist programmers who know how to do shit, I can't think of something better. If you want something basic, read the docs (learn-c.org). Books are for wisdom and information exchange, not to learn technical skills, you do that by reading the docs, and practicing.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.