News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by the_gipsy on Saturday September 21, 2019 @12:50PM (#21036382)
The guy should try Rust and then explain why he prefers either, that would be interesting.
Re:Why I Write Games in C (yes, C) by et2o on Saturday September 21, 2019 @12:52PM (#21036406)
Interesting.

I want to like rust but everytime I dive in it is getting more and more complicated and verbose.

Re:Why I Write Games in C (yes, C) by sha666sum on Saturday September 21, 2019 @01:30PM (#21036669)
My experience with Rust is that I have to fight the compiler a lot, but when the program compiles, it works. If it doesn't work, it means there's an error with my file/network paths or I did something in the wrong order, errors which no language can save me from.

Rust also becomes a lot less verbose when you get better at it. The ? operator is especially useful.

Re:Why I Write Games in C (yes, C) by TurboHaskal on Saturday September 21, 2019 @01:45PM (#21036770)
> but when the program compiles, it works

That's not even true for languages with dependent types, which Rust lacks.

Re:Why I Write Games in C (yes, C) by sha666sum on Saturday September 21, 2019 @04:10PM (#21037650)
It is (or should be) read as slightly hyperbolic, as there isn't to my knowledge a language that actually works that well. I could water down my message by saying "it mostly works", but then I fail to convey the main reason why I posted in the first place.

I could also instead spend a lot of time and words to explain things about Rust's design that I presume anyone who is slightly interested in the language would already know (specifically: lack of null, strict ownership checking, having to explicitly deal with errors), in order to explain that the language succeeds at solving some of the problems it was specifically designed to solve. But then I would just be repeating things that HN readers presumably already know. Instead I can use a shortcut in my communication which is perfectly understandable if you assume minimal intelligence, and take the other person's comment in good faith.

See, by the time we've reached the bottom of this wall of text, anyone who read this far through my intentional rambling has presumably forgotten my initial point: I had a positive experience with the language.

Re:Why I Write Games in C (yes, C) by oconnor663 on Saturday September 21, 2019 @02:27PM (#21037018)
And at the same time, I've heard people say "when it compiles, it works" about much weaker type systems, like Go's. It just seems to mean "this language catches more errors at compile time than the previous language I used."
Re:Why I Write Games in C (yes, C) by sha666sum on Saturday September 21, 2019 @04:22PM (#21037705)
> It just seems to mean "this language catches more errors at compile time than the previous language I used."

That is a fair interpretation. I've programmed mostly in C# and Java because that's what was required at the time. I also know enough C and C++ to aim at my toes instead of the entire foot. So the comparison is between strongly typed imperative programming languages which are syntactically close to Rust.

Also, I like that Rust isn't OoP, but try to not get baited into that discussion.

Re:Why I Write Games in C (yes, C) by ncmncm on Sunday September 22, 2019 @04:55AM (#21040364)
"Out of pocket"?
Re:Why I Write Games in C (yes, C) by oconnor663 on Monday September 23, 2019 @11:25PM (#21056197)
object oriented programming
Re:Why I Write Games in C (yes, C) by ncmncm on Wednesday September 25, 2019 @01:06PM (#21072781)
Normally only prepositions and articles are left in lower case, e.g. SaaS.
Re:Why I Write Games in C (yes, C) by mlindner on Sunday September 22, 2019 @01:21AM (#21039811)
From what I've seen if you fight the compiler a lot it means you're trying to write something that very non-trivial memory ownership. Just as RAII is a learned concept, so is understanding memory ownership. Hopefully it will be taught more in school along the lines of RAII and similar concepts.
Re:Why I Write Games in C (yes, C) by Aeolun on Saturday September 21, 2019 @01:39PM (#21036735)
Less verbose, more complicated in my opinion.
Re:Why I Write Games in C (yes, C) by z3phyr on Saturday September 21, 2019 @01:33PM (#21036697)
I like rust, but for me, it is significantly more difficult to read and write. Same can be said about C++ with extreme STL code..

I prefer to read and write simple C like syntax. I would love it if I can get Rust concept of borrowing in C, or even simple operator overloading..

Re:Why I Write Games in C (yes, C) by Johan-bjareholt on Sunday September 22, 2019 @08:35AM (#21041081)
Ironic, the most complicated thing for me to understand when I started writing rust was borrowing and lifetimes. The rest of the common features of Rust isn't too complicated to understand.
Re:Why I Write Games in C (yes, C) by z3phyr on Sunday September 22, 2019 @12:26PM (#21042188)
Understanding the concepts is not the issue with me (as of now). It is the hard to read syntax (my personal opinion!). It puts a lot strain on my mind. Same is the case with C++ with extreme use of STL. I have difficulty in reading that, although with clear mind, I will eventually get the code, it is not fun.
Re:Why I Write Games in C (yes, C) by wwright on Saturday September 21, 2019 @01:44PM (#21036764)
You’re free to use Rust that way if you prefer.
Re:Why I Write Games in C (yes, C) by Avamander on Saturday September 21, 2019 @07:56PM (#21038693)
Same, I heavily prefer less symbols in my code. I think it might also relate to how I find it much harder to remember long formulas but than remembering the sentence describing the formula. If I could type for example `brw x` instead of `&x` I think I'd like it more - I guess I like it more Python-y?
Re:Why I Write Games in C (yes, C) by cdirkx on Saturday September 21, 2019 @08:54PM (#21038922)
You could use a macro :)

  macro brw($expr:expr) { &$expr }
And use it like 'brw!(x)' instead of '&x'.
Re:Why I Write Games in C (yes, C) by kristoff_it on Saturday September 21, 2019 @01:31PM (#21036682)
He clarified in the post that he doesn't like the complexity that C++ brings, he probably won't appreciate Rust's either.
Re:Why I Write Games in C (yes, C) by mrec on Saturday September 21, 2019 @02:46PM (#21037124)
He very definitely won't like Rust's compile/link times.
Re:Why I Write Games in C (yes, C) by ChrisSD on Saturday September 21, 2019 @02:43PM (#21037106)
I'm not sure that rehashing Rust vs. C is particularly interesting at this point. At least not for those who regularly read HN. Maybe in another few years...
Re:Why I Write Games in C (yes, C) by eigenloss on Sunday September 22, 2019 @12:43AM (#21039707)
Sounds like Rust has come pretty far.
Re:Why I Write Games in C (yes, C) by ragnaroekX on Saturday September 21, 2019 @01:15PM (#21036547)
I had the same thought. I never used C in a real project, but use Rust a lot. I looks like a real replacement for C.