News for hackers. Stuff that matters.
Re:Everything I wish I knew when learning C by fastaguy88 on Monday November 28, 2022 @11:41AM (#33775806)
I find this article very strange, perhaps because I started using 'c' so long ago. To the bullet points:

(1) In general, 'c' is always 'c' at the command line, regardless of the platform.

(2) yes, there are options and build tools, but cc my_program.c -o my_program works fine. I have a very hard time figuring out how to compile/run java.

(3) hard to see how this has anything to do with 'C', vs any other compiled language.

(4) so?? I would think I would be more concerned about how to use 'c' for my problem, without worrying about how to use 'c' to solve some other problem. It is hard for me to understand why a language that can do many things is more problematic than a language that only does a few things.

My sense is that reading this article makes things harder, not easier. Most people do not care whether an int is 32 or 64 bits.

I won't argue that copying things (that are not ints or floats) needs to be understood, but many popular languages (specifically python) have the same problem. Understanding the difference between a reference and a value is important for most languages.

There are different schools of thought -- those that can imagine lots of issues after reading the documentation, vs those that simply try writing code and start exploring edge cases when something breaks. I learn faster by trying things, and rarely encounter the edge-case issues.

Re:Everything I wish I knew when learning C by msla on Monday November 28, 2022 @11:48AM (#33775891)
Now I need to make a C dialect with better string handling built-in and call it 'C'
Re:Everything I wish I knew when learning C by alana314 on Monday November 28, 2022 @02:36PM (#33778447)
Agreed, I tore my hair out trying to figure out strings in C
Re:Everything I wish I knew when learning C by alcover on Monday November 28, 2022 @06:25PM (#33781362)
Working on it so you don't have to !

You'll enjoy comfy stuff like

  let s = "string.."
  s += "handled"
The runtime Buffer type is already operational (https://github.com/alcover/buffet)
Re:Everything I wish I knew when learning C by jklehm on Monday November 28, 2022 @12:17PM (#33776335)
It's largely the same, aside perhaps from not shipping with the java compiler by default:

  * install java (includes compiler/runtime): `sudo apt install default-jre`
  * compile: `javac MyProgram.java`
  * run:     `java MyProgram`