HackerTrans
TopNewTrendsCommentsPastAskShowJobs

david2ndaccount

no profile record

Submissions

Samsung Fridge's New Update Gives You Ads While Tracking Your Food

howtogeek.com
2 points·by david2ndaccount·9 месяцев назад·0 comments

comments

david2ndaccount
·2 месяца назад·discuss
Use the new standards-conformant preprocessor with `/Zc:preprocessor`

https://learn.microsoft.com/en-us/cpp/build/reference/zc-pre...
david2ndaccount
·3 месяца назад·discuss
Pascal strings might be the only string design worse than C strings. C Strings at least let you take a zero copy substring of the tail. Pascal strings require a copy for any substring! Strings should be two machine words - length + pointer (aka what is commonly called a string view). This is no different than any other array view. Strings are not a special case.
david2ndaccount
·5 месяцев назад·discuss
The world won’t allow a dependence on a single geopolitically threatened entity in the long run, so either they defuse that risk themselves or risk a competitor filling that role. This move is better for TSMC itself.
david2ndaccount
·7 месяцев назад·discuss
If you want to remain portable, write your code in the intersection of the big 3 - GCC, Clang and MSVC - and you’ll be good enough. Other implementations will either be weird enough that many things you’d expect to work won’t or are forced to copy what those 3 do anyway.
david2ndaccount
·7 месяцев назад·discuss
You can apply `#` to __VA_ARGS__, which won’t preserve the exact whitespace, but for many languages it’s good enough. biggest issue is you can’t have `#` in the text.
david2ndaccount
·8 месяцев назад·discuss
I wrote a similar article in the past: https://www.davidpriver.com/ctemplates.html

I use this technique in my hobby projects as it has worked out the best for me of the options I’ve explored.
david2ndaccount
·8 месяцев назад·discuss
Works with MSVC if you add /Zc:preprocessor (to get a standard compliant preprocessor instead of the legacy one).
david2ndaccount
·3 года назад·discuss
I regret to inform you that was released in 2014, almost a decade ago.
david2ndaccount
·3 года назад·discuss
This works for MacOS because there are system frameworks you can rely on being installed (like AppKit) and that actually have backwards-compatibility (at least for a while). Linux distros don’t have this (not even for glibc), so you’d have to literally everything in your app image folder. Every GUI app bundling QT or other gui framework would be a ridiculous waste of space.
david2ndaccount
·3 года назад·discuss
Approximately, the slowest thing you can do in a program is memory allocation (and garbage collection is even slower). JS map allocates an entire new array.
david2ndaccount
·3 года назад·discuss
At this point it seems like sour grapes by the rust people.
david2ndaccount
·3 года назад·discuss
Rust’s choice of sigils is aesthetically displeasing. Double colons (::) and angle bracket generics are ugly. Unmatched apostrophes is jarring to those used to them being used for strings or character literals. It was an unforced error to imitate C++, which was forced to use those characters due to backwards compatibility with C and the C preprocessor. A new language doesn’t have to use those characters. For example, the D language uses the dot as a path separator for modules, namespaces, templates, etc. as do other languages like Python.