Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pif
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
45 ms
·
601.
▲
by
pif
3y ago
I'm not sure that I understand your point. Actually, I wonder if you do ;-)
602.
▲
by
pif
3y ago
It is reasonable, but you must pay attention not to incur into undefined behaviour (which the post is about). An array of chars is the way to go for the C++ committee.
603.
▲
by
pif
3y ago
I stand corrected: there is one very good reason to want to treat a float like an integer. But if you can come up with such a solution, you are definitely not one to stop at their first guess, and you'll double-check the standard befor
604.
▲
by
pif
3y ago
No, it isn't! Casting any object pointer to (and from) void* or char* is guaranteed to work, while float to integer incurs in the undefined behaviour curse.
605.
▲
by
pif
3y ago
Or spend a few coffee breaks with the team leader of a particle accelerator during commissioning...
606.
▲
by
pif
3y ago
No, sorry, you are wrong. If you are interested in the actual bits, char* is the way to go.
607.
▲
by
pif
3y ago
In that case, you need a cast from float* to char*, which is guaranteed to work. There is no sane reason to want to access a float as an integer.
608.
▲
by
pif
3y ago
> fwrite() dump floats to binaries That requires a cast from float* to void*. Reading the floating point number as an integer is not necessary.
609.
▲
by
pif
3y ago
Serialization of floating point number makes a lot of sense. But you don't need to read it as an integer.
610.
▲
by
pif
3y ago
> My go-to example in C++ is examining a floating-point number as an integer Which is something that hardly makes any sense and most professional will never need in their entire career.
611.
▲
by
pif
3y ago
> Proper project management takes alot of time Typical proper management is based on estimations given in front of the coffee machine. Exceptional projects have the coffee machine substituted with a wine bar.
612.
▲
by
pif
3y ago
A few years ago, our management summoned some contractors to enlighten us on how to properly estimate a project. They taught us The Way (TM), and proudly stated that they were renowned for their respect of the deadline. I wasn't snarky
613.
▲
by
pif
3y ago
> but at the end of the day they just want releases of new features I do not understand how this reality could surprise any professional developer. Code quality, clean architecture, elegant algorithms, technical documentation, unit tests
614.
▲
by
pif
3y ago
> America actually has a huge public transportation system servicing most homes in the US. It’s the bus system for public schools. That quite a straw man, my friend! A bus that runs twice per day, with a fixed number of passengers, all o
615.
▲
by
pif
3y ago
I was in Southern Italy, suffering for a weather that did not correspond to what I read in my school books, and learning to hate the words "Azores anticyclone". And later I switched to yearning for the comparatively friendly Azore
616.
▲
by
pif
3y ago
> and perhaps stymie the increasing desertification of thre Iberian peninsula I think I get your point. I'm ready to take huge risks in order to support anything that may weaken the permanent African anticyclone.
617.
▲
by
pif
3y ago
Your anecdote is very interesting, thank you!
618.
▲
by
pif
3y ago
Could this effect be caused, or enhanced, by the aerodynamics of the modern cars?
619.
▲
by
pif
3y ago
> Phonetic spelling implies that there's at least one pronunciation that correlates 1:1 to spelling No! Phonetic spelling implies that each pronunciation correlates 1:1 with one spelling.
620.
▲
by
pif
3y ago
> you'd need centralised control over pronunciation as well. No, not at all. Several Italian words have regional variants, and they are simply spelled differently. When you are used to a phonetic alphabet, you never wonder how to wr
621.
▲
by
pif
3y ago
> German-speaking Swiss share their written language with Germans ... but they are perfectly capable of talking in a way that is 100% indecipherable for Germans You are talking there of a proper language on one side, and a bunch of non-c
622.
▲
by
pif
3y ago
> What was straight spelling 10-20 centuries ago is now mismatch I'm afraid you don't know how things work when people are used to phonetic correspondence: pronunciation changes, and spelling follows naturally. As an example, c
623.
▲
by
pif
3y ago
I agree with you: it's a balancing act.
624.
▲
by
pif
3y ago
> dicotomy falacy Not at all. I'm not stating that smog is fine. I'm only stating the obvious: overall quality of life is more important than smog. It's obvious, too, that no smog can increase quality of life, depending on
625.
▲
by
pif
3y ago
> look at the color of the sky over China's largest cities But they are still the largest cities in China: people are flowing towards the smog, not escaping from it. Eating under a grim sky has always been incredibly better than st
626.
▲
by
pif
3y ago
The proper use of the Latin alphabet, or any other alphabet, should be top priority. Phonetic spelling: if you see it, you can pronounce it; if you hear it, you can write it. Spelling bees have no sense in a rational language.
627.
▲
by
pif
3y ago
So what? Ecology is secondary to life quality.
628.
▲
by
pif
3y ago
> Lindy is pretty much just natural selection for ideas, right? It doesn't prove they are optimal. You missed the point. Lindy law proves that being optimal is not necessary for an idea to be successful. Your association with natura
629.
▲
by
pif
3y ago
IPv6 lacks back compatibility with the current standard. It cannot succeed.
630.
▲
by
pif
3y ago
More likely, we will end up with 15 competing standard. https://xkcd.com/927/
More ›