Hacker News new | ask | show | jobs
by thelogos 4032 days ago
Personally, the hardest part for me was keeping track of the size of everything. Coming from a higher level language, keeping track of the bits and bytes takes some getting used to. Working with arrays in C is much tougher especially when the compiler will compile almost anything you give it, and even a small mistake is catastrophic.

Before C, I was pampered and took everything for granted. Now I appreciated my life more after C and feel blessed every time my IDE gives me a warning.

4 comments

My pet hate is #include files. The whole way that C handles multiple source files just seems archaic to me, having worked in higher-level languages. I wish C had a proper package system that was standard, so I don't have to mess around with things like include file path order (or my favorite, the C++ template definitions having to be in the header files thing I only recently learned about).
Interestingly, I first started with C (although I haven't written a line of C code for a long time), and when I first move to higher-level languages, I dislike the fact that I have no idea where the file I just imported is. Moreso when I'm playing with obscure/ new language: if I can just import whatever files I wanted (rather than at package level), it seems that would be much easier to hack on the language/std itself.
I have no idea where the file I just imported is

A sufficiently long include path can give you this problem anyway. I recently tripped over this when I created a "reason.h" and discovered that Windows had a file of the same name deep inside MFC.

I recently tripped over this when I created a "reason.h" and discovered that Windows had a file of the same name deep inside MFC.

It is my understanding that that would be solved by placing your file in a local directory called 'inc/' and having:

  #include "inc/reason.h" 
instead of:

  #include <reason.h>
(or just replacing "" with <>). But I have never programmed in VSC before, so I may be wrong.
I don't quite get this lament about being pampered in higher level languages. To me, it feels like someone saying they feel pampered for having indoor plumbing or running water.
Other systems programming languages e.g. Turbo Pascal, Modula-2, Ada, ... you don't have to track everything if you don't want to.
be sure to compile with -Wall -Wextra