1. 3

    The SIMD intrinsics don’t come out as exactly readable but I guess this is something you’d mostly do for small self-contained things like whitespace trimming. Anyone know a good resource to learn how to write that stuff? Is it possible to take advantage of that in a manner that’s not assuming everything is x86?

    The branch-free approach is something I’ve done before and often results in shorter code anyway.

    1. 2

      Anyone know a good resource to learn how to write that stuff?

      I’ve been writing small programs to use simd instructions (e.g., count lines in a buffer, rot13 a buffer) mostly by practicing: I set 30 minutes aside, I try to solve the problem by looking at the intrinsics available and putting together a solution. After 30 minutes, I stop. If I’m not done, the next day I restart from scratch; that way, I become more familiar with the functions for loading bytes into a simd register or doing comparisons, etc.

      Is it possible to take advantage of that in a manner that’s not assuming everything is x86?

      I don’t know, but I don’t think so. Also, if you are going down to that level, it seems like you’d want to use the actual instructions and not an abstraction built on top of them.

    1. 4

      It doesn’t get a mention here but the first one that comes to my mind is MNG which is a PNG based variant to do much the same as animated GIFs. I was rather dismayed how several years after I thought we’d finally killed the GIF format, it seemed to make something of a comeback.

      1. 1

        We’ll never kill GIF in that, to most people, any short video is a GIF.

      1. 2

        That actually seems great. Does anybody see any drawback (besides the overhead of starting a subshell) with using this tip?

        1. 9

          Forks are slow so starting a subshell is not an insignificant cost. It also makes it impossible to return values besides an exit status back from a function.

          Zsh has “private” variables which are lexically scoped. ksh93 also switched to lexical scoping instead of dynamic scoping but note that in ksh, you need to use function name { syntax instead of name() { to get local variables.

          1. 9

            Also, in zsh you can just use always to solve the problem in the article:

            {
                 foo
            } always {
                 cleanup stuff
            }
            
            1. 3

              Every time I learn a new thing about zsh, I’m struck by how practical the feature is and how amazing it is that I didn’t know about said feature the past dozen times I really, really needed it. I looked around the internet for documentation of this, and I found:

          2. 2

            A guy on the orange site timed subshell functions to take roughly twice as long.

          1. 2

            For whatever reason, it was the Casio calculators that were popular in the UK. The only language for programming was the normal calculator language - no BASIC or assembly. There was only 422 bytes of memory on Casio’s original model but you could do more with that than would be possible in assembly. There were weird tricks to optimising programmes for size. I had Connect 4 working in barely more than 100 bytes.

            1. 3

              The TI calculators were on the approved list for GCSR and A-level maths in the ’90s. The vast majority of the of the functionality of the calculator was completely irrelevant to (or actively unhelpful to) the course. It could solve quadratic equations via a repeated approximation method, which was useful for checking your answers, but pretty much everything else was useless.

              I had a TI-86 (which was like the TI-85 but with more RAM and, for some reason, much slower screen updates). I never really got into the whole coding-on-the-calculator thing. I had had a Psion Series 3 for several years by the time I got the TI-86 and the Psion ran a full multitasking OS and came with a decent keyboard for writing code on the device. I wrote a load of programs on that machine and the TI calculator seemed quite clunky in comparison.

              The XKCD in the article really resonated with me. I can run GNU Octave on a bargain basement Android phone and have something vastly more powerful than the TI calculator for less money. They seem to make their money from the fact that exams place an upper limit on what a calculator can do in your exam. This, in turn, annoys me because it’s pretty clear that the exams aren’t actually measuring useful skills. I spent a year in maths lessons going from being able to solve differential equations in a thousand times as long as it would take a computer to being able to solve them in a hundred times as long. If I ever need so solve a differential equation now, I’ll reach for Matlab / Mathematica / Octave because then I’ll definitely get the right answer and even installing the tool from scratch to solve a single equation will probably take less time than solving it on paper. Being able to construct the right equation to represent a problem is a useful skill. Being able to understand the underlying theory that leads to things like the chain rule is useful in some contexts (though that isn’t actually taught until university in the UK: at school they’re just magic recipes). Being able to run an algorithm slowly with a piece of paper and a pencil is as useful as being able to write with a quill pen: it may make you some friends at a historical re-enactment event but that’s about it.

              1. 1

                I remember getting programs written in C on my Casio calculator (maybe a 9750? Its in my storage somewhere still). I was an active member on casiocalc.org forum, and vaguely recall one of the French members teaching me how to do the C programs on the calculator. All I can recall is that it was done on the computer, with a link cable (which was hand made )

                That must have been in 1999 or so, based on which school I was in. Now I feel old.

              1. 2

                That issue with date reminds me of a case with the hostname command where at some point we noticed that the hostname of one of the Solaris servers had got changed to -d. The assumption was that someone’s Linux specific script was trying to get the fully-qualified hostname but was setting it on Solaris.

                1. 3

                  Unicode. Seriously, I’d rewrite Unicode specifications from scratch.

                  1. 2

                    What would you change?

                    1. 7

                      I would go back much further and redesign the alphabet and English spelling rules.

                      1. 4

                        I for one would not admit emojis into unicode. Maybe let whatever vendors want standardize something in the private use areas. But reading about new versions of unicode and the number of emojis added has me wondering about the state of progress in this world.

                        1. 5

                          Customers demand emojis. Software vendors have to implement Unicode support to accommodate that. Unicode support is more widespread.

                          I take that as a win.

                          Besides, sponsoring emoji funds Unicode development to some extent.

                          1. 3

                            MSN Messenger had emoji-like things 20+ years ago, but they were encoded as [[:picture name:]]. This works, because they are pictures, not characters. Making them characters causes all sorts of problems (what is the collation order of lower-case lambda, American flag and poop in your locale? In any sane system, the correct answer is ‘domain error’).

                            Computers have been able to display small images for at least a decade before Unicode even existed, trying to pretend that they’re characters is a horrible hack. It also reinvents the problems that Chinese and other idiographic languages have. A newspaper in a phonographic language can introduce a neologism by rearranging existing letters, one in an ideographic language has to either make a multi-glyph word or wait for their printing press to be updated with the new symbols. If I want a new pictogram in a system that communicate images, I can send you a picture. If I want to encode it as unicode then I need to wait for a new unicode standard to add it, then I need to wait for your and my software to support it.

                          2. 1

                            On the contrary, shipping new emoji is a great way to trick people into upgrading something when they might not otherwise be motivated. If you have some vulnerability fixes that you need to roll out quickly, bundle them alongside some new emoji and suddenly the update will become much more attractive to your users. Works every time. All hail the all-powerful emoji.

                            1. 1

                              Sure, let software vendors push security updates with emojis. Unicode the standard doesn’t need to do that.

                      1. 2

                        When you install a Google or Apple phone, it requires you to log in.

                        Correct me if I’m wrong about newer versions of Android, but I’ve never logged in to my Android phone (running v8.0) and it works perfectly well.

                        1. 2

                          I’ve also managed to do without a Google account on a newish Android phone. Installing F-Droid followed by Aurora store has allowed me to get any app I care about. I don’t think Apple require it either but you’d be stuck as far as installing any apps goes. I keep detailed notes for replicating my setup and as suggested in the post, nextcloud works for calendar/contacts.

                          1. 1

                            That what I’ve done (F-Droid plus Aurora) as I can’t unlock the bootloader on my phone. I’ve debloated it as much as possible and locked down all the Gapps, too.

                        1. 2

                          uPnP is rather a complicated beast. I’ve run minidlna for years (and mediatomb before it) and for sharing audio and video from my NAS to things on the LAN like TVs, DVD players, phones etc it is really great for the wide support. But while much just works in an obvious way, a lot of what it can do is not easy to make sense of and experiment with systematically. I recently tried to get my wireguard jail to forward the multicast packets it uses by running smcroute and enabling the ip_mroute kernel module but there must be more I need to do with ipfw to get that working. I’m fairly certain minidlna alone isn’t pushing holes in the router’s NAT (that needs something else like miniupnpd) but I actually would like a secure way for my kids to access our local media library when not at home. I’m reluctant to go with anything like Plex that appears to have some form of cloud component.

                          1. 1

                            Depending on what your kids are running, maybe Wireguard tunnels and NFS or CIFS mounting? You can give them read-only mounts, too.

                          1. 6

                            I don’t think Swift is ever going to be a real competitor as an app language on non-Apple platforms, given those platforms all have well-developed existing ecosystems for applications (.NET, Java/Kotlin, etc).

                            (But I don’t know what I don’t know. I’m talking as almost a complete outsider here.)

                            That leaves Swift as a really nice systems/server language in the same spaces as Go or Rust (which I realize have overlapping but very different spaces; I put Swift somewhere between the two on that continuum).

                            I’d really like to use Swift as a systems language on Linux but it just doesn’t seem ready for prime time there. The biggest problem for me is the lack of C interop the other way: using C from Swift is trivial, but using a Swift library from C is not officially supported.

                            (Go suffers from this problem too, but in a different way.)

                            Writing a “universal” library (callable from other languages easily) basically requires that it be written in C, C++, or Rust. Zig has good support for this, but the language is pre-1.0. D I think can do it but it seems moribund (correct me if I’m wrong).

                            Anyway, long story short, I want to see Swift as a viable competitor to Rust in the stdlib range of Rust’s use cases, but I don’t think it’s gonna happen. I just think that would be a place where Swift could thrive.

                            I asked a question here on lobste.rs a few weeks ago to see if anyone was using Swift on Linux, and all but one of the answers, sadly, was no. I would love to hear of people using Swift on Linux.)

                            1. 3

                              I think that’s a fair treatment. As I understand it, server work is the current expansion goal, and (waves hands) all this concurrency work is on that critical path. Systems programming features, like a memory ownership model, come later. It remains primarily an application-level language and there’s a long way to go. I’m optimistic, but it will take time.

                              1. 2

                                Definitely. I am excited about Actor proposal accepted and maybe implement process-based executor and supervisors for Actor. That would be very interesting!

                              2. 3

                                To be honest, I think it’s equally likely that Java will make a break-through in the Go/Rust space as Swift being successful there.

                                1. 1

                                  Even if you’re interested and want to try to use it on anything other than a mac, it ends up being far from trivial. Apple apparently do internal CI builds on one release of Ubuntu so it basically works on Linux. But you’re not going to find packages; building from source is non-trivial and if you’re on something slightly unusual you can forget it.

                                  At first glance, the language seems to have syntax rather like Rust and some nice features. But it seems every feature they ever considered got included. It was in production use early so had no period where things that didn’t work could be thrown out again. With Rust by contrast, there’s not much left of the language as it was when I first read up about it and played with it because lots of things got thrown out again. It’s reached a stable basis now but didn’t for some time.

                                  1. 3

                                    I’d temper that a little; Swift has thrown out some features like currying syntax and basically renamed all functions in 3.0. The early years saw a lot of churn on the way to source and binary stability. And before that there were years of development before Apple announced the project at all. (I would guess that Rust was public very early in life.) The additions for SwiftUI go overboard if you ask some of us, but that’s all version 5.

                                    I’d say Swift is maturing on Apple platforms but is barely past experimental elsewhere. Its feature set probably looks broad for how incompletely deployed it is.

                                1. 3

                                  I’m running OpenBSD on a 2004 Centrino single core laptop (haven’t updated in a year or so) and it’s… ok. You can work with it if you have patience, but using Chrome is a little tedious. This is a good data point, I think a dualcore CPU adds that little bit of power that makes you able to work in a relatively normal way (it’s not the 400MHz).

                                  1. 3

                                    I have FreeBSD 10 on a laptop from around 2001. It’s old enough to have a real serial port and I leave it in my cellar for when I need to get a serial console onto my NAS to fix things. It’s actually the only laptop I own myself and got somewhat more use until not so long ago when my employer was forced to provide me with one for home working during lockdown. It has no USB ports and the CD drive seems to have broken now so I fear any further upgrade attempts may break it beyond repair. Might have swapped it to NetBSD otherwise.

                                    1. 2

                                      I’ve used Debian on Thinkpad 760ED and a 760XD, both from around 1997 until a few years ago.

                                      I used the 760ED for quite some years from around 2000 until 2006 or 2007 or so when I bought my first new Thinkpad a T61 (which died several times—IIRC once on warranty—due to an overheating NVidia GPU).

                                      The 760XD was a “performance” on the Vintage Computing Festival Europe a few years ago: A fresh install of a back then current Debian release on a laptop from the 90s. Starting with Debian 3.0 Woody because it was the last release which was installable from floppies, and then dist-upgrading several times until IIRC Debian 8 Jessie.

                                      Unfortunately Debian kicked out Pentium 1 support with the release of Debian 9 Stretch, so the last Debian I upgraded them to was Debian 8 Jessie. See also this Retro Computing Stack Exchange question of mine from back then.

                                      Those two laptops still exist and I should probably apply security updates once before Jessie ELTS finally goes EoL. Probably a nice holidays side project.

                                      Oh, and a funny coincidence: I know Matto (the author of the linked article) personally. Well, actually not so a big coincidence. We’re both into retro computing for quite a while. :-)

                                      1. 2

                                        Yeah Debian is my default so I was deliberately looking to run something different to play around on that machine. When I did this first a few years ago, a few distros had already stopped supporting 32 bit processors and it’s already gotten worse.

                                    1. 1

                                      I use dunst which is also fairly minimal but in general I prefer to have as few as possible. Notifications for things like incoming e-mail just prevent me from getting work done so I don’t have them.

                                      1. 3

                                        Didn’t know about dtach; having fewer features makes it rather suited to this use case. Along vaguely similar lines, there’s also reptyr which uses ptrace to change the tty of an existing process.

                                        At some point, I tried to configure things so irssi would use my VPN for connections - /whois provides too much information - but Freenode appeared to reject the connection.

                                        1. 11

                                          The Wayland developers obviously had different goals in mind, but I think they dropped network-transparency too quickly, especially when we consider the ever-improving internet-connections that we have. In an ideal world, I could imagine sitting in the park with my laptop and transparently working on a demanding GUI-application that is running on my computer at home.

                                          Of course there’s waypipe and from what I’ve heard it works, however, transmitting buffer-state changes is very wasteful, given most GUI-applications are just simple deterministic constructs. Remote X is definitely not a shining star in regard to efficiency, either, but I imagine the following:

                                          Just like vector graphics (like SVG) can be really small compared to raster graphics, while infinite in resolution, one can imagine to have a similar approach to user interfaces (but hopefully not as bloated as SVG). In case you really need a dynamic canvas to draw on, you could do it (compared to ) at the cost of transmission size, but in most cases, you would be fine with the “vector-GUI” format.

                                          As I often like to criticize, the Wayland protocol is too “thin”. The motivation behind it was understandable, but it comes at huge costs, inconsistencies and bloat (especially in compositors and GUI-toolkit-libraries). Merely comparing to X, which is decades old, is a simple way to avoid discussing this major issue, in my opinion.

                                          1. 9

                                            This sounds like NeWS to me.

                                            1. 7

                                              I don’t totally disagree with the Wayland folks. We have a pretty good protocol for remote display with a stateful display server: the web. Particularly as so many things are using Electron and so on, proxying to the remote display at the DOM / JavaScript layer may make more sense.

                                              I’d really like to see a windowing system designed around that model. Take a minimum amount of DOM or standard statefule widgets + WebAssembly + WebGPU and so on that’s required and implement that as both a lightweight bare-metal thing and a thing that runs in a web browser. Provide a display system that runs view objects on the display server with their logic in a Wasm sandbox, a model where the display can be disconnected and reconnected, and any application can run either locally, remotely in a remote instance of the display server, and remotely in a web browser.

                                              1. 1

                                                I’m legitimately surprised no one’s tried to cut the Gordian knot with this already. You’d think Google would have gone for this.

                                              2. 2

                                                Remote X is just really simple and convenient to use, especially for the type of advanced user that has a terminal/ssh-centric workflow and wants to display individual windows. X was designed with a socket transport in the first place so using a network pipe essentially came for free. For Wayland any remote solution is and will be an afterthought. This has been a big mistake in terms of gaining acceptance because Wayland doesn’t really offer any other great practical rather than theoretical advantages. It’s supposed to be more resource efficient but was far from it when I compared by i3 setup against an equivalent one using sway.

                                                Remote X has never been great over slow networks. I find VNC to barely be usable when home working and never considered trying X. I mostly rely on ssh and vim/netrc’s ability to open files over ssh.

                                                1. 2

                                                  I’d be surprised if things like drag and drop actually work there. With X, it is kinda cool when you have two applications open on separate computers yet you can copy/paste, drag+drop, and all that between them without even thinking about it (at least not if the programs are well written).

                                                  Many remote desktop kind of things do at least some clipboard integration too, but in X it actually just works (and stuff like the Windows X server does clipboard integration with Windows programs too, but not drag and drop between them). Wayland saying “ipc belongs elsewhere” means it is unlikely to work well there either.

                                                2. 2

                                                  especially when we consider the ever-improving internet-connections that we have

                                                  Network latency hasn’t really gotten better in a long time, and I’m pretty sure that’s what’s limiting X remoting. In fact, I’m on a fairly decent DSL connection, with about 24 megabits per second download speed, and I get noticeable typing jitter when I use plain text SSH to interact with EC2 nodes. LTE was even worse, last time I tried it.

                                                  So making it smaller won’t help nearly as much as using a form-application-like model.

                                                  1. 2

                                                    So making it smaller won’t help nearly as much as using a form-application-like model.

                                                    Bring back block terminals!

                                                1. 1

                                                  I’m not convinced that allowing password logins is really that bad anyway. Any machine I put on the Internet would have something like blacklistd, fail2ban or sshguard. The trouble with keys is they’re only as secure as the system you store them on. If I left an ssh key at work to provide access to my home system, a colleague would be able to brute force the passphrase as fast as his machine could calculate them. Hammering and ssh daemon is going to be a lot slower than that and may not go unnoticed. In the blog authors case, this is presumably a laptop so they’d be actively using it while the attack takes place.

                                                  1. 10

                                                    I’m not convinced that allowing password logins is really that bad anyway.

                                                    Most mac laptops (like the author was mentioning) won’t have blacklistd, fail2ban or sshguard. And when they connect to a LAN, they will, in their default configuration, advertise the availability of their ssh service over multicast DNS as soon as they are on the network. This includes potentially hostile wifi hotspots. (Though responsibly operated ones don’t let clients see each other, you’d possibly be surprised by how often you can connect to other machines on the same WLAN.)

                                                    And if a key is only as secure as the system you store them on, the password is only as secure as the system you type it into. You really shouldn’t log in at all from systems you don’t trust. But if you’re going to, store your ssh key on a hardware token so that the untrustworthy system can only attack you while the token is physically there :)

                                                    1. 2

                                                      This really only should affect intermediate to advanced mac users, as sshd is not activated by default.

                                                    2. 3

                                                      Most of my personal machines have a fairly weak password because they’re only supposed to protect from someone physically typing a password into my machine. My laptop isn’t running blacklistd, fail2ban or sshguard. I sometimes bring my laptop to things like coffee shops, universities, friends, work, airports (well I used to…), and other places where I connect it to a LAN with people outside of my immediate family. I would really like it if random people on the LAN couldn’t try to brute force my password remotely.

                                                      1. 1

                                                        protect from someone physically typing a password into my machine

                                                        then you shouldn’t turn sshd on.

                                                        1. 2

                                                          Why not? If it’s configured to not accept password auth, as it should, it poses no extra risks regardless of my account’s password.

                                                      2. 0

                                                        If I left an ssh key at work to provide access to my home system

                                                        My initial questions would be: why do that, and if you have a really good reason, why not do it using a hardware key you take away with you?

                                                        1. 1

                                                          Because it is often useful to be able to get to personal e-mail and my own files while at work. For as long as I’ve had always-on-Internet at home I’ve simply got used to doing that. Many things like config files and general notes can be git cloned over ssh so it is simply really convenient.

                                                          I’m sure it’s still more secure than most people’s habit of having their work browser left logged in to their gmail, facebook and whatever accounts. I should probably think about the hardware key idea but there is always a danger of forgetting it.

                                                      1. 18

                                                        Does anyone actually enjoy coding interviews? I’ve only been on the receiving end. Between anxiety and social phobia and feeling threatened by strangers, I’m in fight-or-flight mode, with the rational part of my brain shutting down. What’s funny is that I can do public speaking quite effectively, because I can prepare for it. In other words, switch on the autopilot and let my programming take over (no pun intended).

                                                        1. 13

                                                          Yes! But, I am a white male with a lot of experience, so I am not worried about a lack of opportunity if I screw up.

                                                          For me, the only prep I do for interviews is to read one or two good articles to get my mind in tech land, and go in cold, otherwise. I draw upon my experiences to recognize problems and have an honest conversation, share my thoughts, keep an open dialogue, ask questions, etc.

                                                          I enjoy the random set of challenges being thrown at me. I have been passed on at some FAANG companies, but I have had a very successful and fulfilling career working with amazing people, on impactful products, so… for me this strategy has worked out very well! And, I’ve never come out of an interview without learning something new.

                                                          1. 8

                                                            I like to interview semi-regularly – at least once every 1.5 years. I enjoy doing this for several reasons:

                                                            • It’s a low-risk way for me to see what companies in my area really want to hire for. Lots of places in my area want .NET experience, so when I wanted to play around with a ML-esque language I picked F# so I can kill two birds with one stone.
                                                            • It’s a great way to build my network. I live in an area with perhaps a few dozen major tech companies, and by interviewing around I’ve met a lot of the hiring managers. I know who I’d like to work for and who to avoid. And I’ve received a few direct references this way as well.
                                                            • I’ve made the mistake before of waiting too long at a job that is starting to go bad. Interviewing often is a good motivator for me to leave.
                                                            • The fastest way to beat impostor syndrome and to worry about interviewing is to get a job offer ;)

                                                            But when I treat interviews like this, there’s zero stress for me: my interviews are just like yours, a nice conversation, open dialogue about problems I’ve solved and problems the business faces, and generally easy and comfortable.

                                                            E: Because apg pointed it out, and I think it matters: I definitely have the same privilege he does, which changes my perspective, and when I’m on the other side of the table and evaluating candidates I consistently try to make that count less. One tip I got: I often get to review resumes to decide who to ask for a phone screen, and I’ve asked the internal recruiters I work with to send me resumes with no identifying information. I don’t know how it changes my recommendations, but it’s one more avenue that keeps any implicit bias from slipping in, so I suspect it’s worthwhile.

                                                            1. 3

                                                              I don’t do biographical interviews anymore, and so I don’t even look at the person’s resume at all, until after I’ve submitted my evaluation. The interview feedback my company uses is based on our principles and each interview attempts to evaluate the candidate against a set of them. I’ve not been here long enough to have strong opinions on it yet. So far, I’ve enjoyed the attempts the framework makes to be unbiased, and feel that decisions have been fairly obvious as a result.

                                                              The interview I’ve been doing is a systems design thing, so technical, but not coding.

                                                              1. 1

                                                                I’ve been trying to steer the ship away from the “resume -> phone screen -> broader phone screen -> in person” pipeline for a while, but it is fairly ingrained.

                                                                The interview feedback my company uses is based on our principles and each interview attempts to evaluate the candidate against a set of them

                                                                Could you share some examples on this? I suspect I’m about to be on another round of interviews and am curious how this works.

                                                                1. 5

                                                                  Principles – each of the interviews has a set of these that can be evaluated. Sometimes the interviews overlap in these principles, which is fine. The interview feedback I fill out has specific questions related to the interview, with a big focus on the principles.

                                                            2. 6

                                                              I appreciate your perspective and willingness to point out that it’s considerably easier as a white male.

                                                              1. 4

                                                                I’m not convinced that being a white male helps, though that may depend where you are. At my place of work they have quotas with the effect that women get places more easily.

                                                                I enjoy coding interviews to a large extent but it is always a major relief when they’re over. And I’m never fully relaxed in any kind of interview. I do very extensive preparation. My mind tends to go blank when asked for examples from my past experience. And, I’m probably not very good at interviews because in 25 years I’ve only ever landed one job offer after an interview. That’s included two rejections from FAANG companies. So by my example, being a white male with lots of experience is not enough on its own. Only time I’ve changed jobs it was to a competitor where they already new me well from working with me for the same client - and that didn’t last long because my original company bought them.

                                                                1. 8

                                                                  I’m not convinced that being a white male helps, though that may depend where you are. At my place of work they have quotas with the effect that women get places more easily.

                                                                  Hmm. This reads to me as if you don’t believe that white male privilege exists, and instead of responding with ways in which I’ve benefited over the years, I’ll ask you to see if any of these 160 things happen to apply to your situation, especially the work place section? I get that the name of this website may sound pretty scary, but I hope you can look past any potential bias there and give it a fair read.

                                                                  Fun story from my past: I once worked for a company that announced a new diversity and inclusion “council” which was literally comprised of 3-4 Director level folks, 2-3 senior managers, all of which were white and male. I wish I could say that I had trust in this initiative, but needles to say that it was adjusted after some of us raised very publicly that this seemed like a questionable choice.

                                                                  1. 4

                                                                    Try not to worry about whether or not the deck is stacked against you (some folks will insist it is, many will insist it isn’t, some will try to gaslight you about your own experiences either way); there are probably easier wins (resume polishing, practice being interviewed and general social anxiety defusing tricks, better negotiation techniques, and so forth) than worrying about things you can’t control. Good luck to you!

                                                                    1. 3

                                                                      It’s natural that loss of privilege can feel like oppression. I try to take comfort from knowing that many other peoples’ real oppression is really being diminished.

                                                                  2. 4

                                                                    I really enjoy coding interviews. I like high pressure/challenging scenarios, it’s a situation where preparedness pays off and I am a very social person. It’s also a great opportunity to learn more about how other people do their business, and how they interview people. Getting interviewed makes me a better interviewer.

                                                                    1. 4

                                                                      I don’t mind coding interviews as such, but I do mind the kind where you’re expected to spend a lot of time on them (especially the “homework” ones).

                                                                      1. 3

                                                                        Yes. I love coding interviews. This is an employee market, if I fail, l’ll interview somewhere else. Companies should be more worried about their false negative rate and the time they waste interviewing people, but they don’t… Their loss. To make a moneyball analogy: there are a lot of undervalued players on the market.

                                                                        I’ve been on both sides. And I considerably prefer the interviewee side, I rarely learned something or been challenged/amazed on the interviewer side.

                                                                        For context, I am as privileged as /u/apg, YMMV.

                                                                        1. 2

                                                                          Yes, I do. Rather, I like the effect they have on job hunting as a whole. I don’t think it’s ever been easier to increase your income than before since you can prove your skills in a few hours. Solve some problems, get a bump in comp or move over to another company with a different wlb. The true interview is the first 3 months working with people, not the first few hours spent locked in a single room with them.

                                                                          1. 2

                                                                            There are people who enjoy, but this question may apply to any kind of interview. Most people don’t enjoy at all any type of interview. It does not matter if you are a software developer, a pilot or a teacher, it is not a situation we are used to be and when we are not able to show our best, we feel sad.

                                                                            On the other hand, I see a lot of complaints on the coding interview with regards to white board interview and questions. What I see on those complaints is that people actually do not propose a real solution to it, just pure complaints.

                                                                            I made more than 130+ interviews during the last 3 years as an interviewer. During my interviews I never focus on the code the person writes, but if I can work with the person. I look for values such as: the person makes questions, can we communicate properly, can we have work together on a programming challenge. What I find wrong is to ask something very specific like RBT and expect to implement and remember it: this is super specific and does not tell you if you will succeed in the position.

                                                                            For me interviewing its more about does this person match the team and knows how to work in team/pair.

                                                                            1. 1

                                                                              I don’t mind them as much now that I learned how to do them… its just a lot of effort. With that said… I’m also not that good at them. lol

                                                                              1. 1

                                                                                On the doing end, I basically have always said no to homework interviews (they’re usually open-ended but just really boring and seem time consuming). An exception has been one place that had interesting questions (sort of “Advent of Code”-style stuff, where it’s not algorithmic prowess, more just a bit of elbow grease and a fun result). For face-to-face stuff, it’s been usually pretty awful. The worst was doing a really simple algorithm problem on a board, and then having the interviewer try to press me on index math (my original solution involved some zipping and stuff and the guy was like “let’s stick to C-ish semantics”). Very frustrating stuff. I also messed up a “string reversal” exercise through my own fault (it was easy in theory!) I feel like it’s a good test of “can you solve advent of code stuff fast”.

                                                                                On the giving end, we have a vertical slice of a django application that we use for “full-stack”/backend roles. I think it’s been very effective. People pass with flying colors or fail entirely (we really try to make people pass because of all the stress etc involved, and try to reassure people that we are really not trying to ding anyone). And we try to have a lot of varied angles, so people can show off what they know. Again, we are trying to make people pass. Seeing people succeed is extremely gratifying and I’ve learned some stuff from watching people do it.

                                                                                We aren’t doing fancy algo stuff so we don’t talk about fancy algo stuff (unless candidate brings it up and it’s a fun conversation). We are a CRUD-y webapp with a bunch of legacy code, so we test CRUD-y webapp skills on an unknown codebase.

                                                                              1. 6

                                                                                I don’t know PHP but in many languages, I would refactor this to a table lookup, something like:

                                                                                   genders = [ 'male', 'female' ];
                                                                                   return genders[input] || 'unknown'
                                                                                

                                                                                Table lookups are often overlooked when considering how to implement something but they’re often much faster, cleaner and more succinct than alternatives.

                                                                                The out-of-range/error handling would vary greatly by language. Rust has .unwrap_or(), C would need an explicit if condition at which point this won’t look especially elegant. In many applications, the out-of-range condition would be an assertion or error rather than an “unknown” value. I appreciate that my comment is not really considering anything beyond the initial code snippet in the original article and is not applicable to the later parts.

                                                                                1. 1

                                                                                  For very small tables (IIRC <=8 or so, last time I tested it) these kind of lookups usually aren’t really faster vs. looping over an array/list, and 2 comparisons are faster still. I assume this is due to the overhead of hashing the keys.

                                                                                  Array lookups like your example would perform a bit better, but I wouldn’t be so sure if they’re faster than a simple ===.

                                                                                  Not that it really matters in >99.9% of the cases.

                                                                                  1. 2

                                                                                    Not faster: true. But clearer.

                                                                                    1. 3

                                                                                      Yeah, I agree. I would write it like the above as well actually, unless there’s a compelling reason not to. One of the nice things is that you get an iterable array (or map) of all values for free, which is often useful in various cases (like validation for example, or listing all options).

                                                                                1. 8

                                                                                  See also Irmin

                                                                                  1. 2

                                                                                    There’s also noms which has been around longer.

                                                                                    1. 2

                                                                                      Dolt uses noms internally, but it doesn’t seem like noms is a ready end-user product. Dolt is a UI layer and workflow for end-users on top of noms.

                                                                                  1. 1

                                                                                    I sometimes use sc-im (https://github.com/andmarti1424/sc-im) when I need something very basic like adding up some columns but usually get frustrated at having forgotten the necessary key combinations. I used 1-2-3 back in the day but don’t think I’d go to this level of effort. I miss WordPerfect more, especially the old reveal codes feature but am probably happier with vim and something like markdown or docbook. At least I don’t need a template above the function keys to use it.

                                                                                    1. 4

                                                                                      Nice to see unclutter getting a mention. I’ve used it for over a quarter century and I don’t think the code has really changed in all that time.

                                                                                      NUCs always seem a bit expensive for what they are. Not even where I work do they bother with wall-mounted displays for system monitoring though they do have some in kitchens for dull corporate news. We tried grafana and it all seemed a lot of effort for pretty but mostly meaningless graphs. icinga does the job we need.

                                                                                      1. 1

                                                                                        From the link, this doesn’t especially appear to check the DNS configuration. It just does a lookup. So nothing that dig and drill don’t already do well unless you like the ugly ASCII boxes. It’s also checking TLS certificate expiration on port 443. TLS is used on many other ports besides 443 and in general most proper monitoring systems will cover this. Or Let’s Encrypt will mail you if your renewal has failed and it gets late.