[-] PhilipTheBucket@piefed.social 1 points 37 minutes ago

Dude you were the one that asked the fucking question lol

[-] PhilipTheBucket@piefed.social 1 points 1 hour ago

You define it in exactly the same way you just did. Completely fine, you have to do it for lots of things. It's nice that Python can do that too.

Now, I'll grab a random snippet of code from some random file from my source dir:

        existing_bookmarks = db.session.execute(
            text('SELECT post_reply_id FROM "post_reply_bookmark" WHERE user_id = :user_id'),
            {"user_id": user_id}).scalars()
        reply = PostReply.query.filter(PostReply.id.in_(existing_bookmarks), PostReply.deleted == False).first()
        if reply:
            data = {"comment_id": reply.id, "save": True}
            with pytest.raises(Exception) as ex:
                put_reply_save(auth, data)
            assert str(ex.value) == 'This comment has already been bookmarked.'

You can see some classes in use, which again is fine. But you also see inline instantiation of some reply JSON, a database returning a list of post_reply_id values without needing a special interface definition for returning multiple values, lots and lots of cognitive and computational load per line of code that's being saved because the language features are saving people the heavy lifting of depending on user-defined classes for everything. It means you don't have as many adventures through the code where you're trying to modify a user-defined interface class, you don't need as much strong typing, that kind of thing.

I would bet heavily that a lot of the things that are happening in that short little space of code, would need specific classes to get them done if the same project were getting implemented in some C++-derived language. Maybe not, I just grabbed a random segment of code instead of trying especially hard to find my perfect example to prove my point.

It is fine, there are significant weaknesses to Python too, I'm not trying to say "yay python it's better for everything," anything like that. I'm just saying that if you don't get familiar with at least some language that does things more that way, and instead get solely accustomed to just user-defined classes or templates for every information exchange or functional definition, then you'll be missing out on a good paradigm for thinking about programming. That's all.

[-] PhilipTheBucket@piefed.social 1 points 1 hour ago

Complex data structures are not "more of a C++ type of program structure".

