safety-third
Joined 6 years ago
Joined 6 years ago
In addition, I design my programs such that I can confidently rewrite important sections. This is OOP encapsulation's main purpose. In practice, everyone writes getters and setters until every object is an ugly struct.
You deal with boilerplate using either interfaces or code generation. It's not as pleasant as first-class generics, but it's not completely awful either.
As someone who has worked with C and C++ for living for over 20 years, I wouldn't think twice about picking either Go or Rust if I were to start again. Go gives you the fast edit/compile/test loop of an interpreted language with the runtime speed of a compiled language. Rust is the language that the C++ Committee would make if they could start over.
That being said, Go will never take over the C, C++, and Rust niche. Going to and from Go-land and C-land is too expensive. Google has no interest in stepping behind libraries that aren't internet servers. Go will live a long life as a great environment to port your Python, Ruby, and other bloated server languages. It just will never be the next language to write a web browser.
Rust is amazing though. I see this as the programming language of the future until the U.S. Government slams down the hammer and forces everyone to use DOD-approved Ada.
An LSP violation of toString() would be something that returns a string that doesn't represent the object. If you were to return the current time as a string for an object that has nothing to do with time, that would be an LSP violation.
class Base {
virtual int size() { return size_; }
...
class Derived : public Base {
virtual int size() { return rand(); }
...
Here we see an issue. Derived is overriding Base's size method, which has a straightforward implementation, with something wild. If a Derived is sent to a method expecting Base-like behavior, something bad is going to happen.Derived should act like a Base with slightly different implementation details. This is all LSP is. It's a fancy phrase for a very simple concept.
Even when the case agents get access, policy dictates what evidence is allowed to be taken to a public trial. Otherwise you get repeats of the FBI/4chan/8chan debacle. This is especially true for legal "grey areas" like mass surveillance. This means that agents will often get evidence they won't use in order to guide active surveillance using more legal means in order to collect evidence they feel comfortable admitting in public court.
I work with software that has been continuously worked on since the 60's. It has the dreaded legacy if's like below everywhere.
if(obtuse variable) then
change a few other obtuse variables
There have been at least three attempts at major rewrites done of the software. The main goal was always to get rid of those corner case ifs everywhere. Every single attempt failed because we lost our ability to handle massive amounts of our customer's projects. Each of those ifs does something important.One of my main projects throughout my stay has been to reduce these with small, disciplined improvements. I have made major headway in this fashion. You have to find the leaves of your software and work your way up while rigorously testing your changes. This is the exact opposite of the human gut reaction of a massive top down rewrite. It's impossible to tell how far you are off-course until it's done. It's the waterfall method of refactoring.
They both focus on you projecting "good vibes" and only allowing others who also project good vibes around you. If you can do this, then (Nature/God/the Universe) will reward you.