Re:C++17 – better than you might think
by NKCSS on Thursday December 29, 2016 @07:27AM
(#13276929)
I wonder why it feels like I can't move at the same pace with C++ compared to C#; want to have a file copied to your output dir? Create a post-compile task; with C# you can just set a property to 'copy always'. Want to add a reference? Set up which dir's to look for, type names, etc. with C#: add reference, choose your dll/whatever and you're done! And those are just a few. One of the biggest hurdles with C++ is type conversion; I recently wrote a small app; most time was spent writing functions to cast/convert all the 9000 ways to define numbers and strings... It's when you start to appreciate the System.Object model that makes sure everything can be represented as a Unicode string that everything knows how to work with.
[ Parent
| on HN ]
You are comparing apples to oranges here.
I also agree that type system in C++ is not perfect and is rarely used in a sensible manner. Yet I would rather look for inspiration in functional statically-typed languages rather than in specialized "multi-paradigm" dynamically-typed ones.
I know it's not fair, but because I write identical apps in both languages, it's one that comes to mind frequently and it becomes very apparent how powerful C# is when it comes to Rapid Application Development.
Re:C++17 – better than you might think
by nicolapede on Thursday December 29, 2016 @09:54AM
(#13277543)
> dynamically-typed ones
Why you consider C# to be dynamically-typed?
Re:C++17 – better than you might think
by blakeyrat on Thursday December 29, 2016 @11:56AM
(#13278358)
Just as an FYI, C# is more strongly-typed than C++.
On the flip side: Want to read a file of records into an array of structs?
Re:C++17 – better than you might think
by loup-vaillant on Thursday December 29, 2016 @01:10PM
(#13278872)
Every machine in the world is Little Endian, and I'm going to specify a file format -- https://en.wikipedia.org/wiki/WAV -- with C structs and type punning. Seriously, Microsoft?
Me, I just
static uint32_t
load32_le(const uint8_t s[8])
{
return (uint32_t)s[0]
| ((uint32_t)s[1] << 8)
| ((uint32_t)s[2] << 16)
| ((uint32_t)s[3] << 24);
}