site banner

Friday Fun Thread for November 25, 2022

Be advised; this thread is not for serious in depth discussion of weighty topics (we have a link for that), this thread is not for anything Culture War related. This thread is for Fun. You got jokes? Share 'em. You got silly questions? Ask 'em.

7
Jump in the discussion.

No email address required.

I'm studying Physics but I want to appreciate programming and Computer Science more. I must admit that the two programming courses I've taken were quite boring and deluding, and I don't know if it is because they sucked or because I find programming boring in itself. My problem is that I do not really know what a programmer and computer scientist should be able to do, both in an academic and marketability sense[1], in other words how do I create a self-study curriculum to follow?

[1]like: What are jobs that programmers do? What are some beginner to advanced projects that I could implement on my laptop?

Since you are a physics student I will make you a suggestion that should be close to home. Lofty demonstrations of algorithmic beauty won't faze someone who doesn't naturally find programming and CS interesting.

Ever thought solving long equations were a bitch (lol)? Play around with SymPy. It's a python package for symbolic manipulation. Check out the link to the video above, it's by a physics student showing you how to use SymPy to solve common physics equations and some of them are extremely difficult if not impossible to solve by hand. The sheer usefulness of it speaks for itself. You can solve the equation, plot it, solve a 1000 different variations of it, generate LaTeX renderings of it, "lambdify" it and put it into production, and so much more with TRIVIAL amounts of effort.

And don't get spooked by syntax/idioms you don't understand quite yet. As an Electrical Engineer who had to hand solve his fair share of Maxwells Equations, Take Fourier/Laplace transforms and solve some retardedly long control systems problems, letting the computer do all the hard work so that you can focus on the larger task at hand is a blessing of the likes a student might not even appreciate yet. Ain't nobody got time to hand solve shit, we have computers for a reason. Programming is not harder than Physics, do not be scared.

In an ideal world you should probably be a decent enough python programmer or programmer in general before using specialized packages because otherwise, you will stumble against the language itself. But in your case let's hope the reverse works out. You might find SymPy so useful that you venture out into other programming use cases.


For those wondering, why not just recommend MATLAB since it comes "built-in" with symbolic manipulation and a whole host of other things a physicist might find useful? Well... FUCK MATLAB that's why.


And what do programmers do? Come on man, you are typing this out on a fucking website, which didn't appear out of thin air. Just look around you.

Well... FUCK MATLAB that's why.

I've been trying to get this point across to some of my coworkers. A few don't get it.

What have you been saying exactly?

We aren't real software devs. We are engineers who need to process a lot of simulated and measured data. Half of us use python and half use matlab.

I try to say that python is in every way more capable than matlab and not locked behind a paid license. If you had to extend a script to include automation or something, python is ready for you. It is also free so if you had to put your scripts on one of the off network Linux machines in the lab, python would work just fine.

Using python in Spyder has all the benefits of matlab, for people who love that UI. Which I actually really do. But now I have a free portable version of my code that isn't locked behind a matlab license. Why are we paying them and locking our code out of the lab computers when the free and more capable alternative exists? It isn't like we are using LabView or some other matlab specific tool.

But these people are used to matlab and so half the time when I get someone else's code it is matlab. And so half the time I get to code in matlab. And the other teams use python almost exclusively, so it is just us leaning hard on matlab for no reason.

I won't even bother complaining about matlab's actual flaws here. Indexing from 1. Running out of memory when dealing with moderately large data sets, requiring lots of needless clearing of variables or matlab specific workarounds to their memory limitation bullshit that has nothing to do with hardware limitations. Hiding basic functionality behind paid toolboxes that each need a different license. Etc. Etc.

Also I never figured out if Matlab even has a real debugger. Being able to just %debug is so ridiculously useful

You can set break points in functions and scripts. Just click to the left of a line of code by the line numbers. Run it and it will enter debugging mode. Variables usually hidden in functions will be displayed on the open variables plane.That works fine for debugging in my non-professional-software-dev experience.

The indexing from one thing aways pissed me off so much (what’s worse is that is trying to keep this straight when using Matlab to do signals processing since it’s obvious that Matlab Fourier transform functions are wrapped C or some other real language)

Sounds like gridlock to me. Matlab is well entrenched in engineering enough that you are going to have a tremendously difficult time convincing anyone to get off it unless some other tool does that same thing SIGNIFICANTLY better accounting for the preference for Matlab.

Your best course of action, even though it may be an underhanded move is if you can convince the higher-ups that there are significant cost savings by not paying for the license.

And unless you are using Simulink or doing some heavy control system modeling, I think that is going to be an easy case to make. The python scientific suite (NumPy, SciPy, SymPy, Matplotlib) APIs are all designed for people coming from Matlab. So adoption costs should be fairly minimal.

If you really want to be a sociopath, I would choose a project that would be impossible to do in Matlab but a cakewalk in python; think some combination of deep learning that interfaces with multiple web apps.