Programming thread

I did my first personally useful project in Ruby (aside from Delphi, but that was a long time ago).
Lazarus is the FOSS counterpart to Delphi's IDE, based on Free Pascal
also typing a small python function into the repl is a bit harder if you have to think about the whitespace
repls are one of the best ways to tell computers to do things (see: your bash prompt) and programming languages without good repls are missing out on a lot
I haven't encountered too much difficulty with IPython that I haven't with some other REPL. Also Jupyter Notebooks are there too.
I'd argue in many cases C is better for learning and C++ or another language that has some specific or a generic purpose is best for getting shit done. But the best thing to do if you want to learn more about computers is learn how a CPU works and build one yourself in some software or literally Minecraft. That way you can also figure out how an assembly language really is made.
I think you'd really like nand2tetris. It's a great idea though I think the pedagogy is a bit rushed. It can give you good ideas at the very least.
 
On a similar topic: is there any equivalent of Stroustrup's "The C++ Programming Language" for newer versions of C++, or did everyone just give up on the idea of such a thing and you should just read cppreference.com?
personally i just use cppreference and watch cppcon/cpponsea talks
if you prefer books tho, I've heard good things about Bill Weinman's C++ STL cookbooks, he will drop C++23 version next year
one of the useful things to know is to use a reference instead of pointers, and std::string_view instead of std::string const& and std::span instead of std::vector for non-owning parameters
since a lot of containers that dont/cant implicitly cast into std::vectors will implicitly cast into std::spans
also mark your functions constexpr, it's much much better today than it was 10 years ago
 
  • Like
Reactions: Aidan
I think you'd really like nand2tetris. It's a great idea though I think the pedagogy is a bit rushed. It can give you good ideas at the very least.
That looks really interesting, it uses the same method the game "Turing Complete" uses which is a very powerful method but this course goes much further then just a simple machine that runs assembly. This one even teaches you to build an operating system which I think is really cool. I should spend my time on this.
 
I like using C because it's fucking simple, which not only makes it good for teaching, but also the fact that it's very close to the computer, so people can learn bottom up. The problem with other languages like C++ is that I spend way too much time reading the docs, debating which features to use to make the source code the simplest/most idiomatic. That problem doesn't exist in C, because it has fucking nothing.
This is a problem you will inevitably run into when you have to use anything outside of the stdlib in any language. When I'm reading docs, I'm never asking myself "what's the most idomatic way to do this?" or "how can I do this in a way where fags on stackoverflow won't berate and belittle me?". Instead, I'm asking myself what tools I need for the job, not necessarily what the best one is. You develop a feel for whether the function you're writing is held together by duct tape and prayers. You'll find hundreds of ways to achieve the same result, and you'll quickly figure out which ones are the least painful and slow to work with for a given task.

For a kinda shitty analogy: Sure nail guns and other fancy tools exist, but sometimes you just need to grab a hammer, some nails, and start swinging if you wanna get anything done. Just write the damn program and fix your retarded choices once you have the scaffolding laid out.
 
Last edited:
My standard comment is that my Rust, Go, Python, Javascript, Ansible, Puppet, and any other language I'm forced to cargo-cult a fix into always looks like PERL. And all my PERL looks like C.
Why "PERL" in all caps? My understanding is that "Perl" is the language (and perl is the executable).
 
Perhaps someone on this thread has a greater insight into this question than myself: What is the purpose of MATLAB?

Sure, from my experience with it it seems like a fairly capable language for Mathematical computing, but there is nothing special about it that makes it more capable for performing that task than something like Python or Julia, at least from what I've seen.

The real bummer is the fact that it's proprietary, and that so many university students in STEM have to learn it.
 
Perhaps someone on this thread has a greater insight into this question than myself: What is the purpose of MATLAB?

Sure, from my experience with it it seems like a fairly capable language for Mathematical computing, but there is nothing special about it that makes it more capable for performing that task than something like Python or Julia, at least from what I've seen.

The real bummer is the fact that it's proprietary, and that so many university students in STEM have to learn it.
Matlab is an 80s thing that embedded itself into academia and just kind of coasts along off inertia, especially when some niche library is written only for Matlab. If you have the choice to use something like Python with Numpy, there's no reason not to.
 
