Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Kazinsal
Dec 13, 2011


There's a line in zlib's adler32.c that reads /* the derivation of this formula is left as an exercise for the reader */.

gently caress you, Mark Adler. The job of a comment is not to tell the reader to figure it out himself.

Adbot
ADBOT LOVES YOU

Kazinsal
Dec 13, 2011


Blinkz0rz posted:

The horror is that he committed AWS keys in his source code.

Adding to that, the immediate response by the masses of internet know-it-all programmers was to blame Microsoft.

The idiot who committed AWS keys could have omitted VS from the post title, but then people would just call him a loving idiot for committing AWS keys. Because he is.

Kazinsal
Dec 13, 2011


I use the poo poo out of parens in some of my kernel code. Partially because it helps make casts and such look saner, and partially because it seems to turn dummy mode on in some programmers and they just assume I'm a loving wizard.

Kazinsal
Dec 13, 2011


VikingofRock posted:

That's really not that bad by Linus standards

"Mauro, SHUT THE gently caress UP!" will always be the gold standard of Torvalds pushing someone's poo poo in.

Kazinsal
Dec 13, 2011


Travis-CI looks really cool, and I want to try getting it to work with my project, but I'm a bit unsure about getting it to cooperate by building not one but two complete GCC cross-toolchains as a dependency. Especially after reading about that horror.

Kazinsal
Dec 13, 2011


What happens when someone writes an IRC bot in COBOL and then passes "output intermediate C only" to see what it generates before passing the intermediate to GCC?

https://gist.github.com/heddwch/8dbd1d5bf0af21f643b3

This nightmare.

Kazinsal
Dec 13, 2011


It's nice to be able to instantiate a new object of a class for a certain piece of hardware if there happen to be multiple of that hardware in the system. Find two RTL8169s on the PCI bus? Spin up two NetRealtek8169s or whatever.

Of course, you can approximate that with structs and function pointers in C if you're working in C, but C++ throws in poo poo like inheritance, which would be useful for similar chips that have slightly different register layouts and all that.

Kazinsal
Dec 13, 2011


Dylan16807 posted:

Well javascript counts UTF-16 code units, which is an answer guaranteed to be wrong for pretty much all uses.

It's all about the UTF-EBCDIC.

Kazinsal
Dec 13, 2011


Jumpingmanjim posted:

There's a negative zero?

Sure is. Have an exponent of zero, a mantissa of zero, and a negative sign, and you get a float that's negative zero.

Kazinsal
Dec 13, 2011


xzzy posted:

The fun part is that facebook still probably knows his favorite type of porn.

This gets really terrifying when you connect it to the idea that he visits "unrelated websites" through Tor.

Kazinsal
Dec 13, 2011


Suspicious Dish posted:

I actually find the overflow_usub version easier to read.

So do I. And if Torvalds is complaining about too many helper functions that no one knows what they do, he should just delete the Linux git repo and start over, because the kernel is loving full of them.

Kazinsal
Dec 13, 2011


The C standard pisses me off because in 2015 with the latest standard in use, it is still perfectly legal for sizeof(int) to be 2 bytes.

That is some serious early 70s poo poo and I do not appreciate it.

There are many stupid little gotchas in the standard like this. This is just the tip of the iceberg.

Kazinsal
Dec 13, 2011


That one you can pretty easily explain away.

Anything with wildly inconsistent indentation was copied and pasted from somewhere else, likely another student's work.

Kazinsal
Dec 13, 2011


Subjunctive posted:

I like the GIFs in our code review tool. :colbert:

If there's webm/mp4 support please tell me where to send my resume.

Kazinsal
Dec 13, 2011


Munkeymon posted:

I'm going tot go ahead and take issue with your use of the word "improvements". Or to put it another way, Parse error: syntax error unexpected T_SHFVRM

Similarly, T_PAAMAYIM_NEKUDOTAYIM is the dumbest, spergiest loving thing to put in an otherwise english-language set of errors. How the gently caress, other than seeing it enough to know what it means or googling it, is anyone who doesn't know Hebrew supposed to know that it means "double colon"?

One of the worst "features" in PHP by far.

Kazinsal
Dec 13, 2011



One of the examples is changing a commit in the official repo to be owned by Linus Torvalds. That's fantastic.

Kazinsal
Dec 13, 2011


Here's some coding horror in the prosumer products world: http://appleinsider.com/articles/16/02/12/bug-in-adobe-creative-cloud-updater-erases-root-level-mac-data

Adobe pushes an update for Creative Cloud on Macs that makes the assumption that they're going to be the first folder in the root directory and that whatever comes first is okay to wipe out. Some users don't have that folder and the first one in the list for them is .DocumentRevisions-V100, which is the OS X equivalent of the volume shadow copy store on Windows.

Kazinsal
Dec 13, 2011


Subjunctive posted:

