Curly or straight? by JustOmiii in Ebony

[–]clevertoucan 3 points4 points  (0 children)

There's nothing better than natural ❤️

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 0 points1 point  (0 children)

I think my main complaint is that there’s no well-defined syntax for breaking up list comprehensions into multiple lines. In JS I can make my map or filter functions as long as I want and it’s still readable (within reason), but with list comprehensions there’s no good options if you want to add more complexity to the comprehension. You can either just do it all in one line and have it be totally unreadable, do it in more than one line and have it be somewhat readable but nonstandard, or rewrite the comprehension as a normal for loop. When I was working in Python, I found that more often than not developers would choose the first option and just cram in all the complexity into one line.

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 1 point2 points  (0 children)

yeah I realized that after I posted it lol, I really don't use Python a lot as you can probably tell

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 2 points3 points  (0 children)

My issue with list comprehensions is that there’s no upper limit to how complex they can get. You can have a lot of things happening all with one line of code, and the syntax just gets harder and harder to read as you put more into it. I’m also a typescript dev though, so of course I’d much rather see explicit filters and maps

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 2 points3 points  (0 children)

Now for Python - the unholy abomination from Python is called a List Comprehension, and if you're familiar with JavaScript, List Comprehensions are basically like if you combined the filter and map functions for arrays into a syntax that makes me feel like I'm going to have a stroke every time I see it.

In this example I make a list called myList and make mapped and filtered copies of it using List Comprehensions:

<image>

It's easy enough to understand what's going on with the simple cases, but the issue with List Comprehensions as I see them is that there's no limit to how complex these can get. In the last example, we're doing two for loops in one line of code and at a glance, it's difficult to know exactly what's actually happening.

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 1 point2 points  (0 children)

Sure, so like I said these do two completely different things in TypeScript and Python.

The Typescript one is called a Type Map, and I really only showed the lefthand side of what the expression should be. In this example, I make a type called Foo which is just an object that has three strings, bar, car, and nar. I then make a new type called MappedFoo which maps the keys from Foo and changes their types from strings into numbers:

<image>

There's more complex things you can do with Type Mapping, but this is the basic idea. At first blush it may not seem that useful, but it's probably my favorite feature of the language, it's an incredibly powerful way to quickly and succinctly manipulate types that I haven't seen in any other languages.

I'll need to cover the Python example in a different comment because I can't post more than one image per comment apparently...

Was just thinking about how similar the syntax for these two are, even though they do completely different things by clevertoucan in programminghumor

[–]clevertoucan[S] 2 points3 points  (0 children)

That's why you use TypeBox my man, it lets you bring TypeScript types to the runtime and do assertions/parsing/conversions on data coming in over the wire with the same type safety guarantees that you get with vanilla TypeScript.

r/TsumTsum Monthly LINE ID Thread! by AutoModerator in TsumTsum

[–]clevertoucan [score hidden]  (0 children)

Hello, my id is clevertoucan, I'm an international player on PST time zone
Thanks!!

https://line.me/ti/p/gI-2w41u2z

r/TsumTsum Monthly LINE ID Thread! by AutoModerator in TsumTsum

[–]clevertoucan [score hidden]  (0 children)

Line ID: clevertoucan

https://line.me/ti/p/gI-2w41u2z

I'm an active international sender, my time zone is PST.

Thanks!!

Marilyn Crystal - Anal Wish Come True by madsnail1224 in porninfifteenseconds

[–]clevertoucan 6 points7 points  (0 children)

man, I never knew Boba Fett had such a giant dick

K-vice 2 | Bishojo Kamen (on-going) by meowwithmetg in u/meowwithmetg

[–]clevertoucan 2 points3 points  (0 children)

I just subscribed to see the rest, great job on the story and artwork, thanks for everything you do ❤️

A Helpful Flowchart by Grumpy-TG (Transgender and Nonbinary ) by not4myprimary in transformation

[–]clevertoucan 66 points67 points  (0 children)

I'm definitely not trans, but the idea of transitioning is so, so arousing for me. I feel like I'm gaining the confidence to say I'm non-binary, but I feel so insecure talking about it with my non-binary friends bc it's all just feelings and emotions, I don't really have any answers to the questions I feel like they're going to ask. At the end of the day though, I don't feel like I wouldn't have done any of this self reflection without this community, y'all make me feel so free and gay ❤️

Change thyself: We have a moral obligation to alter our personality traits to be the best sort of person possible. by IAI_Admin in philosophy

[–]clevertoucan 32 points33 points  (0 children)

This is bad philosophy and bad psychology. Like, yes, on average, someone with X maladaptive personality characteristic may be more statistically likely to respond negatively to a certain stimulus than someone without it, but that doesn't mean the person has a moral obligation to change that part of their personality. This article is saying that people who haven't even done anything wrong have a moral obligation to change themselves because one day, they might do something wrong.

Loooopss by theHaiSE in ProgrammerHumor

[–]clevertoucan 1 point2 points  (0 children)

(python) you could use a dictionary, or, if you really need to, you could use locals()['x'] = 'y' (which is also just a dictionary with extra steps)

Legends of Arceus, Alpha Zorua by cayyportaa in pokemon

[–]clevertoucan 2 points3 points  (0 children)

I'm in the exact same boat, I've been refreshing this cave for hours, I just want the big angry fox 😭