As a programmer who grew up without a FPU (Archimedes/Acorn), I have never liked float. But I thought this war had been lost a long time ago. Floats are everywhere. I’ve not done graphics for a bit, but I never saw a graphics card that took any form of fixed point. All geometry you load in is in floats. The shaders all work in floats.
Briefly ARM MCU work was non-float, but loads of those have float support now.
I mean you can tell good low level programmers because of how they feel about floats. But the battle does seam lost. There is lots of bit of technology that has taken turns I don’t like. Sometimes the market/bazaar has spoken and it’s wrong, but you still have to grudgingly go with it or everything is too difficult.
I think you got that wrong, you got +Inf, -Inf and two NaNs, but they’re both just NaN. As you wrote signed NaN makes no sense, though technically speaking they still have a sign bit.
I just gave up fighting. There is no system that is going to both fast and infinitely precision.
So long ago I worked in a game middleware company. One of the most common problems was skinning in local space vs global space. We kept having customers try and have global skinning and massive worlds, then upset by geometry distortion when miles away from the origin.
I’m a hobbyist game dev and when I was playing with large map generation I ended up breaking the world into a hierarchy of map sections. Tiles in a chunk were locally mapped using floats within comfortable boundaries. But when addressing portions of the map, my global coordinates included the chunk coords as an extra pair.
So an object’s location in the 2D world map might be ((122, 45), (12.522, 66.992)), where the first elements are the map chunk location and the last two are the precise “offset” coordinates within that chunk.
It wasn’t the most elegant to work with, but I was still able to generate an essentially limitless map without floating point errors poking holes in my tiling.
I’ve always been curious how that gets done in real game dev though. if you don’t mind sharing, I’d love to learn!
That’s pretty neat. Game streaming isn’t that different. It basically loads the adjacent scene blocks ready for you to wonder in that direction. Some load in LOD (Level Of Detail) versions of the scene blocks so you can see into the distance. The further away, the lower the LOD of course. Also, you shouldn’t really keep the same origin, or you will hit the distort geometry issue. Have the origin as the centre of tha current block.
I’m a Senior Software Engineer, outside of countries where engineer is a protected title. I’m also a Beep-Boop Technician, Specialized Generalist (not Full-Stack since I have mostly succeeded in avoiding JS, until this afternoon), Problem Fixer, Technical Diplomat, Cat Herder (sometimes a tech lead), and The-Mean-Guy-That-Rejects-Commits-When-There-Are-API-Calls-Made-Without-TLS-Encryption-And-Hardcoded-Secrets (infosec likes me but always seems genuinely confused at a dev not fighting them).
I’m a Senior Software Engineer, outside of countries where engineer is a protected title. I’m also a Beep-Boop Technician, Specialized Generalist (not Full-Stack since I have mostly succeeded in avoiding JS, until this afternoon), Problem Fixer, Technical Diplomat, Cat Herder (sometimes a tech lead), and The-Mean-Guy-That-Rejects-Commits-When-There-Are-API-Calls-Made-Without-TLS-Encryption-And-Hardcoded-Secrets (infosec likes me but always seems genuinely confused at a dev not fighting them).
Oh man, I didn’t think that’d work haha… Kind of you to offer but I was recently promoted and wouldn’t feel right leaving now. Partially out of respect for my boss and partially because we are severely understaffed. But seriously, thanks for offering to ask around. Very generous of you to offer your help to a stranger ❤️
I’m learning that I’m just enough of a front end dev to make a very ugly site. Navigating all the various CSS and JS frameworks feels like pulling teeth.
Having a familiarity is absolutely a great thing. The syntax isn’t alien, so, debug and guiding juniors through figuring out why their project isn’t working isn’t too terrible. The typing is probably what drives me crazy the most. It’s just bad and the standard library doesn’t seem to be equipped to handle every type that it can “support” cleanly.
since I have mostly succeeded in avoiding JS, until this afternoon
Sorry to hear that. I hit the same pothole about 6 months ago. I had been so fine with avoiding JS, but the guys building our admin console broke their build and couldn’t figure out how to fix it. Even worse, then I had to write up best practices for JS
Yeah. Fortunately, I didn’t have to do the programming. Unfortunately, I had to guide the debug. Happy to help people learn but the language, especially in its typing, is just awful.
Not really. I believe : is the “true” builtin. So it’s like running a program that exits with zero and writes nothing to stdout. The >> streams the empty stdout into the named file.
I’m betting that’s why none ever materialized. Most tools that can manipulate a file, can also create that file first, so there’s just never been a usecase.
Right-clicking the desktop to create a new txt file in Windows feels so natural, but I can’t really think of any time you’d want to create a new file and do nothing with it in a CLI.
One use case is if you’re running a web server that is configured to return a “maintenance” page instead of the live site if a particular file exists. Which is actually pretty cool because then you don’t have to update the config when you need to do something or let your users get a bunch of 502 errors, you just touch maintenance and you’re good.
I’ve found Ostranauts recently, and it’s really fun and I feel has some of the same vibes. Not even close to the same though, being able to program your own systems that you put together. I still sometimes think about what 0x10c could have been. I’ve considered doing something similar myself, but I haven’t gotten around to it. Maybe someday something similar will exist.
vimtutor, which I believe is installed with vim by default
Edit: My brain apparently inserted an extra word that made it seem like you were seeking said program. Leaving it though for those wondering in the future.
Yeah, but imo the best way to learn vim is to do it as you go. You only really need to know getting in and out of insert and how to write and quit. Once you’ve got that, if you wanna do something and think there’s probably a better way than moving there with the arrow keys, look it up on the Internet, remember the thing, do it a few times and you’ve learned a new thing about vim. “Surely there’s a search and replace function” yeah, is substitute with the s command. “I wanna navigate quicker within lines” use f, t and their capital versions. Combine with the quickscope plugin and you’re golden. Learn the stuff you want to use, don’t memorize commands you don’t need
Escape first, because it wants to keep you inside the matrix and you need to tell it you are trying to escape
q!
Because you probably don’t want to save whatever you’ve accidentally done to that file trying to quit, and you have to add an exclamation point because unless you yell loudly at vim it won’t listen
Thing is, I can express in Excel in 2 hours what takes two weeks to develop in production. And I’m not arguing against moving things onto a production footing. But hot damn, as a prototyping tool for how to treat data, Excel and Jupyter is near flawless.
programmer_humor
Active
This magazine is from a federated server and may be incomplete. Browse more on the original instance.