My mom’s childhood was partly spent in a war-torn country where they had no choice but to eat crickets for protein. Years later, I showed her an article about how some gourmet restaurants are experimenting with cricket preparations. She looked pensive, and said “They should harvest them from the rice fields. I think the rice-fed ones taste best?”
🇨🇦 tunetardis
- 0 Posts
- 39 Comments
Thanks, it makes me feel relieved to hear I’m not the only one finding it a little overwhelming! Previously, I had been using chatgpt and the like where I would be hunting for the answer to a particularly esoteric programming question. I’ve had a fair amount of success with that, though occasionally I would catch it in the act of contradicting itself, so I’ve learned you have to follow up on it a bit.
I turned on copilot in VSCode for the first time this week. The results so far have been less than stellar. It’s batting about .100 in terms of completing code the way I intended. Now, people tell me it needs to learn your ways, so I’m going to give it a chance. But one thing it has done is replaced the normal auto-completion which showed you what sort of arguments a function takes with something that is sometimes dead wrong. Like the code will not even compile with the suggested args.
It also has a knack for making me forget what I was trying to do. It will show me something like the left side picture with a nice rail stretching off into the distance when I had intended it to turn, and then I can’t remember whether I wanted to go left or right? I guess it’s just something you need to adjust to. Like you need to have a thought fairly firmly in your mind before you begin typing so that you can react to the AI code in a reasonable way? It may occasionally be better than what you have it mind, but you need to keep the original idea in your head for comparison purposes. I’m not good at that yet.
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•Time to make C the COBOL of this centuryEnglish
3·1 year agoOuch. Well if you wanna take your chances in Canada, definitely advertise your senior COBOL dev skills! ;)
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•Time to make C the COBOL of this centuryEnglish
4·1 year agoLol yeah she’s in insurance! I bet you could probably also infer from the fortran that I work for a science-y outfit.
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•Time to make C the COBOL of this centuryEnglish
11·1 year agoMy wife was telling me at her work they’re desperate for cobol programmers, as they’re all retiring boomers leaving behind a giant code base. At my work, it’s legacy fortran that’s all over the place, but we’re a much smaller company.
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•[Noob here] Can someone explain to me the advantage of mutable objects?English
4·1 year agoThat’s the point, when programming with immutable structures you always pass the mutability onto the enclosing structure.
I guess the point I was trying to make here was if the data type is already mutable, there is no point in sticking it in a list just so you can replace a reference with an identifier. You’re just adding an extra level of indirection. But sure yeah, if the type is inherently immutable, you have to do something.
A list is an antipattern here IMO. Just wrap it in some dedicated object (see e.g. Java’s StringBuilder).
Interesting. I’m not aware of anything like
StringBuilderin the standard library for either Python or JavaScript. Looks like it wraps a list of characters and tries to behave as string-like as possible? You could presumably write your own class like that or download an implementation from someplace.I guess in most cases in my own code, where I need a mutable string is usually as part of a larger data structure which is the thing that gets passed around by reference, so it’s easy enough to replace a field within that.
For building up a string, I would tend to use an
io.StringIOin Python with file-writing calls, but those aren’t meant for sharing. What you don’t want to do is use the+=operator a lot on strings. That gets expensive unless strings are mutable (like they are in say C++'sstd::string).
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•[Noob here] Can someone explain to me the advantage of mutable objects?English
12·1 year agoWell, but then you’re basically just pushing the mutability onto the container, since you need to be able to replace elements within it.
It’s a good strategy at times though. Like say you’re working in a language where strings are immutable and you want a string you can change. You can wrap it in a list along the lines
s=['foo']and pass references to the list around instead. Then if you gos[0]='bar'at some point, all the references will now see['bar']instead.
🇨🇦 tunetardis@lemmy.cato
Programming@programming.dev•[Noob here] Can someone explain to me the advantage of mutable objects?English
11·1 year agoAs others have pointed out, there is the issue of breaking references to objects.
There can also be a lot of memory thrashing if you have to keep reallocating and copying objects all the time. To some extent, that may be mitigated using an internment scheme for common values. In Python, for example, integers are immutable but they intern something like the first 100 or so iirc? But that doesn’t work well for everything.
Any container you want to populate dynamically should probably be mutable to avoid O(N²) nastiness.
🇨🇦 tunetardis@lemmy.cato
Today I Learned@lemmy.world•Bald Eagle Officially Declared US National Bird After 250 YearsEnglish
2·2 years agoI’ve seen more bald eagles of late and I’m in Canada. Are they fleeing for some reason?
At least the Canada geese are going the other way. Those things are the devil! Chasing after me on my bike hissing…
Interesting. I had never heard of LilyPond before. I do a lot of music scoring using abc notation and even wrote myself a GUI to help with that, but it’s interesting to see that there is another script language for generating sheet music.
I can’t speak for others, but the python3 transition wiped the smile off my face for awhile there.
I suppose it depends on the language? For the most part I think you’re right. Exceptions are only used (if at all) in situations where a program diverges unexpectedly from its normal flow. But take a language like Python. They’re just everywhere. Even your plain old
forloop ends on an exception, and that’s just business as usual.
Awesome. I will add it to my list of places I want to visit just based on name alone. A few others include Batman, Turkey, Shitterton, England, and Saint-Louis-du-Ha! Ha!, Québec.
🇨🇦 tunetardis@lemmy.cato
Today I Learned@lemmy.world•TIL fungi (i.e mushrooms, yeast, mould) are more closely related to us humans than to plantsEnglish
5·2 years agoIf you haven’t been there yet, OneZoom is fun to explore. I am continually surprised by what I find there going down some random branch.
This could be why Obiwan wound up a hermit? (Programmers of my generation at least talk about “Obiwan errors” because his name sounds like “off-by-one”.)
There were breaking changes between C and C++ (and some divergent evolution since the initial split) as well as breaking changes between different releases of C++ itself. I am not saying these never happened, but the powers that be controlling the standard have worked hard to minimize these for better or worse.
If I took one of my earliest ANSI C programs from the 80s and ran it through a C++23 compiler, I would probably need to remove a bunch of
registerstatements and maybe check if an assumption of 16-bitintis going to land me in some trouble, but otherwise, I think it would build as long as it’s not linking in any 3rd party libraries.
I think the thing with C++ is they have tried to maintain backward compatibility from Day 1. You can take a C++ program from the 80s (or heck, even a straight up C program), and there’s a good chance it will compile as-is, which is rather astonishing considering modern C++ feels like a different language.
But I think this is what leads to a lot of the complexity as it stands? By contrast, I started Python in the Python 2 era, and when they switched to 3, I was like “Wow, did they just break hello world?” It’s a different philosophy and has its trade-offs. By reinventing itself, it can get rid of the legacy cruft that never worked well or required hacky workarounds, but old code will not simply run under the new interpreter. You have to hope your migration tools are up to the task.
🇨🇦 tunetardis@lemmy.cato
Today I Learned@lemmy.world•TIL that in Japan in 1980s, you could buy computer parts at cheap prices from shopping arcades and have them made into computersEnglish
4·2 years agoI didn’t even have a color monitor :'( I would’ve been jealous of yours.
I almost quit programming too when my brother walked in one day as I was feverishly typing. “What? You’re programming basic? That’s for losers.” Then he whips up a ski slalom game in a single incomprehensible line of apl and I was like wtaf?
Today I’m a professional dev and my bro is a perl hacker. I still can’t understand a line of his code.



I know someone who’s going in for a colonoscopy. Maybe they can get the two-for-one package with a reading tossed in?