|
hot take: if you're new to programming, you should not be learning c
|
# ? Nov 24, 2017 09:56 |
|
|
# ? May 22, 2024 05:43 |
redleader posted:hot take: if you're new to programming, you should not be learning c bbut i heard it can big the data fast
|
|
# ? Nov 24, 2017 10:58 |
|
redleader posted:hot take: if you're new to programming, you should not be learning c if you're going to teach people programming in some broad sense sure, but there is a certain presumptuous air to dictate the way someone who actually does just want to learn some c should do so. it is not like it is an entirely illegitimate thing to want to do
|
# ? Nov 24, 2017 11:10 |
|
but but the machine
|
# ? Nov 24, 2017 11:14 |
|
cinci zoo sniper posted:bbut i heard it can big the data fast oh poo poo, he knows the secret.
|
# ? Nov 24, 2017 11:17 |
|
Cybernetic Vermin posted:if you're going to teach people programming in some broad sense sure, but there is a certain presumptuous air to dictate the way someone who actually does just want to learn some c should do so. it is not like it is an entirely illegitimate thing to want to do No, one should learn C only reluctantly and after carefully eliminating all reasonable alternatives.
|
# ? Nov 24, 2017 11:20 |
|
yeah you definitely should not learn the single PL capable of accommodating every other PL instead you should learn one of those other PLs
|
# ? Nov 24, 2017 15:04 |
|
Suspicious Dish posted:https://github.com/zedshaw/liblcthw/blob/e244c2146cdf0eccc63361950596e808c4846b24/src/lcthw/darray.c C++ code:
C++ code:
-------edit-------- C++ code:
-----edit----- Reading through the rebuttal and that person is defending C strings... Xarn fucked around with this message at 15:22 on Nov 24, 2017 |
# ? Nov 24, 2017 15:11 |
|
does a C book even exist that properly tells you about all the UB and memory corruption horrors inherent in the language or are such lessons only learned by banging your head over decades from an initial naivete of thinking C was simple and you were smart enough not to make mistakes
|
# ? Nov 24, 2017 15:27 |
|
my hot take: people who think they are familiar with the pitfalls of c are even more dangerous than cautious beginners or zed shaw esp. anyone who talks about how c is a "portable assembler" because it has an obvious mapping to machine instructions
|
# ? Nov 24, 2017 15:33 |
|
comedyblissoption posted:an initial naivete of thinking C was simple and you were smart enough not to make mistakes This isn't so much an initial naivete as it is existing C programmers telling newcomers outright that "C is simple" and advising them that the best way to avoid bugs is "don't write bugs".
|
# ? Nov 24, 2017 15:38 |
|
Suspicious Dish posted:https://www.theverge.com/2012/3/23/2897545/a-first-look-at-the-sony-xperia-sola-floating-touch-display quote:So far, The Unwired says that only Sony's browser supports floating touch even the home screen is tap-only, and no other apps have been rebuilt to support it. However, it seems to work well... Android has always been about half baked implementations.
|
# ? Nov 24, 2017 15:52 |
|
Doom Mathematic posted:This isn't so much an initial naivete as it is existing C programmers telling newcomers outright that "C is simple" and advising them that the best way to avoid bugs is "don't write bugs". people think this is a joke but no, this was genuine, honest advice i have received from a tenured professor
|
# ? Nov 24, 2017 16:07 |
|
i got that from a BA when i told him the next sprint wouldn’t have as many features because we were setting up a new way of testing. “i don’t understand why you write code to catch bugs, just don’t write bugs”
|
# ? Nov 24, 2017 16:25 |
|
Internet Janitor posted:my hot take: people who think they are familiar with the pitfalls of c are even more dangerous than cautious beginners or zed shaw
|
# ? Nov 24, 2017 16:25 |
|
Max Facetime posted:yeah you definitely should not learn the single PL capable of accommodating every other PL call me selfish but I'd rather be blood type ab+ than o-
|
# ? Nov 24, 2017 16:33 |
|
on some level i like zed shaw for the same reasons i like yospos. glimmers of deep competence diluted by overreaching pseudo-intellectualism, saved by some thought lent to the human in the middle of the computer mess, and redeemed by giving up computer-touching for art (in zed shaws case to instead learn to play the guitar and to paint) also for harmless trolling of people who need it
|
# ? Nov 24, 2017 16:34 |
|
comedyblissoption posted:does a C book even exist that properly tells you about all the UB the thing about UB is that it’s undefined only by definition; a real Computer Scientist observes, measures and finally documents that which has thus far lacked definition comedyblissoption posted:and memory corruption apart from things like rowhammer and wearing out flash memory through repeated writing, there’s not really any ways to actually corrupt memory; you write 1s and 0s and that’s all you’ll get back when reading comedyblissoption posted:horrors inherent in the language I dunno what this book part could say “if the shackles you have made for yourself are burdensome, then cast them aside“, perhaps
|
# ? Nov 24, 2017 16:44 |
|
zed shaw has the same problem a lot of consistently-wrong people (ok, all of us) do. "oh you guys thought I was serious? i was just trolling, i'm so clever" like ok person, i believed you the first dozen times you pulled that, but i'm starting to get the inkling that really youre just a blowhard he's like the stereotype of the computer toucher. for example, iirc he had some valid criticisms of python 3, but no awareness of the fact that you can't be a complete autist when dealing with actual human people, so he surprisingly got no traction. yeah yeah meritocracy, but you know you've got to live and work with others
|
# ? Nov 24, 2017 17:14 |
|
Thermopyle posted:zed shaw has the same problem a lot of consistently-wrong people (ok, all of us) do. "oh you guys thought I was serious? i was just trolling, i'm so clever" like ok person, i believed you the first dozen times you pulled that, but i'm starting to get the inkling that really youre just a blowhard on behalf of autists everywhere, i must object to you using that word to refer to someone who writes things like "It’s the language for old programmers who want to debate section A.6.2 paragraph 4 of the undefined behavior of pointers. Good riddance", or "a bunch of closed minded conservatives who’s [sic] only joy in life is feeling like they know more about a pedantic pathetically small topic like C undefined behavior". a man who does not enjoy arguing over the minutiae of technical topics is unworthy of the title also there is no section A.6.2 in the c standard. undefined behavior is J.2. or he might be thinking of 6.3.2.3, which does cover the behavior of pointers, but paragraph 4 has nothing to do with ub. fuckign owned
|
# ? Nov 24, 2017 17:41 |
|
Xarn posted:
i only learned about "free() takes null pointers without failing" thing like a year ago because it's really unlike C to not do anything on a null ptr. nothing else does that Xarn posted:
where's the O(N) insert? Suspicious Dish fucked around with this message at 18:34 on Nov 24, 2017 |
# ? Nov 24, 2017 18:32 |
|
Suspicious Dish posted:where's the O(N) insert? Maybe I worded it wrong? If you grow a dynamic array by fixed amount when you run out of space, your push_backs asymptotically average out to O(N) instead of O(1). Incidentally, the ~4 guys I know personally that really, really insist on C instead of C++ each have their lovely reimplementation of std::vector and each implementation contains the same error.
|
# ? Nov 24, 2017 18:45 |
|
Suspicious Dish posted:i only learned about "free() takes null pointers without failing" thing like a year ago because it's really unlike C to not do anything on a null ptr. nothing else does that The main concern with that code snippet is no protection against double free, it should clear after free.
|
# ? Nov 24, 2017 18:50 |
|
Suspicious Dish posted:https://github.com/zedshaw/liblcthw/blob/e244c2146cdf0eccc63361950596e808c4846b24/src/lcthw/darray.c code:
|
# ? Nov 24, 2017 19:07 |
|
oh i'm sure you guys can nitpick it to death but the article author says "introducing some over-engineered, poorly-written data structures, etc. Things like this and this and this would be enough to make a C programmer cringe..." this isn't over-engineered or poorly-written. it has some bugs but literally all C code has bugs like this. turns out nobody uses an array with more than 2,147,483,647 items
|
# ? Nov 24, 2017 19:10 |
|
also the nitpick of "learn c the hard way" completely misses the point of that book. that book tries to skip over dumb nitpicky details and saves them for when they actually matter. so him pointing out every time he misses a detail and saves it for later is really just pointing out all the places the book follows its own philosophy. you might *disagree* with this methodology (i think its a good idea!) but the nitpick ends up looking snarky and is basically useless
|
# ? Nov 24, 2017 19:13 |
|
Suspicious Dish posted:oh i'm sure you guys can nitpick it to death but the article author says "introducing some over-engineered, poorly-written data structures, etc. Things like this and this and this would be enough to make a C programmer cringe..." laffo if you think i read anything past "what's wrong with this code"
|
# ? Nov 24, 2017 19:16 |
|
guys, guys..you're TOTALLY missing the point of "learn to drive the hard way"
|
# ? Nov 24, 2017 19:24 |
|
Suspicious Dish posted:also the nitpick of "learn c the hard way" completely misses the point of that book. that book tries to skip over dumb nitpicky details and saves them for when they actually matter. so him pointing out every time he misses a detail and saves it for later is really just pointing out all the places the book follows its own philosophy. it's been a while since I tried to read the book, I had minimal experience with C back then but the thing that struck me is that it was extremely nitpicky over a lot of poo poo that doesn't matter (or at least didn't matter to me). it was an annoying defensive style, and people nitpicked it that actually it wasn't all that defensive as he claimed it to be.
|
# ? Nov 24, 2017 19:56 |
|
Suspicious Dish posted:that book tries to skip over dumb nitpicky details and saves them for when they actually matter. so him pointing out every time he misses a detail and saves it for later is really just pointing out all the places the book follows its own philosophy. I totally agree with this intent, but LCTHW just isn't it. Suspicious Dish please write the C book.
|
# ? Nov 24, 2017 19:59 |
|
yeah, not defending zed's book (i haven't read it beyond a few chapters), just pointing out that more nitpicking is not the correct response.
|
# ? Nov 24, 2017 20:05 |
|
also no way in hell i'm gonna write a C book because i dont want the nitpick squad after me i only write about things that are small enough that nobody else really knows better, like linux graphics or webassembly.
|
# ? Nov 24, 2017 20:07 |
|
I love it when my desktop apps are vulnerable to web exploits https://statuscode.ch/2017/11/from-markdown-to-rce-in-atom/
|
# ? Nov 24, 2017 20:17 |
|
Max Facetime posted:yeah you definitely should not learn the single PL capable of accommodating every other PL not as your first lang
|
# ? Nov 24, 2017 21:32 |
|
another "programming education should start with logic gates" vs "programming education should start with SICP' argument's a-brewin
|
# ? Nov 24, 2017 21:37 |
Suspicious Dish posted:also no way in hell i'm gonna write a C book because i dont want the nitpick squad after me Make it an internet book, host it on GitHub, put up a mostly-correct draft, and then the nitpick squad will write the rest of the book for you
|
|
# ? Nov 24, 2017 22:15 |
|
Suspicious Dish posted:this isn't over-engineered or poorly-written. it has some bugs but literally all C code has bugs like this. turns out nobody uses an array with more than 2,147,483,647 items Last person who never needed index larger than int has cost me 2 days of debugging for no reason, gently caress you! Anyway, I admit that I gave it similar amount of attention I give students' seminar work. This means that nitpicks get included, but without penalization, more of a "hey, you can write this more nicely the next time". In this context, C++ code:
In similar vein, I once sent a long-rear end explanation of how to have header dependencies in makefile autogenerated to a student who had explicit header dependencies in his makefile... It actually earned him bonus point, as only two students figured out that headers are dependencies too, but I felt he could benefit from the explanation. In this light, O(N) push back on a dynamic array would get a lengthy explanation of why it is bad, how to fix it, and why it is important, but relatively minor penalty. OTOH non-conditionally zeroing errno in a macro would get huge point penalty (or maybe just "unacceptable, fix it"), because we spend the whole semester repeating that correctness is the first and foremost priority, and you DO NOT ignore errors.
|
# ? Nov 24, 2017 22:23 |
|
at some point i should finish this but i had way too much fun writing the code editor hoping that by the time i wrote that i'd figure out what to use it for i was wrong https://magcius.github.io/xplain/article/rast2.html
|
# ? Nov 24, 2017 22:24 |
|
redleader posted:not as your first lang programming a micro controller to make a row of LEDs blink in C, without abstracting away the access patterns that actually do things, should be fun certainly UB and memory corruption would be much less of issues with behavior right away observable and all memory yours and yours alone
|
# ? Nov 24, 2017 23:19 |
|
|
# ? May 22, 2024 05:43 |
|
Max Facetime posted:programming a micro controller to make a row of LEDs blink in C, without abstracting away the access patterns that actually do things, should be fun oh, fair call (i'd forgotten about embedded/actual physical devices, lol). i was thinking more in terms of a 'make computer do things' language. while serving a valuable purpose about show how computers work at a lower level (pointers et al), i don't think it's a great language to start with computers
|
# ? Nov 25, 2017 00:54 |