Live data from Hacker News

Getting started with C

not.cafe

1–10 of 106 posts

Re: Getting started with C

#2
The article uses nano throughout. Is nano a popularly used editor? I have not seen anyone around using nano. I see vim, atom, sublime, vs code but never nano. Just curious if nano is popular.

If nano is popular what are its pros and cons?

Re: Getting started with C

#3
Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

Re: Getting started with C

#4

The article uses nano throughout. Is nano a popularly used editor? I have not seen anyone around using nano. I see vim, atom, sublime, vs code but never nano. Just curious if nano is popular. If nano is popular what are its pros and cons?

Nano is the easiest-to-use terminal-based editor that you're likely to find on a Unix system by default. All the important key commands are listed at the bottom of the screen and everything! It's a great editor to recommend in beginner tutorials since it requires very little setup or learning to use, but if you're already happy with a different one there's probably no reason to switch.

Re: Getting started with C

#5
post #3

Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

Re: Getting started with C

#6
post #5
post #3

Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

Just read K&R for 10 minutes.

Re: Getting started with C

#7
post #3

Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

..and that uses non-standard concepts like GObject.

Win32 examples would have been peak hilarity.

More seriously, I see where the author is coming from, but even historically, GUI code has always been a massive pain in C.

Re: Getting started with C

#8

The article uses nano throughout. Is nano a popularly used editor? I have not seen anyone around using nano. I see vim, atom, sublime, vs code but never nano. Just curious if nano is popular. If nano is popular what are its pros and cons?

I use it on a daily basis. It's simple, fast and has syntax highlighting. And it's still actively developed[0] (latest release: 2020 December 2 - GNU nano 5.4 "Terre des hommes")

[0] https://www.nano-editor.org/news.php

Re: Getting started with C

#9

The article uses nano throughout. Is nano a popularly used editor? I have not seen anyone around using nano. I see vim, atom, sublime, vs code but never nano. Just curious if nano is popular. If nano is popular what are its pros and cons?

I've found nano really easy to pick up for quick introductions to editing files via a terminal.

Nano seems to have a shallow learning curve for new users in comparison to vi, vim emacs as it works similar to other simple text processors.

It isn't as powerful as other editors and can't be configured as much but for some, especially beginners, that's a benefit.

Re: Getting started with C

#10
This is a very strange "getting started" guide to C, and I'm not sure who the intended audience could possibly be.

The tone at the start really does seem to be aimed at "absolute beginners" ("[...] programs must be written in a very strict way. Miss a comma and the program will stop working"), but then it quickly gets into the weeds without much explanation.

I'm trying to imagine an beginner reading this: The first thing we're told to do is "Installation", that makes sense. Then the first line says "The Apple provided C compiler is the LLVM clang compiler". But what's a compiler? How does that help me learn C? The tutorial hasn't even indicated that C is a compiled language, or what a compiler does at this point, and it doesn't elaborate on this throughout.

We go on to a hello world example, and we're told to type in some code ("Remember: programming languages are very strict, so type it exactly"), and then we're given an explanation of what it's doing: Great! I can't wait to learn what this means. But the explanation uses terms that a beginner would not be familiar with: The very first line of the explanation is "the first line loads the stdio.h function library, which provides the printf() function, used to write a message on the terminal". What's a function? What's a library? Obviously these things are trivial to anyone with programming experience, but for an absolute beginner, these terms don't yet have an intuitive meaning, and they're never fully explained in the article.

We compile that program (again, never being told what compilation is or why it's necessary), and then we're suddenly thrust into writing a GTK+ program. We haven't covered the absolute basics like types, pointers, etc, and yet we're given a huge chunk of (reasonably complex) code with no explanation, and just told to "read the code bottom to top" as an "additional hint".

I think a much better title for this would be "getting started with C tooling", but even then, the article does a very poor job of explaining why such tooling is even necessary.

Post reply on HN