This is why I run everything possible in the browser. Discord, teams, zoom, outlook, etc. It also makes switching computers and operating systems a breeze. Not that I switch often, but I like to remain platform agnostic.
Browsers are a platform too
Discord runs Powershell on load to find Nvidia binaries
31–40 of 57 posts
Re: Discord runs Powershell on load to find Nvidia binaries
#32Re: Discord runs Powershell on load to find Nvidia binaries
#33For those who don't want to piece together things from twitter, the summary is this: Discord attempts to find nvidia-smi libraries by launching series of powershell scripts. Those scripts are really terrible with a lot of if-else logic based on hardcoded strings and environment variables. They are also apparently fairly slow and scan over 800 directories. Honestly, this is just yet another example of Discord not real…
Regarding the QR code vulnerability, how do you know if you are scanning a harmful QR code?
Re: Discord runs Powershell on load to find Nvidia binaries
#34Only the more experienced Windows app developers would get it right. How many of those are there in the world? How many are working at Discord?
Most likely some dev who was not a super Windows expert was assigned this task, and figured out how to do it using the tools that they already had the most familiarity with. In this case that was Powershell.
This is what most of us do every single time we code. We prioritize getting a solution that achieves the desired result, which this does. We prioritize getting it done quickly, which means using familiar tools instead of spending a bunch of time learning something new. We prioritize passing tests, which this probably does. Performance is not a priority at most places until it becomes so bad that it’s extremely noticeable. Discord on Windows is most often used on powerful gaming PCs that won’t notice this inefficiency.
That said, now that someone so kindly pointed out the issue, maybe Discord will fix it. Or maybe not. If it’s not a bugfix, or a new feature, or a security patch, why would they prioritize it?
Re: Discord runs Powershell on load to find Nvidia binaries
#35The linked tweet says nothing about Nvidia binaries, how was that determined?
It's below on the thread, see: https://threadreaderapp.com/thread/1824872498363523537.html Honesty I wished every HN post linking to Twitter was just changed to a threadreader link because otherwise only registered Twitter users can see the content being posted.
Re: Discord runs Powershell on load to find Nvidia binaries
#36I mean, what do you expect? If you took all the software engineers on this site and assigned them to develop that feature, how many would be able to do it better? I imagine most won’t be able to even begin without spending a lot of time studying the subject matter. I hardly know any Powershell at all, let alone the better more correct Windowsy way to do it. Only the more experienced Windows app developers would get i…
And that's the correct approach. Whenever I pick a task, I make sure I either know the matter in question or need to study it - in which case I inform my co-workers and especially the Tech Lead this needs to be taken into account.
Frankly, even if it was an internal piece of software used just by a few hundred/thousand people, I would be ashamed of doing it this way because I would be afraid it could have negative impact on my career in this organization.
Re: Discord runs Powershell on load to find Nvidia binaries
#37> this person has never programmed on windows in their lives https://nitter.poast.org/da_wamwoowam/status/182487490957266... How about some fucking empathy? Yes, maybe the dev isn't a windows expert, but I'd guess most devs aren't. Most people don't have the luxury of pulling in a specialist to do every little feature, nor the luxury to do a deep dive to figure the absolute correct way. Such is the reality of (commer…
Anyone attempting, or purporting to do this job should know this, and if they don't know this, then that very fact is the unforgivable thing.
I say this as someone who has barely programmed anything for windows. I managed to make a custom version of putty for work that replaced the registry for a text file for settings, and made it lauchable to make saved sessions portable. And I managed the amazing engineering feat of producing a .exe that wraps a twain scanner library. No ui, just a cli that copies argv to the library calls. And I wrote a powershell script that talks to a device over rs232.
Thats about it. More than my mom could do but all in all essentially nothing.
The criticism of this utter shit is not elitism.
When I first had that work project to hack on putty, at first I took a look just to see if I could figure it out. I immediatly decided I could not figure it out in any reasonable time.
So I tried to hire a freelancer to do it. Pay someone who actually does this, right?
You know what they did? For $3k usd in 2005 or so? They fucking called regedit. As in they executed the regedit exe in a system call to import a text reg file. The settings are still stored in the registry, and I already knew how to run regedit to export and import .reg files. I could have done that much by just wrapping my exe in a bat file that runs regedit before launching putty, and that would have been a better engineered result than putting it in a system call, because it would be more flexible since the bat could be modified infinitely later without recompiling.
They were working on c code that already had code examples in it for working with the registry directly, and for reading and writing files, and yet when they needed to read a file to load settings, they ran an external executable that reads a file and puts the contents into the registry.
And putty actually has a fairly modular settings module! The registry stuff isn't baked in all over the place. There is a single c file that does all of the settings storage and retrieval. You can essentially swap the whole file out with anything else.
Am I some supergenius just because I knew enough to not try to do a job I didn't know how to do?
Am I a supergenius just because I was able to at least read code even if I couldn't write it, enough to see what it was doing and that it was a shit way to get the outward appearance of what I asked for?
How come you aren't completely offended and scandalized by solutions like these? What code that I rely on are you writing right now?
We do indeed all have dirty underwear but this is not a case of "not an expert". That is inexcusably misrepresenting the essence of the criticism here.
Re: Discord runs Powershell on load to find Nvidia binaries
#38> this person has never programmed on windows in their lives https://nitter.poast.org/da_wamwoowam/status/182487490957266... How about some fucking empathy? Yes, maybe the dev isn't a windows expert, but I'd guess most devs aren't. Most people don't have the luxury of pulling in a specialist to do every little feature, nor the luxury to do a deep dive to figure the absolute correct way. Such is the reality of (commer…
Ok this particular piece of garbage software is not the crime of the century, and we all have dirty underwear, but there is nothing about this that deserves the tiniest bit of empathy. This is not an empathy situation. This is an atrocious job full stop. Anyone attempting, or purporting to do this job should know this, and if they don't know this, then that very fact is the unforgivable thing. I say this as someone w…
> THIS is why your software is slow. it's not "web tech" or "electron" or "JIT compilation" or any fucking sorting algorithm
> it's boneheaded _design decisions_ made to avoid doing things properly in packages with 1,600,000 weekly downloads.
> :DDDDDDDDDD this is why everyone hates nodejs developers
Yes, you can criticise a piece of software for doing something X way, but you don't have to shit on the people who made it in the process. Imagine being the person who implemented this waking up and seeing that.
Re: Discord runs Powershell on load to find Nvidia binaries
#39> this person has never programmed on windows in their lives https://nitter.poast.org/da_wamwoowam/status/182487490957266... How about some fucking empathy? Yes, maybe the dev isn't a windows expert, but I'd guess most devs aren't. Most people don't have the luxury of pulling in a specialist to do every little feature, nor the luxury to do a deep dive to figure the absolute correct way. Such is the reality of (commer…
But I would look up the right way to find the system installation if I were writing production code, or even personal-use code, that needed to know where it was. I also wouldn't walk the filesystem looking for a program I was relying on (and assuming filenames and installation locations, but evidently not with a definitive standard location in mind). If I had to do that, I would know there was something horribly wrong with my own design. Although I should probably already be clued into that if my chat program is having to fool with GPU arcana like that.
Either some programmer has put thousands of other people's reliability and resources at risk by intentionally taking on something they're unqualified for and don't have the time to do right... or some manager has pushed somebody into that position.
If you mean that the reality of commercial software is that it's written by half-qualified people under unreasonable time pressure, why should we have "empathy" for the people who make it that way?