Perhaps someone on this thread has a greater insight into this question than myself: What is the purpose of MATLAB?
It feels like a strange transitional fossil for roughly late 80s to 90s, an era after people (university students) largely stopped doing Fortran and Pascal and before widespread adoption of Python. My STEMcel experience with it mostly involved occasionally being being paid to translate old MATLAB code to Python (lol), but maybe the situation is different in the more engineering lands within STEM where it seems more prevalent. Good riddance I say, total proprietoid death
 
Is there any effective way to manually manage memory in Java? The two ways I know of is to either call System.gc() or set values to null, but it would be good to have other options
 
  • Thunk-Provoking
Reactions: Polyarmory
Is there any effective way to manually manage memory in Java? The two ways I know of is to either call System.gc() or set values to null, but it would be good to have other options
What exactly are you trying to achieve? If you want to prevent allocations or GC scavenging during a certain section, object pools might help, but generally, fighting the GC is asking for trouble.
 
Is there any effective way to manually manage memory in Java? The two ways I know of is to either call System.gc() or set values to null, but it would be good to have other options
Also very curious what exactly you're trying to achieve, but would venture that you just manually manage your memory in C and call it with JNI.
 
I've been in Bison/Flex hell for a week and a half, and for some reason I remembered somebody in this thread mentioning OCaml. I looked into it, and even with having to learn a new language, it looks so much better.
I don't remember who you are but thank you to whoever made that post
 
I'm trying to figure out how to setup a thing for a customer.

Ok, cd to the directory, type "npm install"

"added 2025 packages"

What the everloving fuck.
My entire Linux install is only 2500 packages.

It's no wonder supply chain attacks work so well on node.
 
Perhaps someone on this thread has a greater insight into this question than myself: What is the purpose of MATLAB?

Sure, from my experience with it it seems like a fairly capable language for Mathematical computing, but there is nothing special about it that makes it more capable for performing that task than something like Python or Julia, at least from what I've seen.

The real bummer is the fact that it's proprietary, and that so many university students in STEM have to learn it.
From my very limited exposure and hearsay, it's two-fold. First, social momentum. There's a bunch of Matlab stuff already out there and pirating it is very easy. Second, it's a good base for people who aren't necessarily programmers and specialize in theoretical concepts/prototypes. Once they get a working MVP, the code gets translated to C++ by the tool that's available together with Matlab and then actual hardcore programmers optimize that into the real deal. At least that's how a professor explained it to me some years ago.
 
I'm trying to figure out how to setup a thing for a customer.

Ok, cd to the directory, type "npm install"

"added 2025 packages"

What the everloving fuck.
My entire Linux install is only 2500 packages.

It's no wonder supply chain attacks work so well on node.
I almost wonder if package management being ass in languages like C++ is a blessing in disguise
 
I've been in Bison/Flex hell for a week and a half, and for some reason I remembered somebody in this thread mentioning OCaml. I looked into it, and even with having to learn a new language, it looks so much better.
I don't remember who you are but thank you to whoever made that post
My enthusiasm was a little premature, I spent most of the day figuring out how to build an ocaml program with libraries, then pull that into a c static library compilation
I’m realizing that switching from a more state based parser like bison to a functional one is going to be tough, and that’s not helped by the fact that I’m also having to learn ocaml
 
I'm trying to figure out how to setup a thing for a customer.

Ok, cd to the directory, type "npm install"

"added 2025 packages"

What the everloving fuck.
My entire Linux install is only 2500 packages.

It's no wonder supply chain attacks work so well on node.
This is kind of a quibble, but I'm pretty sure that includes transitive dependencies (since NPM duplicates them in node_modules.)

You are correct, however, that JS users have the wrong attitude about dependencies and toolchains. The attitude there really comes from two places, I think:
  1. The ratio of experienced to inexperienced/unskilled developers is very low compared to most other ecosystems, so it's normalized to assume that whatever is being done in dependencies is wizardry that you'd surely fuck up somehow if you tried to do it yourself. JS users mostly feel "safer" when something is written by someone else.
  2. The natural world of JS/HTML/CSS is such a convoluted clusterfuck that things like component frameworks and other convoluted toolchain bullshit actually does make things a lot easier, and I think this has desensitized JS developers to the stank inherent to putting more layers of bullshit between the source code and the object code (even though the object code in this case is a minified form of the source for the most part.)
 
Back