When I go to that URL on a stock, direct FF install, I still see that notice.
When I go to that URL on a stock, direct FF install, I still see that notice.
That XKCD reminds me of the case a year or three ago where some solo dev that no-one had ever heard of was maintaining a library that a couple of other very popular and major libraries depended on. Something somewhere broke for some reason, and normally this guy would’ve been all over it before most people even realized there had been a problem, but he was in hospital or jail or something, so dozens of huge projects that indirectly relied on his library came crashing down.
What upset me most was reading the community discussion. I didn’t see a single person saying, “How can we make sure that some money gets to this guy and not just the more visible libraries that rely so heavily on his work?”, even though the issue was obliquely raised in several places, but I did see quite a few saying, “How can we wrest this code out of this guy’s hands against his will and make multiple other people maintain it (but not me, I’m too busy) so we don’t have a single point of failure?”
I’d argue that you do need to be good at math to be an effective programmer, it’s just that that doesn’t mean what a lot of people think it means. You don’t need to know all the ins and outs of quadratics, integrals, and advanced trigonometry, but I think you do need to have a really solid, gut-level understanding of basic algebra and a bit of set theory. If you’re the sort of person whose head starts to swim when you see “y=3x+2”, you’re going to find programming difficult at best.
Whatever it may have become in later years, Alan Kay, who is often called “The Father of Object-oriented Programming”, outlined the message-passing idea as the main concept he was driving at, originally.
He also says that he probably misnamed it.
Here’s a discussion in which the man himself makes a (small) appearance: https://softwareengineering.stackexchange.com/questions/46592/so-what-did-alan-kay-really-mean-by-the-term-object-oriented
I am currently working on a game for the Atari 2600, and you just gave a good outline of my code. And I love it.
I tend to agree. I think this attitude is something of a holdover from the early days of computer science, when of academics from all the other, existing fields, mathematicians were usually the best fit. Now that we have formal computer scientists, computer engineers, and software engineers, this is no longer the case.
In my experience, when someone from a purely mathematical background tries to program or explain something for programmers, they often (but not always, to be fair) insist vehemently on sticking to methods and algorithms that at best confuse the issue in a programming setting, and sometimes even run counter to how the computing hardware works, reducing performance. In these situations the rationale given is usually something along the lines of, “Listen, we mathematicians have been doing it this way for X hundred years, so that’s the way it should be done!”
I love low-level stuff and this still took me a little while to break down, so I’d like to share some notes on the author’s code snippet that might help someone else.
The function morse_decode
is meant to be called iteratively by another routine, once per morse “character” c
(dot, dash, or null) in a stream, while feeding its own output back into it as state
. As long as the function returns a negative value, that value represents the next state of the machine, and the morse stream hasn’t yet been resolved into an output symbol. When the return value is positive, that represents the decoded letter, and the next call to morse_decode
should use a state
of 0. If the return value is 0, something has gone wrong with the decoding.
state
is just a negated index into the array t
, which is actually two arrays squeezed into one. The first 64 bytes are a binary heap of bytes in the format nnnnnnlr
, each corresponding to one node in the morse code trie. l
and r
are single bits that represent the existence of a left or right child of the current node (i.e. reading a dot or dash in the current state leading to another valid state). nnnnnn
is a 6-bit value that, when shifted appropriately and added to 63, becomes an index into the second part of the array, which is a list of UTF-8/ASCII codes for letters and numbers for the final output.
I thought that this was going to be a play on the phrase, “Don’t trust anyone over 30,” but it’s just a very short piece about Dunning-Kruger aimed specifically at some C++ concepts.
Assuming C/C++, dare we even ask what this teacher uses instead of switch statements? Or are her switch statements unreadable rat’s nests of extra conditions?
This is a good life lesson. We’re all idiots about certain things. Your teacher, me, and even you. It’s even possible to be a recognized expert in a field yet still be an idiot about some particular thing in that field.
Just because some people use a screwdriver as a hammer and risk injuring themselves and damaging their work, that’s not a good reason to insist that no-one should ever use a screwdriver under any circumstances, is it?
Use break statements when they’re appropriate. Don’t use them when they’re not. Learn the difference from code that many other people recommend, like popular open-source libraries and tutorials. If there’s a preponderance of break statements in your code, you may be using a suboptimal approach.
But unfortunately, for this course, your best bet is to nod, smile, and not use any break statements. Look at it as a personal learning experience; by forcing yourself sit down and reason out how you can do something without using break statements, you might find some situations where they weren’t actually the best solution. And when you can honestly look back and say that the solution with break statements is objectively better, you’ll be able to use that approach with greater confidence in the future.
I think that it’s because a) the abstraction does solve a problem, and b) the idealized solutions aren’t actually all that simple.
But I still agree with the article because I also think that a) the problem solved by the added abstraction isn’t practical, but emotional, and b) the idealized solutions aren’t all that complex, either.
It seems to me that many devs reach immediately for a tool or library, rather than looking into how to create their own solution, due more to fear of the unknown than a real drive for efficiency. And while learning the actual nuts and bolts of the task is rarely going to be the faster or easier option, it’s frequently (IMO) not going to be much slower or more difficult than learning how to integrate someone else’s solution. But at the end of it you’ll have learned a lot more than you would’ve by using a tool or library.
Another problem in the commercial world is accountability to management.
Many decades ago there used to be a saying in tech: “No-one ever got fired for buying IBM.'” What that meant was that even if IBM’s solution was completely beaten by something offered by one of their competitors, you personally may still be better off overall going with IBM. The reason being, if you went with the competitor, and everything worked out, the less tech-savvy managers were just as likely to pat you on the back as to assert that the IBM solution would’ve been even better. If the competitor’s solution didn’t meet expectations, you’d be hauled over the coals for going with some cowboy outfit instead of good old reliable IBM. Conversely, if you went with IBM and everything worked, everyone would be happy. But if you chose IBM and the project failed, it’d be, “Well, it’s not your fault. Who could’ve predicted that IBM wouldn’t come through?”
In the modern era, replace “IBM” with the current tool-of-the-month, and your manager will be demanding to know why you’re wasting time reinventing the wheel on the company’s dime.
I think a part of it is how we look for information in the first place. If you search/ask “How do I do (task) in (environment)?”, you’re going to find out about various libraries/frameworks/whatever that abstract everything away for you. But if you instead look for information on “How do I do (task)?”, you’ll probably get more generalized information that you can take and use to write your own stuff from scratch. Try only to look for help related to your specific environment/language when you have a specific implementation issue, like how to access a file or get user input.
We also need a willingness to learn how things actually work. I see quite a few folks who seem to be so worried that they’ll never be able to understand some task that they unwittingly spend almost as much or even more time and effort learning all the ins and outs of someone else’s codebase as a way to avoid what they see as the scarier unknown.
Fortunately, I’ve seen an increase in the last year or two of people deliberately giving answers or writing tutorials that are “no-/low-library”, for people who want to know what’s actually going on in their programs.
I would never say to avoid all libraries or frameworks, because many of them are well-written (small, modular, stable) and can save us a lot of boilerplate coding. But there are at least as many libraries which suffer from “kitchen-sinkism”, where the authors want so much for their library to become the pre-eminent choice that it becomes a bloated tangle, trying to be all things to all people. This can be compounded by less-experienced coders including multiple huge libraries in one program, using only a fraction of each library’s features without realizing that there’s almost complete overlap. The cherry on top is when the end developer uses one of these libraries to do just one or two small tasks that could’ve been done in less than a dozen lines of standard code, if only someone had told them how, instead of sending them off to install yet another library.
My Hero isn’t actually Irish, but it does star Ardal O’Hanlon (Father Dougal) for almost its entire run, so it may scratch the itch.
Yep, it’s probably easier to get an Android device and install readers on it than to try for a prepackaged FOSS reader.
I use several apps on my Android phone, but mostly Kindle (for Kindle, duh), PDF Reader (for PDFs, duh again), and Lithium (mostly for EPUB but pretty much everything else, too). I get most of my e-books as DRM-free EPUBs and PDFs.
I have a dumb question… Are you declaring “enabled” somewhere outside of any of these functions?
I learned about Bloom filters from an article discussing how old systems and algorithms shouldn’t be forgotten because you never know when they’ll come in handy for another application. The example they gave was using Bloom filters to reduce data transmission for MMOs; break your world into sectors and just send everyone a Bloom filter of objects mapped to sectors, then the client can request more detail only for objects that are within a certain range of the individual PC.
I agree with most of what you said, except for the Windows examples. The pages that you linked begin with three-line TL;DRs that are enough for any barely-competent user to find and modify the necessary settings. While the full instructions may be tortuously detailed, are they actually hard to understand?
And sure, those Windows pages don’t advance the user’s knowledge in any meaningful way, but neither does blindly copying and pasting a line of shell commands.
By the way, while I appreciate that we’re talking about if and how CLI is superior to GUI, and not Linux versus Windows…
Where-as Linux users can easily share commands and fixes or tests over a simple irc chat, because the command line reaches the whole system.
… both of those tasks can be done via CLI in Windows, too. I am very happy that I switched to Linux, but there’s no reason to misrepresent the other guys.
One thing that wasn’t mentioned in the article is default settings. In so many CLI programs (and FOSS in general), there seems to be some kind of allergy to default settings. I don’t know whether it’s a fear of doing the wrong thing, or a failure to sympathize with users who haven’t spent the last three months up to their elbows in whatever the program does. But so often I’ve come to a new program, and if I’ve managed to stick with it, come to the realization later that at least half of the settings I needed to research for hours and enter manually every time could have been set to static defaults or easily-derived assumptions based on other settings in 99% of cases. Absolutely let your users override any and all defaults, but please use defaults.
I’d also be interested in the overlap between people saying, “LOL just get gud” about using the command line, and people who are terrified of using C++.
Maybe, but it’s gonna be more like SkyNet with electrolytes; it’s what terminators crave.