Things of Your Day


#1817

#1818

#1819

#1820

A young chap playing All Star on the sharpest tool in his shed.


#1821

#1822

#1823

#1824

Terry Crews and a follow-up to his #metoo story


#1825

I received this in my mailbox today.

Yes, even snail mail is resorting to clickbait.


#1826

#1827

#1828

#1829

Yes, this is an actual photograph


#1830



#1831

#1832

After reading this I wonder why other text editors don’t adopt Notepad’s architecture for opening files.


#1833

The only reason I can think of is that memory mapping files isn’t part of the standard, portable C/C++ APIs. If you want to memory map a file, you need to call an OS-specific API (CreateFileMapping() on Windows, mmap() on Unix and its clones), whereas most C/C++ programmers generally first think of calling fopen() or std::fstream as they are universal and portable across all OSes as part of the standard C/C++ libraries.


#1834

I, for one, love me some code riddled with stuff like

#ifdef WIN32

#1835

Back at my first job out of college, I had to work on a program that had to run on Windows, about a half dozen different versions of Unix, and even Unisys OS 2200. We didn’t want to #ifdef the crap out of our mainline code, so we ended up creating abstraction libraries that hid the various OS differences between each other, so we’d just call, for example, my_mmap() which would do the right thing to memory-map a file depending on the OS. Almost all the #ifdefs were relegated to this library, which made the mainline code much cleaner, and it would be my preference if working on anything portable that needs to use non-portable OS-level services.


#1836

Yeah, that’s kind of the obvious architecture. If a project isn’t even abstracting things away at that kind of basic level, then it’s either old legacy crap or being written by people with not enough experience.