<story><title>Git&apos;s list of banned C functions</title><url>https://github.com/git/git/blob/master/banned.h</url></story><parent_chain><item><author>orwin</author><text>In my school, we had two days to understand the basics of text editors, git (add, commit, rebase, reset, push) and basic bash functions (ls, cd, cp, mv, diff and patch, find, grep...) + pipes, then a day to understand how while, if&amp;#x2F;else and function calls work, then a day to understand how pointer work, then a day to understand how malloc(), free() and string works (we had to remake strlen, strcpy, and protect them). Two days, over the weekend, to do a small project to validate this.&lt;p&gt;Then on the monday, it was makefiles if i remember correctly, then open(), read(), close() and write(). Then linking (and new libc functions, like strcat) . A day to consolidate everything, including bash and git (a new small project every hour for 24 hours, you could of course wait until the end of the day to execute each of them). And then some recursivity and the 8 queen problem. Then a small weekend project, a sudoku solver (the hard part was to work with people you never met before tbh).&lt;p&gt;The 3rd week was more of the same: basic struct&amp;#x2F;enums exercises, then linked list the next day, maybe static and other keyword in-between. I used the Btree day to understand how linked list worked (and understand how did pointer incrementation and casting really work), and i don&amp;#x27;t remember the last day (i was probably still on linked lists). Then a big, 5-day project, and either you&amp;#x27;re in, or you&amp;#x27;re out.&lt;p&gt;I assure you, strings were not the hardest part. Not having any leaks was.</text></item><item><author>InvOfSmallC</author><text>I teach at university as external lecturer. Teaching strings in C is the hardest thing I have to do every time. The university decided to explain C to first year student without previous experience. My feedback was to do a precourse in Python to let them relax a bit with programming as a concept and then teach C in a second course.</text></item><item><author>jchw</author><text>Unfortunately, much of the pain with C surrounds dealing with strings. It’s been a bit of a theme on Hacker News for the past few days, but it’s actually a pretty good spotlight on something I feel is not always appreciated - strings in C are actually hard, and even the most safe standard functions like strlcpy and strlcat are still only good if truncation is a safe option in a given circumstance (it isn’t always.)&lt;p&gt;(~~Technically~~ Optionally, C11 has strcpy_s and strcat_s which fail explicitly on truncation. So if C11 is acceptable for you, that might be the a reasonable option, provided you always handle the failure case. Apparently, though, it is not usually implemented outside of Microsoft CRT.)&lt;p&gt;edit: Updated notes regarding C11.</text></item><item><author>paultopia</author><text>Its really wild, as a person coming from other languages who has written maybe ten lines of C in his life that the functions that seem to be massive footguns in C are, like, &amp;quot;format a string&amp;quot; or &amp;quot;get time in GMT.&amp;quot;  That&amp;#x27;s... really scary.</text></item></parent_chain><comment><author>paganel</author><text>This heavily filters for people who have had experience with programming in high-school or even before that, there&amp;#x27;s no way for a programming novice to pass that grueling routine.&lt;p&gt;And then people rhetorically ask themselves why students coming from economically disadvantaged households are under-represented in this industry (one of the best paying industries in this time and age). Stuff like that has got to change.</text></comment>
<story><title>Git&apos;s list of banned C functions</title><url>https://github.com/git/git/blob/master/banned.h</url></story><parent_chain><item><author>orwin</author><text>In my school, we had two days to understand the basics of text editors, git (add, commit, rebase, reset, push) and basic bash functions (ls, cd, cp, mv, diff and patch, find, grep...) + pipes, then a day to understand how while, if&amp;#x2F;else and function calls work, then a day to understand how pointer work, then a day to understand how malloc(), free() and string works (we had to remake strlen, strcpy, and protect them). Two days, over the weekend, to do a small project to validate this.&lt;p&gt;Then on the monday, it was makefiles if i remember correctly, then open(), read(), close() and write(). Then linking (and new libc functions, like strcat) . A day to consolidate everything, including bash and git (a new small project every hour for 24 hours, you could of course wait until the end of the day to execute each of them). And then some recursivity and the 8 queen problem. Then a small weekend project, a sudoku solver (the hard part was to work with people you never met before tbh).&lt;p&gt;The 3rd week was more of the same: basic struct&amp;#x2F;enums exercises, then linked list the next day, maybe static and other keyword in-between. I used the Btree day to understand how linked list worked (and understand how did pointer incrementation and casting really work), and i don&amp;#x27;t remember the last day (i was probably still on linked lists). Then a big, 5-day project, and either you&amp;#x27;re in, or you&amp;#x27;re out.&lt;p&gt;I assure you, strings were not the hardest part. Not having any leaks was.</text></item><item><author>InvOfSmallC</author><text>I teach at university as external lecturer. Teaching strings in C is the hardest thing I have to do every time. The university decided to explain C to first year student without previous experience. My feedback was to do a precourse in Python to let them relax a bit with programming as a concept and then teach C in a second course.</text></item><item><author>jchw</author><text>Unfortunately, much of the pain with C surrounds dealing with strings. It’s been a bit of a theme on Hacker News for the past few days, but it’s actually a pretty good spotlight on something I feel is not always appreciated - strings in C are actually hard, and even the most safe standard functions like strlcpy and strlcat are still only good if truncation is a safe option in a given circumstance (it isn’t always.)&lt;p&gt;(~~Technically~~ Optionally, C11 has strcpy_s and strcat_s which fail explicitly on truncation. So if C11 is acceptable for you, that might be the a reasonable option, provided you always handle the failure case. Apparently, though, it is not usually implemented outside of Microsoft CRT.)&lt;p&gt;edit: Updated notes regarding C11.</text></item><item><author>paultopia</author><text>Its really wild, as a person coming from other languages who has written maybe ten lines of C in his life that the functions that seem to be massive footguns in C are, like, &amp;quot;format a string&amp;quot; or &amp;quot;get time in GMT.&amp;quot;  That&amp;#x27;s... really scary.</text></item></parent_chain><comment><author>PoignardAzur</author><text>Ooh, the Epitech cursus. Nice.&lt;p&gt;Also, I&amp;#x27;d say &amp;quot;not having segfaults&amp;quot; is the hardest thing to get right when you&amp;#x27;re going through that.</text></comment>