Войдите или зарегистрируйтесь
Вы сможете писать комментарии и посты, ставить лайки и другое
Поиск
Тёмная тема

Посты с тегом: programming languages

AI news has completely taken over tech news

Honestly, I'm getting bored of reading tech news lately. It feels like every single headline these days is AI this, AI that. And that's it. Nothing else seems to exist anymore. As if the entire tech industry has been reduced to neural networks.

What do tech publications even write about now? "ChatGPT solved some math problem!" "Anthropic's agent swarm hacked something!" And a hundred variations of the same story.

Where's the actual tech news? You know, the stuff we used to read back in the good old days? Golang 1.27 added generic methods, for example. And apparently nobody gives a shit anymore. A lot of Go developers have wanted this for ages. Generics were introduced in Go 1.18, but they didn't work with methods and now they do. That's a pretty damn cool change! Did you see it covered by tech news sites and bloggers anywhere near as much as the latest AI hype? Of course not.

Or take the webfrontend world. TypeScript 7 has been rewritten in Go, which is a huge deal. It makes TS-JS compilation significantly faster, and that's something that actually affects millions of developers. But somehow that cool story gets buried under yet another article about some NVIDIA chip nobody asked for or another pointless ChatGPT model update.

I miss when tech news was actually about technology, not just whatever AI company did something vaguely interesting this week.
+2
7

Misleading naming in JavaScript: atob() and btoa()

JavaScript has two globally available metods for working with Base64: atob() and btoa(). Their names clearly look like they were borrowed from older languages. In C, for instance, the standard library includes functions like atoi and atof:

#include <stdlib.h>

char str[] = "123";
int num = atoi(str); // 123

atoi means ASCII to integer, and atof means ASCII to float (though in reality it returns a double).

So what do you think the atob function does in JavaScript? ASCII to Base64? In other words, converting a regular string into a Base64 string? Nope! It does the exact opposite: it converts a Base64 string into a "regular" string. And btoa, in turn, converts a regular string into Base64!

console.log(btoa('Famabara')); // 'RmFtYWJhcmE='
console.log(atob('RmFtYWJhcmE')); // 'Famabara'

Who thought it was a good idea to swap the names like that? Love JS.
+2
42
1