Earlier quoted context omitted.
map/filter/reduce is simpler, but it takes some getting used to. Loops have worn a deep rut in my brain.
As someone who was introduced to programming via map/filter/reduce, for loops are incredibly more complicated. I don’t think I’ve ever written one correctly on first try.
So you think you know C? (2016)
281–290 of 344 posts
Re: So you think you know C? (2016)
#282In the end this test proved to be a really valuable, because the "I don't know" drove the point home, specially for smart folks who don't like to answer any test, ever, with "I don't know".
Re: So you think you know C? (2016)
#283And for the fifth (return i++ + ++i;) it warns "Multiple unsequenced modifications to 'i'".
I would not skip those warnings.
Re: So you think you know C? (2016)
#284i = 0; return i++ + ++i;
Could produce different results?
Re: So you think you know C? (2016)
#285Re: So you think you know C? (2016)
#286Could someone explain why in question 5 i = 0; return i++ + ++i; Could produce different results?
Re: So you think you know C? (2016)
#287Re: So you think you know C? (2016)
#288Earlier quoted context omitted.
Apple says the future is C++ and Swift. Microsoft says the future is a mix of constrained C++ (Core Guidelines), Rust and AOT C#. Google says the future is C++ and Java (as of Treble) on Android, with Go, C++ and Rust on ChromeOS and Fuchsia. ARM says C++ on mbed. GenodeOS says C++ and Ada. Newton, Symbian, Bada and BeOS used C++. C is married with UNIX, they were born to each other, other OSes have long followed oth…
Minor point, but isn't Android moving to Kotlin? I don't think they see Java being a sustainable choice for the long term.
Apparently they are also adding support for desugaring Java 10 language features (yep 10 not 12) that don't rely on new JVM bytecodes (as per Google IO talk about state of Android tooling).
At least for now.
Re: So you think you know C? (2016)
#289My score is 3/5. One immediate redflag I have noticed is using "int", "char", "short" as if they have a definite size. They don't. C standard only guarantees a minimum size. For example, many PDPs are 36-bit. Assuming the size of a variable is a common practice nowadays, but at least one should use uint8_t, int32_t, etc. from stdint.h. But I was still tricked, it should be obvious in hindsight, 12 years of schooling…
I knew "int" was sort of platform-dependent (was 16-bits generally when I was learning to code, later 32-bit became more typical) — so combined with that niggle and all the "I don't knows", I (correctly) reevaluated by first couple of answers.
Still, didn't realize the last one was compiler-dependent.
Re: So you think you know C? (2016)
#290Earlier quoted context omitted.
There's explanations at the bottom after you click the button.
I read it but I still don’t understand. Isn’t it 0 + 2 vs 1 + 1? How would it produce something other than 2?
I could imagine the post-increment happening after the sum: giving 0 + 1…