Dude you were the one that asked the fucking question lol
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.
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.
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.
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.
C# represents about 12% of the jobs out there.
https://www.devjobsscanner.com/blog/top-8-most-demanded-programming-languages/
It’s not unpopular, but it’s definitely not “massively” popular anymore. Different languages have different strengths and weaknesses, but C# has a few more weaknesses than most. In my opinion. Yes, there’s nothing wrong with learning any particular language you want to learn (and I’m a little surprised to see C++ has fallen significantly lower than C#, sure, fair enough). I’m just struggling to see an upside for learning it in the modern day (and now knowing more about what this person’s goal is I feel even more strongly that C# is the wrong answer for them. In my opinion.)
You can do strict typing in python if you want it, it’s very highly recommended if you’re doing a big project.
I really would not recommend specializing in C# at this point in computing history. You can do what you want obviously, but Python is much more likely to be what you want. C++ or Java might be okay if you want a job and are okay with a little bit dated / not ideal languages, or you could learn one of the proliferation of niche backend Linuxy languages, but C# has most of the drawbacks of C++ and Java without having even their relative level of popularity.
IDK what issue you’re having with VSCode, but I think installing the .NET SDK and then using dotnet
by hand from the command line, to test the install, might be a good precursor to getting it working in VSCode. But IDK why you would endeavor to do this in the first place.
Here’s the pinout for the webcam component: https://github.com/FrameworkComputer/Framework-Laptop-13/tree/main/Webcam
Unfortunately it isn’t really clear whether the switch positions are in the pinout because it’s the mainboard’s job to implement shutting off the camera when it’s off, or just as information with the webcam module responsible for shutting it off in hardware. I have no idea which it is, but it wouldn’t be super-hard for someone capable with EE to take off the bezel and fool around with it and see which it is (or just pay $19 for the magic of buying two of them, if you didn’t want to take apart your own laptop for it.)
They say they provide full schematics on demand to repair shops (https://knowledgebase.frame.work/availability-of-schematics-and-boardviews-BJMZ6EAu). I’m not sure why they don’t want to just post them publicly, so in that sense you might be right, but they also don’t seem like they are trying to keep them or the interface details of the webcam module fully top secret either.
They do seem like they publish enough information that someone could figure out the answer if they wanted to. (People in the forums have fooled around with them and seem to be convinced that they are actually hardware switches: https://community.frame.work/t/how-do-the-camera-and-microphone-switches-work/4271 IDK whether that’s accurate, but that’s what the forum people think.)
No idea why you’re trying to lecture me from this position of authority about taking apart PCBs and whatnot. Anyway, that’s how it works, hope this is helpful for you.
I sort of suspect that the wiring is in a diagram somewhere. I could be wrong, but that would be my guess. It’s not in a PCB, that’s up in the bezel where it’s just wires and stuff.
Also! Inflation and whether or not it was the president’s fault, and all the Palestine protests and how Democrats (only Democrats) were facing a lot of heat for their support of Israel. Almost as if our media is corrupted by partisan influences that are trying to mislead and influence people, and it works shockingly well.
Yeah. It’s a fucking disgrace.
Read “Sky Over Kharkiv” for some generally excellent picture of the war from the Ukraine perspective, with some occasional bitterness about the cowardice and apathy of all the Western allies about helping Ukraine to any pivotal extent.
Dan Ellsberg also had some great writing about how this all functions from the POV inside the Western military machine. He called it “the stalemate machine”: We’re motivated enough to help you not lose, but not motivated enough to let you win. And so, you just keep dying, month after month and year after year.
Framework laptops have a little physical switch to turn off the camera / mic when you don’t want them.
The original SGI webcams, some of the first that ever existed, actually had a physical plastic cover that you could slide over them when you didn’t want the camera on. “No, I don’t trust your hardware any more than your software. I shouldn’t need to. Stop looking at me when I don’t want you to, and prove to me that you are not, or else I will be suspicious.” Back in those days that was sort of a universal point of view among internet people, I think…
Yeah, I’m just coming in this thread and saying totally weird counterfactual nonsense, just kind of anything that serves the narrative I am trying to portray. It doesn’t even have to make sense.
Ukrainians are mostly killing foreign mercenaries, prison conscripts, and the elderly surplus population?
Yeah! That’s in “The Art of War,” right? You’re supposed to send your “elderly” and other random dregs you can dig up first to fight a critical war. And then, once you’ve depended on all those “surplus” people for several years, you move on to your trained troops, the actual military. Obviously. It’s just part of the Russian mastery of military strategy that meant they took over the country in three days slowly pushed forward and got the mission accomplished and went home in a few months fought a Pyrrhic victory over the space of a year and a half and then negotiated a partition and then started rebuilding and preparing for next random invasion of some neighbor country got stuck at the border for years, ruined their economy and any respect their military or kit might have had on the world stage, and are now scrounging around for any possible military-age males they can lay hands on to keep feeding into the grinder, hoping that if they keep it up long enough, it’ll work.
I have more to say about the rest of your ridiculous message, but I don’t think it’s really necessary.
Unfortunately, they’re outnumbered by more than an order of magnitude. They’re getting ground down as time goes on, and for all its stupidity the Russian military is not small or fragile. Basically, the Russians only have to win once to win, Ukraine has to survive every month that goes by, time after time.
The good guys don’t always win. Just ask the Palestinians.
Unlike in Vietnam, I’d say “they’re trying to kill us all and take our home, but we’re killing them instead” is a pretty good model of success for the Ukrainians.
It would be great if they had other options. Hanging Putin and demobilizing everyone, and rebuilding both countries, would be a great start.
Yeah, Reddit is super weird. There are a bunch of rabidly pro-Israel people who have infiltrated its world news communities in exactly the way that some Lemmy people love to imagine that they have done on Lemmy.
They’ve killed about a million Russians so far, and held the invasion a few hundred km from their border. I’d call that something they can do about it.
They have the luck (“luck”) of the entire first world funding them to defend against Russia, instead of Gaza where it’s 100% the opposite, so they’re not in the horrifying situation the Palestinians are in. Which I’m sure frustrates Russia to no end.
It is excellent. It is brilliant. Everyone’s different, surely there are people who won’t like it, but for me it was top notch.