> Don't fight the tools: libraries, language, platform, etc. That means you'll always be stuck doing things using existing paradigms. Which is fine if you're only developing an application, but not fine if you want to effect more fundamental change. > Never start coding (making a solution) unless you fully understand the problem Sometimes, I cannot understand the problem until I've started coding. > Tech debt is like…
My guiding principles after 20 years of programming (2020)
71–80 of 193 posts
Re: My guiding principles after 20 years of programming (2020)
#72> Any function that’s not pure should be a class. Any code construct that has a different function, should have a different name. I definitely haven't been following this... anybody else using nearly 99% of functions in their frontend work? (Typically I'm in the React TypeScript world)
I’m from the same world as you and here’s how I understood this: Any function that’s not pure should be a ~class~ component. ie, when you have a bunch of functions that operate on the same kind of struct/set of state, and in fact you want to prevent other functions from messing with it (you want to make it internal), you group them in some way. The OO word for that is a class. React is a component; which are much mor…
Over the past few years, at least on the frontend, I've found in every case what is a class could be expressed in a function or variety of functions. So yeah, still unsure about this point, maybe it was more for other software domains (backend, embedded, etc)
Funny too about what you say about 'grouping functions in some way'... I just made a post about how it makes a lot of sense to put a single function per file... with my organizing, a named folder is the only thing that 'groups' my functions together... so far this style of organization is working well for us.
https://chrisfrewin.medium.com/advanced-code-organization-pa...
Re: My guiding principles after 20 years of programming (2020)
#73Every one of these is covered by lessons that OP didn’t have to learn themselves if they had just paid attention to the guidance available from luminaries in the field.
This leads me to the one lesson I’d give instead; let other people do your work for you, whenever you can. #13 on this list is far too strict, you’ll spend your days maintaining commodity code and discovering for yourself all the pitfalls someone else could have just solved for you.
If you’re looking for the definitive version of this, definitely check out The Pragmatic Programmer.
Re: My guiding principles after 20 years of programming (2020)
#74Your product might still work if it has a second of lag after every operation, but I won't want to use it. And if there aren't any decent alternatives, I am going to experience irritation and sadness on a continuous basis.
Jonathan Blow said[0] (5 minute interview) that software authors have an ethical responsibility towards their users. How many people use YouTube, or Windows? The time wasted might be small on an individual scale, say a minute a day, but multiply it by a billion people (eg. YouTube or Windows) and that's 16 million man-hours per year.
I'd argue the same responsibility exists just as strongly even if you have one user! Do you want to frustrate her, constantly waste her time? Of course not! She is not going to be very happy with you if you do that :)
[0] Jonathan Blow on Success and Ethics in Software Development https://youtube.com/watch?v=k8gIJOy0c2g
Re: My guiding principles after 20 years of programming (2020)
#75My big tip, always change the problem to fit the resources you have. If the problem is hard, don't solve it, change the problem.
Here’s a fun little story that’s stuck with me for years because it demonstrates this in a very hacker way. (Forgive the lack of specificities, I tell this as a parable) A fancy new office tower was opening downtown. Around this time, office space was at a premium so they soon sold out all their floorspace, and the project was considered quite successful except for one small problem; the architect seems to have insta…
Re: My guiding principles after 20 years of programming (2020)
#76Here's one more from me: count your liabilities. 1. Code is a liability. No code? No bugs. The best commit is one that removes unnecessary code. This includes dependencies. 2. State is a liability. Multipliers for: hidden or non-obvious state, shared state, externally (by actors you don't control) accessible state, concurrently accessed/mutated state. Often the worst offenders are environment settings/configuration,…
I would much prefer shuffling them in that case. Less expensive and reduces the size of the public API. (Returning items in a specific order, whichever it is, still is a sort of promise.)
Re: My guiding principles after 20 years of programming (2020)
#77Man i still remember when it felt like a new js framework was coming out every day
Re: My guiding principles after 20 years of programming (2020)
#78Earlier quoted context omitted.
This is why a good IDE is so important. Since I use Jetbrains products (Rider, PhpStorm) I don't worry about refactoring anymore. This results in a very agile way of working. I believe people underestimate the power of a good IDE.
> I believe people underestimate the power of a good IDE. Definitely. And in some parts of the tech world, people actually deride the usage of an IDE! "If you're not using vim you're a newb," kinda deal. Which, sure, vim is great! And you can get a lot of decent plugins that can make that workable. But gosh IDEs provide so much powerful functionality, why would you make your life harder on purpose by not using them.…
I share the sentiment, but for completely other reasons.
Human mind is very limited - it can only hold so much complexity at once before it starts making mistakes and oversights. IDE's raise that bar of tolerable complexity, making it easier for people to build enterprise-level Rube Goldberg's machines just to keep the software working.
Using Vim (or any other non-IDE editor) forces me to keep the software simple, because otherwise I can't understand it. And in my experience, keeping software simple (long term) is much more important than keeping software working (short term).
Of course, sometimes we have no choice but to meet the deadline. That's where all those bells and whistles really come in handy.
Re: My guiding principles after 20 years of programming (2020)
#79> Never start coding (making a solution) unless you fully understand the problem. While I agree with this in general, I find that to reall fully understand a problem, I need to attempt to code, or at least formulate, a solution to it. a) because when I break down a problem into its code-able component parts, I learn a lot about it b) because in the process of then actually implementing these parts I often discover ed…
Completely agree! This is my number 1 point on my own "I've developed SW for decades, here's what I have learnt"-post: 1. Start small, then extend. Whether creating a new system, or adding a feature to an existing system, I always start by making a very simple version with almost none of the required functionality. Then I extend the solution step by step, until it does what it is supposed to. I have never been able t…
Re: My guiding principles after 20 years of programming (2020)
#80> Don’t attach your identity to your code
Others in your team will. Example here is a craftsman taking pride in their work. Think about that the next time you are reviewing someone elses work.
> Security > Reliability > Usability (Accessibility & UX) > Maintainability > Simplicity (Developer experience/DX) > Brevity (code length) > Finance > Performance
Performance is last ? Code length is more important than performance? That's wrong. Also correctness is not mentioned at all surely that has to be in that list.
> Don’t use dependencies unless the cost of importing, maintaining, dealing with their edge cases/bugs and refactoring when they don’t satisfy the needs is significantly less than the code that you own.
https://en.wikipedia.org/wiki/Not_invented_here
It's impossible to determine the cost of using a lib using these metrics. I bet this person has had a problem with a dep a few years ago that caused a lot of emotional damage and the response is to never use 3rd party deps where possible. That's not a professional response to what happened it that's the case I'd hope most Staff Engineers don't have this attitude.
> Good code doesn’t need documentation
This is impractical at the end of the day you'll need to have something for the user to lookup for reference.
> Never start coding (making a solution) unless you fully understand the problem
Most devs don't get to decide this they will be told to do X by someone in a large org and given a brief description of why. Refusing to do your work until you fully understand a problem will lead to dismissal.
Some good stuff in there but also some problems.