snaggen

joined 1 year ago
[–] snaggen@programming.dev 1 points 1 month ago (1 children)

Are you saying that it is common that people use utf8 characters that you cannot easily type on a standard keyboard? I'm very skeptical of this claim.

[–] snaggen@programming.dev 2 points 1 month ago (3 children)

Good to know that every time I feel the need to use ALGOL 68, I must remember to disable ligatures. Still not sure this is going to be a huge problem 😂

[–] snaggen@programming.dev 2 points 1 month ago (5 children)

Well, that was something.... I have used ligatures in my code editor for quite a few years now, and I have NEVER been confused about the ambiguity this person is so upset about. Why? I have never ever seen the Unicode character for not equals in a code block, simply since it is not a valid character in any known language. In fact, I have never even seen it in a String where it actually would be legal, probably since nobody knows how to type that using a standard keyboard. This whole article felt like someone with a severe diagnose have locked in on some hypothetical correctness issue, that simply isn't a problem in the real world.

But, if you for some reason find ligatures confusing, then you shouldn't use them. But, just to be clear, there is not a right of wrong like this blog post tries to argue, it is a matter of personal taste.

[–] snaggen@programming.dev 1 points 1 month ago (7 children)

Splits, ligatures tabs and more

[–] snaggen@programming.dev 3 points 1 month ago (9 children)

Cosmic term is nice. Still just alpha, so there are rough edges though.

[–] snaggen@programming.dev 8 points 1 month ago* (last edited 1 month ago) (3 children)

For Boomers, cars was the latest tech that everyone was fiddling with. This caused even the boomer that wasn't very interested , to know quite a lot. For later generations, car became more of a means of transportation, and the knowledge of cars was only for specialists. For gen X, computers were the high tech thing, everyone was fiddling with. Most gen x can setup a printer if they have to. For later generations, computers are just tools, and the knowledge is only for specialists.

[–] snaggen@programming.dev 18 points 2 months ago (1 children)

Producing products that the users wants, and that solves tje users real problems. And not trying to make products as addictive as possible, to harvest as much user data as possible to sell.

[–] snaggen@programming.dev 16 points 2 months ago* (last edited 2 months ago)

The problem is that C is a prehistoric language and don't have any of the complex types for example. So, in a modern language you create a String. That string will have a length, and some well defined properties (like encoding and such). With C you have a char * , which is just a pointer to the memory that contains bytes, and hopefully is null terminated. The null termination is defined, but not enforced. Any encoding is whatever the developer had in mind. So the compiler just don't have the information to make any decisions. In rust you know exactly how long something lives, if something try to use it after that, the compiler can tell you. With C, all lifetimes lives in the developers head, and the compiler have no way of knowing. So, all these typing and properties of modern languages, are basically the implementation of your suggestion.

[–] snaggen@programming.dev 3 points 2 months ago

It is making the tracking protection part of containers obsolete, this is basically that functionality but built in and default. The containers still let you have multiple cookie jars for the same site, so they are still useful if you have multiple accounts on a site.

[–] snaggen@programming.dev 7 points 2 months ago

Container tabs are still useful, as they let you use multiple Cookie jars for the same site. So, it is very easy to have multiple accounts on s site.

[–] snaggen@programming.dev 23 points 2 months ago

https://doc.rust-lang.org/book/ this is a great starting point. Then when you got the basics, and fiddled around a bit, then you can start looking for more specialized books (like Rust Atomics and Locks https://marabos.nl/atomics/ )

[–] snaggen@programming.dev 5 points 3 months ago (2 children)

Have he said something even close to the stupidity of Trump? Like suggesting bleach against Covid? Why should all Trump opponents be measured with a different scale then Trump. Could you imagine the number of headlines required if Trump would get a headline every time he does anything on this scale?

 

Found this on Mastodon https://fosstodon.org/@dpom/112681955888465502 , and it is a very nice overview of the containers and their layout.

249
submitted 8 months ago* (last edited 8 months ago) by snaggen@programming.dev to c/programmer_humor@programming.dev
 

fjärrinlägg från: https://programming.dev/post/10803496

TIL: Sweden had February 30 in 1712 https://en.wikipedia.org/wiki/1712_in_Sweden , so I decided to see how chrono handled that.

use chrono::TimeZone;
use chrono_tz::Europe::Stockholm;

fn main() {
    let feb30 =  Stockholm.ymd(1712,2,30);
    println!("Date: {:?}", feb30);
}
 target/debug/feb30
thread 'main' panicked at /home/snaggen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.34/src/offset/mod.rs:252:40:
No such local time
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Result (as expected): Not well! 😄

I also tested Java with

ZonedDateTime feb30 = ZonedDateTime.of(1712,2,30, 0,0,0,0, ZoneId.of("Europe/Stockholm"));

with simmilar result

java.time.DateTimeException: Invalid date 'FEBRUARY 30'

So, lets take a minute of silence for all the programmers of history related software, may the spagetti monster have mercy on their souls.

view more: next ›