Oh, they are not at all. Equating complex data structures with user-defined data structures (in the form of classes and fields and whatnot), and using the latter as the primary method of storing and working with data (so that you're constantly having to bring into your mental scope a bunch of different classes and how they need to interact), is 100% a C++ type of program structure. It's pretty unusual in my experience in Python. Or, I mean, it's perfectly common, but it's not primary in the same universal way that it is in C++ and derivatives. It gets to exist as its own useful thing without being the only way. That's what I am trying to say.

[-] PhilipTheBucket@piefed.social 4 points 1 hour ago

Oops

I fixed it now.

[-] PhilipTheBucket@piefed.social 32 points 3 hours ago* (last edited 1 hour ago)

it's actually better for stallions to carry a bit more weight

It is clear that this horse knows what he's doing. Just give him oats and lady horses and let him run around and do his thing. Humans are fuckin' weird.

Edit: I'm not up on my horse lingo

[-] PhilipTheBucket@piefed.social 0 points 4 hours ago

IDK, I just have never really had this become a serious issue for me. I get what you mean, some actions are a little bit of a pain in the neck because people are often sloppy about typing, but literally the only time I can remember it being an issue at all has been when numpy is involved and so I have to figure out if something is a native Python thing or a numpy-fied custom structure.

I mean there's just not that many types. Generally something is a list, a number, a map, or a string, and it's pretty obvious which. Maybe there are OOP domain things where a lot of variables are objects of some kind of class (sort of more of a C++ type of program structure), and so it starts to become really critical to have strong type tools, I'm just saying I haven't really encountered too much trouble with it. I'm not saying it's imaginary, you may be right in your experience, I'm just saying I've worked on projects way bigger than a few hundred lines and never really had too much of an issue with it in practice in my experience.

3

NBC News, citing a White House official familiar with the matter, has reported that advisers will also be present at the meeting between US President Donald Trump and Russian leader Vladimir Putin.

Source: NBC News, as reported by European Pravda

Details: A White House representative told NBC News that at today’s meeting with Putin and his advisers, Trump will be accompanied by Secretary of State Marco Rubio and special envoy Steve Witkoff.

The official stated that this will replace what was initially described as a bilateral meeting between Trump and Putin. Translators are also expected to attend.

The bilateral working lunch will be attended by Rubio, Defence Secretary Pete Hegseth, Treasury Secretary Scott Bessent, Commerce Secretary Howard Lutnick, Chief of Staff Susie Wiles, and Witkoff.

Trump’s special envoy for Ukraine, Keith Kellogg, is not part of the delegation.

Background:

Putin’s plane has landed at a military base in Anchorage, Alaska. US media report that Trump has also already arrived at the meeting venue.On board the presidential aircraft, he spoke to the media and said in particular that he would not discuss territorial issues "on behalf of Ukraine" and that he allows for the possibility of offering certain guarantees to Ukraine together with Europe, but not within NATO.During the flight, Trump also held his first conversation with self-proclaimed Belarusian president Alexander Lukashenko.

Support Ukrainska Pravda on Patreon!

[-] PhilipTheBucket@piefed.social 2 points 4 hours ago

Hm... yeah, maybe so. They linked to taz, they quoted a random member of Masch, and they cited some other cases, but yeah maybe it would have been good to have an actual legal expert weighing in on how realistic it is that this will mean anything significant.

21
[-] PhilipTheBucket@piefed.social 1 points 5 hours ago

That's not really clear in actuality. Different people have different opinions on what might be the results, and a few of them are quoted in the article stating their takes on it. The fact that the reality isn't clear yet isn't exactly the article's fault.

[-] PhilipTheBucket@piefed.social 2 points 5 hours ago

The headline isn't clear. The article goes into quite a lot of detail (the situation is much more complex, and the headline is probably a pretty misleading summary) and is perfectly clear.

[-] PhilipTheBucket@piefed.social 3 points 5 hours ago

Plus I felt python was too new and would skip a lot of core programming skills id just like to know. Im not super interested in doing it the new way with all the helpers, or I wont feel like I learned anything.

Okay, you definitely want to learn C then. C# and C++ both add a ton of helpers. C# has a massive runtime environment that's opaque and a little bit weird, and C++ has a massive compile-time environment that's opaque and very weird. It's sort of pick your poison. If you learn C and get skilled with it, you'll be well set up for understanding what is actually going on and having strong fundamentals that will set you up well for whatever higher-level language you want to learn in the future.

Put another way: C# will hide just as many of the fundamentals and hardcore details from you as python will, it'll just do it in a weird and counterintuitive fashion that will make it more confusing and with more weird C#-specific details.

I'd eventually like to learn unity as well so i decided on c#

I would actually just cut out the middleman and start with the Unity editor then. It actually might be a really good introduction to the nature of programming in general without throwing a bunch of extra nonsense at you, and in a really motivating format.

I do have the .net sdk and it seems to try to compile a simple program, it just throws errors even on an example program that shouldn't have any. Im sure its something dumb.

What's the program and what's the error? I'm happy to help if something jumps out at me. I'm voicing my opinion otherwise on what might be better ways to attack this all in general, but I'm sure me or people here can help sort out the issues if you really want to take this approach and you're just getting stuck on something simple.

[-] PhilipTheBucket@piefed.social 1 points 5 hours ago

You can do strict typing in python if you want it, it's very highly recommended if you're doing a big project.

13
[-] PhilipTheBucket@piefed.social 5 points 7 hours ago

Yeah. I am hopeful that he'll run into resistance from the rank and file he is trying to depend on to get this stuff done. The California National Guard is already pissed about LA, and now he's asking for support and cooperation from the same force that watched his supporters beat the fuck out of the Capitol Police like a medieval siege not that long ago and then him give them hearty congratulations for it.

I'm not saying it won't work as he keeps trying (and as ICE gets staffed up and better funded), but I'm glad he's a moron, that's all I'm saying.

10
11
1
80

Active police and government email accounts are being sold on the dark web for as little as $40, giving cybercriminals a direct line into systems and services that rely on institutional trust. According to new research from Abnormal AI, the accounts come from agencies in the United States, United Kingdom, Germany, India, and Brazil, and are being traded on underground forums. Source: Abnormal AI Unlike spoofed or dormant addresses, these accounts are functional and still...

10
17

Amid escalating anti-immigrant rhetoric and legislative crackdowns at the state and federal levels, private prison corporations are once again expanding their grip on U.S. detention policy. In fact, today roughly 90 percent of detained immigrants are held in privately operated facilities, the highest share in history. This industry exists despite years of promises to phase out for-profit…

22
22
12
view more: next ›

PhilipTheBucket

joined 5 days ago