[-] dohpaz42@lemmy.world 6 points 1 day ago

Damnit I was going to post the same thing lol.

[-] dohpaz42@lemmy.world 5 points 1 day ago

Ignoring the fact that a lot of languages, and database systems, do not support generics (but do already support null), you’ve just introduced a more complex type of null value; you’re simply slapping some lipstick on it. 😊

[-] dohpaz42@lemmy.world 9 points 1 day ago

Hey, for what it’s worth (which is up to you to decide), I enjoy your being here. I get that you’re beyond frustrated about your personal life stuff. From what little I do know, it sounds horrible. So no shade there at all. It’s tough.

But, despite that, you come here and have helped build communities where people can go and let off steam and forget their personal shit for a few moments, and for some of us, that’s tremendous. You could shrug it off; you’ve not met these people in real life. I don’t know, maybe you have. But to some of us, it’s a little something we can look forward to because it helps us cope when we have little else. So thank you for that.

Anyway, carry on and fuck the haters. You can’t please everyone.

[-] dohpaz42@lemmy.world 25 points 1 day ago

My god that was painful to watch. Skip ahead to the last minute of the video, unless you like being tortured with over the top “Hello, fellow kids” corporate BS.

[-] dohpaz42@lemmy.world 3 points 1 day ago

I’m probably going to get a lot of hate for this, and I do recognize there have been problems with it all over the place (my code too), but I like null. I don’t like how it fucks everything up. But from a data standpoint, how else are you going to treat uninitialized data, or data with no value? Some people might initialize an empty string, but to me that’s a valid value in some cases. Same for using -1 or zero for numbers. There are cases where those values are valid. It’s like using 1 for true, and zero for false.

Whomever came up with the null coalescing operator (??) and optional chaining (?->) are making strides with handling null more elegantly.

I’m more curious why JavaScript has both null and undefined, and of course NaN. Now THAT is fucked up. Make it make sense.

[-] dohpaz42@lemmy.world 7 points 1 day ago

You obviously don’t suffer from a sensitive circadian rhythm. To that I’d say, lucky you. But there are plenty of people who do suffer. And by the time they finally get used to the time change, it’s time to change again. It’s vicious and disruptive; to more than just scheduling. It has a direct (negative) impact on physical and mental health.

[-] dohpaz42@lemmy.world 2 points 1 day ago

Is this something that is going to be publicly available? If so, post a link when you have it.

[-] dohpaz42@lemmy.world 15 points 1 day ago

Useful in fighting as it helps protect the lower jaw and teeth?

But then again, it could simply be a trait we have developed over the millennia, and there is no deeper meaning to it.

[-] dohpaz42@lemmy.world 9 points 1 day ago* (last edited 1 day ago)

As in a signal of how manly a man truly is, comparative to still being a boy.

Edit: also, hair is counter productive in a fight, because it gives your opponent something to grab a hold of and use against you.

[-] dohpaz42@lemmy.world 23 points 1 day ago

Personally, I’ve always hated this notion of a nuclear family, and that there is some standard that people must go by, lest you be weird or lesser of a person. The more that times goes on, and the economy is the way it is, the more I feel justified in my thinking.

I lived with my folks into my late 20s. I only moved out because I went on a date with a girl, and never left. She never said anything, so I kept going back to her place. It just sort of happened. If I hadn’t met her, I don’t know when I’d have moved out of my parent’s house.

If your mother is okay with it, why the hell not? She probably enjoys the company. I currently live alone, except the weeks I have my kids, and while I do enjoy time to myself, I look forward to having my boys around. I’ve told my sons that no matter how old they are, or what happens in their life, they will always have a home with me. My youngest (9) states he is never moving out, and he’s not one to joke about that. 😅

I say, if it works for you and your family, do it. There is absolutely nothing wrong with that, and fuck off to anybody who says otherwise.

[-] dohpaz42@lemmy.world 6 points 1 day ago

I can certainly relate. I do not have the traditional sense of what is beauty and what is not. I tend to also gravitate toward more natural beauty; i.e., little-to-no make-up, natural breast (even if they are small), normal fitting clothing, those damn filters on photos.

Not only is it a double standard (how would society look upon men who stuffed their pants), it doesn’t help with my inability to easily distinguish who you are out of a crowd of other people.

[-] dohpaz42@lemmy.world 76 points 1 day ago

To be fair, as a real-life comparison, I wouldn’t be able to recognize most celebrities because they look so wildly different out of make-up. I suspect I have partial face blindness.

0

So I've got the following code, which seems to work, and I'm wondering if there is a better, cleaner way to approach adding/editing elements in an array.

var category: Category
var idx: Int = -1

switch mode {
case .add:
    category = Category()
case .edit(let _category):
    category = _category
    idx = categoryViewModel.categories.firstIndex(of: _category) ?? idx
}

category.name = categoryName
category.icon = "category-\(categoryIdx)"
category.color = colors[colorIdx]

switch mode {
case .add:
    categoryViewModel.categories.append(category)
case .edit:
    categoryViewModel.categories[idx] = category
}

I understand I'm not checking idx to make sure it's not -1. I'm not concerned about that part right now. It's the overall approach I'm looking for thoughts on.

Thanks!

1

MainActor is a new attribute introduced in Swift 5.5 as a global actor providing an executor which performs its tasks on the main thread. When building apps, it’s essential to perform UI updating tasks on the main thread, which can sometimes be challenging when using several background threads. Using the @MainActor attribute will help ensure your UI is always updated on the main thread.

view more: ‹ prev next ›

dohpaz42

joined 1 year ago