I've worked on projects with subcomponents named "libpr0n" and "GraphicsEx", and I don't think anyone ever actually submitted a diff to change them (though diffs renaming directories weren't really a thing then I guess).

I am reminded of the Markdown rendering library libsoldout, which was changed from libupskirt after the person behind it was bombarded with so much hate she said she would have rather not written the library in the first place.

The developer was not a native english speaker and was basically forced out of open source development by the kerfuffle.

Kazinsal
Dec 13, 2011


Before Seventh Edition, crypt() wasn't even DES. It was introduced in Third Edition as a software implementation of the WWII M-209 cipher machine, using the user's password as both the key and the message to encrypt with the cipher. That was good enough for a project pretty much internal to Bell Labs and used almost entirely for word processing in the early 70s. In Seventh Edition they changed it to 25 rounds of DES on a block of zeros because guessing M-209 results became too fast to be secure by 1978/1979.

Technology marches on.

Kazinsal
Dec 13, 2011



Someone wrote an npm package that implements leftpad() by querying left-pad.io.

Kazinsal
Dec 13, 2011


Internet Janitor posted:

I've always assumed that C went with null-terminated strings because it lets you do in-place tokenization tricks and passing a pointer midway into a string without needing to reallocate anything makes writing recursive descent parsers very simple. They picked the representation that makes it easy to write a self-hosting compiler, and every other application paid the price.

Yeah, a lot of design tricks were needed to bootstrap a self-hosting compiler for a portable language and an OS written in it on a machine that generally shipped with 24 kilobytes of RAM.

Kazinsal
Dec 13, 2011


The first thing I thought of was Carmack's "// what the gently caress?".

It's absolutely amazing what you can do if you really have a deep understanding of things like IEEE 754.

Kazinsal
Dec 13, 2011


Suspicious Dish posted:

are there any important computers left that aren't little-endian

IBM z/Architecture, and ARM can be switched to big-endian data mode (pretty sure instructions are fixed little-endian though).

If SPARC counts, then it can switch endianness per-instruction! :pram:

Kazinsal
Dec 13, 2011


fritz posted:

cat-v.org considered tiresome.

I always felt like the Peoples Front of Cat-V seemed like it was a spin-off of SA. I could be entirely wrong though.

Kazinsal
Dec 13, 2011


A lot of Windows' API has been unchanged for a distressing number of years. I mean, take a look at the Hello World example from the Windows SDK circa 1985 and tell me how many functions you recognize...

http://www.charlespetzold.com/blog/2014/12/The-Infamous-Windows-Hello-World-Program.html

Kazinsal
Dec 13, 2011


You want to deal with a filename nightmare? Pulling files with astral plane characters in them off a FreeBSD ZFS box via tar -> scp -> untar onto a Windows machine is the worst loving thing I've done regarding filename encoding.

You'd think because it should be some kind of Unicode on both ends, it'd work well, but no. Somehow the multibyte encodings got mangled into codepage 437, the characters of which Windows promptly directly translated to what I *think* was UCS-2, but I'm not sure (eg. the UTF-8 sequence byte 0xB6 was interpreted as CP437, and became U+2562).

There are probably a number of things that Windows will happily munge in this way.

Kazinsal
Dec 13, 2011



Might be time to start thinking about :yotj: friend.

Kazinsal
Dec 13, 2011


It's weird old DOS/Windows code page crap that stuck around in the Unicode era.

Part of the reason from my understanding for the weirdness is because the backslash didn't exist before the ASCII standard was developed, and its origin was for writing out full-height logical AND and logical OR operators for ALGOL.

More fun: forward slash has been a valid path separator since paths were introduced to DOS in 2.0. All the developers were UNIX guys, but backslashes were used as the default at IBM's insistence because CP/M and the CP/M-like tools used forward slashes for switches. You could pass paths with forward slashes to the DOS API and it'd be totally fine with it, but COMMAND.COM and the CP/M-like environment used forward slashes for switches and backslashes for path separators because everything had to feel like CP/M.

The UX developers for DOS 2.0 then snuck in a system call and a corresponding CONFIG.SYS flag called SWITCHAR that let you set the switch character used by the option parsing API to a dash instead of a slash.

Kazinsal
Dec 13, 2011


dougdrums posted:

Instead of exceptions, computers should just catch fire. There would be far fewer bugs.

if you ain't segfaulting you ain't poo poo

Kazinsal
Dec 13, 2011


Google's system research projects are all in C, because why the gently caress would you use Go if you can choose between doing it in Go and C?

Kazinsal
Dec 13, 2011


Absurd Alhazred posted:

At that point flow control is the least of your problems. You're going to have to do stack manipulation, and that means writing assembly code.

Yeah, goto is acceptable when you're in the kind of mess that is low level kernel crap.

Kazinsal
Dec 13, 2011


DaTroof posted:

All you bare-metal motherfuckers both fascinate and terrify me.

Writing your own kernel from the ground up is an incredibly enlightening journey.

Holy gently caress the x86 architecture is a mess.

Kazinsal
Dec 13, 2011


The real question is, has anyone written FizzBuzz in Malbolge?

Kazinsal
Dec 13, 2011


Volguus posted:

I don't think they have any QA anymore. You are the tester, enjoy.

Microsoft truly embracing the open source way

Kazinsal
Dec 13, 2011


b0lt posted:

How about this current 5 year old bug where LLVM emits a technically invalid memcpy?

LLVM dev posted:

We're allowed to generate "illegal" calls to memcpy because LLVM is generating platform-specific assembly, not C code.

Oh, that makes it okay then! :suicide:

Kazinsal
Dec 13, 2011


Magic Linux and POSIX poo poo is the reason we can't have nice things? Why, I never

Kazinsal
Dec 13, 2011


Munkeymon posted:

He found *squints* about 5k people switching to Matlab from islands of relative sanity Python and R? I question his results.

31.5k people switching from R to C.

I'm really curious now.

Kazinsal
Dec 13, 2011


iospace posted:

C is the best :colbert:

NO I DO NOT HAVE STOCKHOLM SYNDROME THANKS FOR ASKING

Same. I will move to Rust or Go or whatever the latest fad in systems programming languages is when someone writes one that I can actually do low-level systems programming with. Maybe.

CPColin posted:

Thankfully, being C, it's still an array of bytes!

yesssssssssss

Kazinsal
Dec 13, 2011



Nope. :stonkhat:

Adbot
ADBOT LOVES YOU

Kazinsal
Dec 13, 2011


Volguus posted:

If you dont have the UUID type in the database, how else are you gonna store it? 2 64 bit ints? nah....

Time for a REALLYBIGINT type.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply