thebestaquaman

joined 1 year ago
[–] thebestaquaman@lemmy.world 3 points 1 week ago

Watch me: My void* doesn't give a shit about your const!

[–] thebestaquaman@lemmy.world 4 points 1 week ago (1 children)

I have to be honest in that, while I think duck typing should be embraced, I have a hard time seeing how people are actually able to deal with large-scale pure Python projects, just because of the dynamic typing. To me, it makes reading code so much more difficult when I can't just look at a function and immediately see the types involved.

Because of this, I also have a small hangup with examples in some C++ libraries that use auto. Like sure, I'm happy to use auto when writing code, but when reading an example I would very much like to immediately be able to know what the return type of a function is. In general, I think the use of auto should be restricted to cases where it increases readability, and not used as a lazy way out of writing out the types, which I think is one of the benefits of C++ vs. Python in large projects.

[–] thebestaquaman@lemmy.world 4 points 1 week ago

The amount of people I've been helping out that have copied some code from somewhere and say "it doesn't work", and who are dumbfounded when I ask them to read the surrounding text aloud for me...

Along the same line: When something crashes, and all I have to do is tell people to read the error message aloud, and ask them what that means. It's like so many people expect to be spoon-fed solutions, to the point where they don't even stop to think about the problem if something doesn't immediately work.

[–] thebestaquaman@lemmy.world 17 points 1 week ago (6 children)

While I do agree with most of what is said here, I have a hangup on one of the points: Thinking that "docstrings and variable names" are a trustworthy way to indicate types. Python is not a statically typed language - never will be. You can have as much type hinting as you want, but you will never have a guarantee that some variable holds the type you think it does, short of checking the type at runtime. Also, code logic can change over time, and there is no guarantee that comments, docstrings and variable names will always be up to date.

By all means, having good docstrings, variable names, and type hinting is important, but none of them should be treated as some kind of silver bullet that gets you around the fact that I can access __globals__ at any time and change any variable to whatever I want if I'm so inclined.

This doesn't have to be a bad thing though. I use both Python and C++ daily, and think that the proper way to use Python is to fully embrace duck typing. However that also means my code should be written in such a way that it will work as long as whatever input to it conforms loosely to whatever type I'm expecting to receive.

[–] thebestaquaman@lemmy.world 11 points 1 month ago (1 children)

What you're thinking about is the relation between energy, temperature, and heat capacity. When you add energy to a system (e.g. heat) the amount of energy you need to heat it up a certain amount is described by its heat capacity. If your molecules can "wiggle" (i.e. they're multi-atomic) a portion of the energy you're adding will go to increasing the "wiggling" rather than the mean speed of the molecules.

What we perceive as temperature is related to the mean speed of the molecules, so because molecules that can "wiggle" more will require more heat to see the same increase in mean speed as non-wiggling molecules (because some of the heat is going to increasing the wiggling) they have higher heat capacity.

It should also be mentioned that even the concept of temperature is really a statistical concept, so it doesn't really make much sense to talk about the temperature of a single isolated molecule, or even a pair of them. Temperature as a concept starts to be fruitful to talk about in the thermodynamic limit which classically means "a whole shitload of molecules", but (relatively) recent research suggests "a whole shitload" can be as little as 10-30 molecules. Once you go below the thermodynamic limit, we're not really talking about the temperature of a system, but it's energy, which is still well defined (although definitions may vary depending on context). Depending on who you ask, it can make sense to define a temperature also for single-particle systems, but at that point we're talking about applying thermodynamic definitions that work (and are correct in the macroscopic limit) and no longer about what we classically perceive as temperature.

 

I have a friend thats setting up linux (ubuntu) on his machine. He has a windows installation. I personally use mac as my primary OS, but I've had a linux partition on my machine as well, and I'm having a slightly hard time giving him good advice as to what solution he should choose when setting up linux (I don't even know how I would partition a disk on a windows machine to prep it for dual booting).

My question is quite simple: What are the pros/cons of WSL vs. Dual Booting vs. Virtualbox, both with regards to setup and with regards to usage?

[–] thebestaquaman@lemmy.world 10 points 2 months ago (3 children)

I never understood that. Apparently they use it as a primary way of messaging each other? At least that's what younger relatives have told me. I've tried to have them explain what makes the app designed to hide/delete stuff after it's been read better for communication, but so far haven't gotten an explanation I could make any sense of.

[–] thebestaquaman@lemmy.world 83 points 2 months ago (2 children)

"Enshittification will continue until revenue improves"

[–] thebestaquaman@lemmy.world 1 points 2 months ago

I've found that regex is maybe the programming-related thing GPT is best at, which makes sense given that it's a language model, and regex is just a compact language with weird syntax for describing patterns. Translating between a description of a pattern in English and Regex shouldn't be harder for that kind of model than any other translation so to speak.

[–] thebestaquaman@lemmy.world 2 points 2 months ago (2 children)

In general I agree: ChatGPT sucks at writing code. However, when I want to throw together some simple stuff in a language I rarely write, I find it can save me quite some time. Typical examples would be something like

"Write a bash script to rename all the files in the current directory according to ", "Give me a regex pattern for <...>", or "write a JavaScript function to do <stupid simple thing, but I never bothered to learn JS>"

Especially using it as a regex pattern generator is nice. It can also be nice when learning a new language and you just need to check the syntax for something- often quicker than swimming though some Geeks4Geeks blog about why you should know how to do what you're trying to do.

[–] thebestaquaman@lemmy.world 2 points 2 months ago

Ngl you had me until the 1772 bit

[–] thebestaquaman@lemmy.world 5 points 2 months ago

Of course, Li-ion batteries will never cover large-scale power demand. Not primarily because of lack of lithium, but because it's a technology that scales far too poorly into the MWh/TWh scale, and has a far too short lifetime.

The battery tech we need for truly large scale storage is different from what we need for small, portable storage. Stuff like redox-flow batteries are looking promising.

There's also hydrogen, with different storage methods being actively researched- from direct storage to using ammonia as a carrier.

The issue with using mechanical storage (like pumped hydropower) is threefold (off the top of my head):

  1. It has ridiculously low energy density
  2. Even after > 100 years of pumps and turbines, the power loss in a pump/release cycle is very high.
  3. It's heavily limited by geography

I'm not saying pumped hydropower isn't part of the solution: I believe the solution is that we need many solutions. I just think it's important to point out that battery tech isn't some monolithic thing, and that there are issues with pumped hydropower (and mechanical storage in general).

[–] thebestaquaman@lemmy.world 1 points 3 months ago

have you tried consent-o-matic? Admittedly, it didn't work on that site, but it works like a charm on > 90 % of sites I visit.

view more: next ›