Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "fail-safe"
-
I've started writing Rust code for fun. My initial experience with it is that its like writing a program wearing a surgery mask and latex gloves with a condom around your keyboard, while you sit in a padded room with a nanny nagging over your shoulder.
The borrow checker is somewhat of a pain in the ass to deal with.
But that said, I've never been so safe and confident my code won't fail during runtime before.
And the best part: it's blazing fast.7 -
Thought I was getting a handle on this whole programming thing....started reading The Art of Computer Programming by Knuth....feel deeply ashamed of my knowledge (or lack of)...superiority complex increasing with every page.3
-
About 3 years ago, my girlfriend had this laptop that she got from her University. She had to give the laptop back to get reset, but didn't want to lose all of her data on it, and a backup would be around 750GB.
So I suggested that I would backup the laptop (was thinking to just dd an image and go from there). So I plugged in my mobile USB and external hard drive, and started the imaging process. Given the amount of data and setup, the process should have taken about 5hours. So we left it there for 5h.
Please be mindful that at this stage in my life I knew very little about boot processes, oses, and hardware.
5h after. The laptop screen is black and it ain't responsive. Not sure what happened, the dd process was completed, but the laptop refused to boot into windows. Tried a number of boot tools, and spent a crazy night hacking at the machine. But the university had some of sort of fail safe to not allow anyone to boot into windows if someone opened bios without entering a password. Whatever this was, I spent over 12h trying to either open mount the windows partition with a Ubuntu usb or mount the corrupt dd image on my laptop.
Long story short, after throwing at it a number of fixes. I was able to mount the image, copy out all of her personal data, and reinstall a new version of Windows on her laptop. The university didnt understand why the laptop was already reset. She still mentions this to me anytime I want to take a "custom approach" to software lol2 -
I want to explain to people like ostream (aka aviophille) why JS is a crap language. Because they apparently don't know (lol).
First I want to say that JS is fine for small things like gluing some parts togeter. Like, you know, the exact thing it was intended for when it was invented: scripting.
So why is it bad as a programming language for whole apps or projects?
No type checks (dynamic typing). This is typical for scripting languages and not neccesarily bad for such a language but it's certainly bad for a programming language.
"truthy" everything. It's bad for readability and it's dangerous because you can accidentaly make unwanted behavior.
The existence of == and ===. The rule for many real life JS projects is to always use === to be more safe.
In general: The correct thing should be the default thing. JS violates that.
Automatic semicolon insertion can cause funny surprises.
If semicolons aren't truly optional, then they should not be allowed to be omitted.
No enums. Do I need to say more?
No generics (of course, lol).
Fucked up implicit type conversions that violate the principle of least surprise (you know those from all the memes).
No integer data types (only floating point). BigInt obviously doesn't count.
No value types and no real concept for immutability. "Const" doesn't count because it only makes the reference immutale (see lack of value types). "Freeze" doesn't count since it's a runtime enforcement and therefore pretty useless.
No algebraic types. That one can be forgiven though, because it's only common in the most modern languages.
The need for null AND undefined.
No concept of non-nullability (values that can not be null).
JS embraces the "fail silently" approach, which means that many bugs remain unnoticed and will be a PITA to find and debug.
Some of the problems can and have been adressed with TypeScript, but most of them are unfixable because it would break backward compatibility.
So JS is truly rotten at the core and can not be fixed in principle.
That doesn't mean that I also hate JS devs. I pity your poor souls for having to deal with this abomination of a language.
It's likely that I fogot to mention many other problems with JS, so feel free to extend the list in the comments :)
Marry Christmas!34 -
Shutting down Windows instead of putting it into sleep should not save state. It did, in my case.
I had Chrome opened before shutting down. It's still there.
This is very nice fail-safe method, I must say.11 -
My little brother started college this year. He hasn't decided what he wants to do, so he took classes in finance and computer science. During finals week, he comes to me ranting about GitHub. "It has to be the most useless tool ever made", he said.
His teachers made him use it without any explanation on HOW to use it. His whole team was working out of a single branch, downloading the zip every time, and struggling to fix merge conflicts. At no point was this ever corrected. This has been going on for an entire year!!!
Safe to say, I spent the afternoon walking him through more productive ways to use GitHub and showing him why it's not "the most useless tool ever made". I don't get why teachers for students to use tools but fail to ever explain how. All that is going to do is deter kids from using tools that could save them when they get a real job.6 -
I feel like writing or telling people about the time I jumped from Windows 7 Ultimate and jumping to Windows 10. (I'm not against 10, but I'm never updating after what had happened to me)
It all starts when none of my games will play due to a possible issue with my graphics card. I look up "3D source game bug" and not many results pop up. I go on Microsoft's Qna areas and ask this question but to my surprise nothing they say would make sense. "Clean the pins of your graphics card, make sure you verify the games on Steam". I verified the games and they checked out as perfectly fine. I don't have access to my graphics card because this is a laptop, sadly not a tower.
Two months pass and my computer is already showing signs of stress, like it didn't want to live in a sense. It was three times slower than when I was on Windows 7 and it was unallocating areas of my main hard drive where I could make virtual hard drives.
Instantly I start looking up Linux distros and find Linux Mint. 17.3 was the current version at the time. I downloaded it and burned it onto a DVD-rom and rebooted my computer. I loaded into the disc and to my surprise it seemed almost like Windows 7 apart from the Linux part. I grab my external hard drive and partition it to hold the Linux distro and leave it plugged in incase Windows 10 does actually fail.
On December 19, a few months after Windows 10 had released. I start my laptop to try and continue my studies in video game development. But to my surprise, Windows 10 had finally crashed permanently. The screen flickered blue and black, and an error box saying Loginui.exe failed to start. I look at it for a solid minute as my computer had just committed suicide in a sense.
I reboot thinking it would fix the error but it didn't. I couldn't log in anymore.
I force shutdown the laptop and turn it back on putting it into safe mode.
To my surprise loginui.exe works and I sign in. I look at my desktop, the space wallpaper I always admired, the sound files, screen shots I had saved.
I go into file explorer and grab everything out of my default hard drive Windows was installed on. Nothing but 400gb got left behind and that was mainly garbage prototypes I had made and Windows itself. I formatted my external hard drive and placed everything on it. Escaping Windows 10 with around 100GB of useful data I looked at the final shutdown button I would look at.
I click it and try to boot into normal Windows 10. But it doesn't work. It flickers and the error pops up once more.
I force it to shutdown and insert the previous Linux Mint disc I made and format the default hard drive through Linux. I was done. 10 gave me a lot of shit. Java wouldn't work, my games has a functional UI but no screen popped up except a black abyss and it wouldn't even let me try to update my graphics card, apparently my AMD Radeon 5450 was up to date at the AMD Radeon 5000's.
I installed Linux Mint and thinking the games would actually play I open steam and Launch Half-Life 2 to check if Linux would be nicer to me than Windows 10 had been.
To my surprise the game ran. The scene from Highway 17 popped on screen and the UI was fully functional. But it was playing at 10-15fps rather than the usual 60-70fps. Keep look at my drivers and see my graphics card isn't in use. I do some research and it turns out I have a Hybrid Laptop.
Intel HD Graphics and an AMD Radeon 5450 and it was using the Intel and not the AMD. Months of testing and attempts of getting the games to work at high frame rates pass and the Damn thing still functions at a low terrible fps. Finally I give up. I ask my mom for a Windows 7 disc and she says we can't afford it. A few months pass and I finally get a Windows 7 installation disc through money I've saved up. Proudly I put it into my optical disc drive and install it to my main hard drive deleting Linux completely. I announced to all my friends my computer was back in working order and I install everything I needed, Steam, Skype, Blender, and Unity as well as all my games. I test Half-Life 2 and it's running exceptionally smoothly, I test Minecraft at max settings and it's working beautifully. The computer was functioning properly once again and my life as a developer started as I modeled things and blender, learned beginners C# and learned a lot of Batch. Today the computer still runs at a great speed and I warn others of what happened to me after I installed Windows 10 to my machine if they are thinking of switching from 7 or 8 on an older machine.
Truly the damage to my data cannot be undone. But the memory of the maintenance, work, tests, all are a memory of how Windows 10 ruined me and every night before the one year anniversary of Windows 10's release, I took out the battery of my laptop and unplugged it from the a.c. power, just so Windows 10 doesn't show it's DLLs, batch scripts, vbs scripts, anything on my computer. But now, after this has happened and I have recovered, I now only have a story to tell5 -
Things that I learned today (15-07-20):
Suppose you have a hosted zone (both private and public) i.e. y.test.com. in AWS r53. and you created r53 DNS record in the public host zone sample1.y.test.com and if you will try to reach this DNS from ec2 you will not be able to. it will give you an error that DNS does not exist but out of ec2, it will work.
To make it work, you have to create the same record in a private hosted zone. Then only you can connect from within an EC2 instance.
So apparently EC2 always looks for the DNS for your registered name server in private hosted zone.
There should be a fail-safe, if it's not in the private hosted zone, it should look in public as well. (idk)
Maybe it was silly of me to not knowing this in the first place. ( wasted good amount of time)4 -
Learn git. Contribute to open source projects - you may learn more from code review on a single PR than from a whole tutorial. Ask questions constantly. Learn more git. Look for the cleanest solution to a problem. Write code that is easy to improve, easy to expand, and easy to debug. Learn even more git. Don't limit yourself to thinking only in terms of OOP, or functional, or procedural, or whatever type of programming you may be comfortable with. Don't be afraid to do some work by hand. Learn git, so that when all comes crashing down and your team crumbles to pieces, when your relationships fail and your friends disappear, when you're down on your luck and there truly is no hope left in life, you can check out of the dangerous world of your current HEAD and return to the home and comfort of your master branch, which you've kept safe, secure, and functional.