The MySQL dolphin is adorable
Typing a paper for class and one of my subheadings reads, ”What’s the point of working?” And I didn’t think through how much that would affect my ability to write the rest of the essay.
An epistle on an “oh duh” moment I just had while pondering switch functionality in Python.
Every couple of months when I get back into some hobbyist Python development I find myself DuckDuckGo-ing “switch in Python” and am subsequently always reminded that that’s not explicitly a thing. You, of course, get that functionality from dictionaries.
I’ve always thought that was dumb, but today I was considering it and realized that it’s all because of the interpreted nature of the language. Switch statements have the wicked performance improvements over if ladders in compiled languages because the switch tells the compiler to put a bunch of branches in the intermediate assembly so a lot of unnecessary condition checks are skipped.
Without in-depth knowledge of how the interpreter works, it now becomes clear why you have to use the dictionary. It’s not the Python lords being pretentious and imposing their pythonic ways; you have to be more explicit to the interpreter about where to look for the logic to run because the interpreter doesn’t craft intermediate assembly, it just plows straight through. So a switch in Python would ultimately perform no better than an if ladder.
That doesn’t mean a switch wouldn’t make me happy, mind you.
Went to React’s website to learn the Tic Tac Toe tutorial (it’s about time I got around to it) and was pleasantly surprised to see this. Way to go, React.
Well of course. Mina is an ELITE data wrangler.
Want to go on record and say that the owner of this blog did, in fact, read dracula daily. Time and time again I tried to think of fun ways to relate it to programming. Yet time and time again I couldn’t bring myself to do it.
Not because there weren’t ways I could shoehorn in a weird analogy, but because I admired the characters too much to force one. Idk it just felt disrespectful to bring code into this.
Will happily disrespect Dracula, though. Got some real cobol energy from that dinosaur. Particularly the way he drains the life out of a lot of happy, wonderful people.
Question for a higher power: Is the ability to access specific list indices something I’ve always taken for granted? Or should it be an expectation?
Scheme’s implementation of a “list” is a series of nested pairs (sorta nested - I’m calling it that even though that’s not completely correct), so you can either get the first element in the list or all of the others UNLESS you know the specific index you need in a constant fashion (i.e. “c” + [combination of “a”s and “d”s] + “r”).
Haskell has those sweet sweet index accessors we all know and love from C and it’s children and even most of it’s counterparts. Even in C itself there was functionality to store an address to a pointer and then just do pointer arithmetic to access an index like arr[2] -> 0x#{ADDRESS OF arr} + 2. It’s simple and straightforward, so I don’t feel like I’m being difficult to expect that of my programming language. Am I, though?
You’ve probably noticed by now that this post isn’t meant to be a coherent case for anything; it’s more of a ramble and a rant. Honestly, though, just give me accessors (and mutatability too please... I’m looking at you Go. Nobody thinks you’re slick with your whole “arrays are static and annoying use slices because we’re edgy”).
You know how there are a lot of programming languages that people say are “really powerful if you know how to use them”? And how usually those languages aren’t at all worth the time? I think Haskell might actually be worth the time. After a hiatus I’ve come back to it and love it. I hardly know how to use it, but at least I can perceive how it might be really powerful.
Prolog is still the worst, though.
I was today years old, unfortunately
My mind is still quite firmly blown
I like Cilk++. It’s so nice to just be like “Hey I want this for loop to have some parallelism” then only have to replace the “for” with “cilk_for”.
Hey! Computer Science B.S. passing by. CS, like the last reply mentioned, is a science. A lot of schools will lump it in with the college of engineering (e.g. the one I went to), which isn’t necessarily wrong, but ultimately the discipline is a natural science.
In fact one could argue that hardware computers aren’t even necessary to perform the activities of pure computer science: people like Leonhard Euler were discovering its principles long before the first transistor had been made. Heck, even if your laundry-sorting process is rigid enough you could call it computer science.
I think of computer science as the study of the ways to move and store data. The best way to accomplish those activities happens to be with computers, so we concern ourselves with applications on the creations of our computer engineering friends.
hey! could you help me with the difference between computer science and computer engineering?
hi! my background is experimental physics, so you might be better off asking someone who is actually from one of those disciplines. but my understanding is that computer science focuses on software (eg data structures, coming up with algorithms) while computer engineering is a marriage of cs and electrical engineering, which involves more work on the electronics/hardware side of things. because of this, you'd need to learn a lot more physics for a computer engineering degree.
In case anyone is curious I still haven’t organized that first react project. Ironically, of everything I’ve ever made it is currently the most popular, and it only took 4 hours to make. Heavy sigh.
he/himComplaining on Tumblr is a good alternative to punching my computer screen, right?
72 posts