2

I am working to learn more about unix and linux for a project. I noticed that Unix is the parent system of Mac OS and also of linux.

Are the two similar in scope of C based programming? And how closely do they relate to linux?

closed as too broad by Michael Homer, Archemar, HalosGhost, GAD3R, Anthon Oct 9 '16 at 22:18

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • b came before c - C++ came after C but there are so many different languages Pascal, Fortran, Ada, Basic, ... I don't think you can think of them as an heirachy. I'm not sure if there was an A before B maybe that was Assembler (machine language). – X Tian Oct 14 '15 at 15:20
  • Unix history is a lot more complex than that. Mac OS X and Linux are both Unix-like, neither are officially Unix. – teppic Oct 14 '15 at 15:35
  • @teppic Mac OS? Or Mac OS X? And are they the same thing? – Callat Oct 14 '15 at 15:38
  • 2
    @teppic mac OS X is officially UNIX. – casey Oct 14 '15 at 15:48
  • 1
    @teppic MacOS X 10.11 el capitan is certified UNIX 03. The earlier versions of X are also certified. opengroup.org/csq/search/t=XY1.html – casey Oct 14 '15 at 15:52
4

Unix is not an OS but rather a family of OS. Mac OS is OS. Linux is not OS but a kernel

If you want to learn C programming it doesn't matter on which OS you use because all that matter is compiler. Different compiler will give you slightly different binary but for learning purpose they will all be almost same.

I recommend clang or gcc for novice users learning C language
(my personal opinion: clang is recommended by experts because it is faster than gcc and its error reporting is better than gcc. Difference between clang and gcc)

  • Thanks @edwardtorvalds I'll be sure to give those a check. – Callat Oct 14 '15 at 15:32
  • There are loads of differences between OSes when it comes to C programming. Plus clang's certainly not better than gcc. – teppic Oct 14 '15 at 15:38
  • @teppic care to venture one? plus note I mentioned it for beginners they should concerntrate on C programming rather than on OS – Edward Torvalds Oct 14 '15 at 15:39
  • Well, the question concerns Unix programming in C. For standard library stuff there's no real difference but all of the BSD/SysV/POSIX stuff varies. – teppic Oct 14 '15 at 15:43
  • 1
    @PSkocik but for learning purpose does it matters on which OS you learn? i dont think so – Edward Torvalds Oct 14 '15 at 16:04
2

Mac OS X and Linux implement an interface between user programs and an OS kernel. This interface started in Unix and got standardized in the so called POSIX* standard. Advanced Programming in the Unix Environment is a good book to read if you want to learn about this interface. Unix is more than just the implementation though. It's about a philosophy of developing software the summary of which can be found at http://www.faqs.org/docs/artu/ch01s06.html (it's part of a whole book available online).

(*The story of the standards is really a little bit more involved. The books provide more details).

Not the answer you're looking for? Browse other questions tagged or ask your own question.