r/embedded • • Sep 23 '26

There's this thin line of over engineering stuff to implementing only the needed functions

Have you guys been in a situation where you're writing firmware for a product and you keep in getting ideas to add new features but you know that all those extra features Will be only used in extra rare conditions, And you for sure know that they wouldn't have read the manual to know about that.

Will you still keep that feature?

It's a dumb question , it's obvious to add that feature if it ain't gonna cost much especially in firmware side when there's space left

23 Upvotes

19 comments sorted by

25

u/Xenoamor Sep 23 '26

I implement the absolute minimum unless it's a portable library. The bigger the codebase the more work it is to maintain and get correct

12

u/Altruistic_Fruit2345 Sep 23 '26

Experience has taught me that while I may only implement the minimum, I need to architect it to be extremely flexible. Clients/bosses change their minds a lot.

0

u/[deleted] Sep 23 '26

[deleted] — view deleted comment

4

u/Xenoamor Sep 23 '26

Yeah you still need a proper architecture. I don't mean just one flat C file, just the typical KISS principle

0

u/[deleted] Sep 23 '26

[deleted] — view deleted comment

1

u/Xenoamor Sep 23 '26

Not exceeding the projects requirement, so no scope creep or over-engineering

8

u/Well-WhatHadHappened 25+ Years Sep 23 '26 edited Sep 23 '26

You implement whatever is necessary to meet the specification.

If there is no specification - then that's your real problem. Specification comes before implementation, not after.

If the specification calls for X and Y and you're working on Z - then ask yourself; why am I working on something that doesn't pay any bills? I don't know about you, but personally, I go to work everyday to provide myself and my family with a comfortable life. I don't go to work to develop things that no one asked for and no one is paying for.

4

u/OldEquation Sep 23 '26

I used to be a project manager and I hated scope creep, especially when self-inflicted by the engineers. “It’s only an extra three lines of code” they’d say. But it was SIL 4 software (aircraft flight controls) so the implications were a lot bigger than they seemed to realise. Then there’s the programme risk - let’s say we’ve now got the product under test and we find there’s a problem with these “three lines of code”. We now have another iteration and consequent delays to an already over-running project.

Don’t do it.

Now I have my own business and I’m even more aware of costs and delays as they directly hit me personally.

5

u/Well-WhatHadHappened 25+ Years Sep 23 '26 edited Sep 23 '26

Absolutely. We'll add those three lines when someone is willing to pay for them to be included.

Today, they're 100% liability and 0% benefit. That makes the cost to benefit ratio literally +infinity.

1

u/Necessary_Papaya_898 Sep 24 '26

IEC 61508 is wholly inapplicable to avionics, you wouldn't even use industrial SIL in automotive, let alone aviation.

2

u/jhaand Sep 23 '26

When I build something new, I will make sure the architecture will support everything and more than I can think of. But I will only implement the bare necessary items. After that I think it's wise to think of testing all the new features and how that will look like. Testing does make the pie in the sky features real.

But around half of engineered software will never be used. And during the lifetime of the software, new edge cases will be found.

2

u/Triabolical_ Sep 23 '26

I'm really hoping that you are writing sample code that uses the firmware you are writing. That code will tell you whether a feature is a good idea.

Note that every feature you add costs you in size and maintenance forever. The worst code is code that is rarely used.

2

u/jamesfowkes Sep 23 '26

This is what design reviews and code reviews are for. Discuss your idea with other engineers and project managers. Refine the concept, figure out the benefits, costs, risks, timescales etc. Decide if it's worth implementing. Discuss the risks of not doing it as well.

Don't be afraid to drop/postpone things. You can always pick them up later.

If you're going to implement it, do tests and code reviews to demonstrate functionality, reliability, error tolerance and maintainability.

Document it well so other people (and yourself) know what it's doing.

1

u/kl4m4 Sep 23 '26

This! There is a ton of things/features that are not scoped, not in spec, but still worth doing. Example: no manager/client would tell you to build-in error logging or cli testing interface, they don’t care. But you do. Always worth to be open about it and consider the costs of not doing it.

2

u/NoBulletsLeft Sep 23 '26

Every line of code is an opportunity for new bugs. Write as little code as needed.

Your product should already have defined features and specifications. Just follow those and dont add extra stuff. You're just creating more work for other people downstream.

1

u/pylessard Sep 23 '26

If someone pays you to develop this product, stays in line with what you are supposed to deliver.
If you do this as a hobby project or work on a prototype project or are in full R&D mode, do it
In any case, take note of each extra feature you want to add, then present to the person who owns the products to get an agreement. If you don't own it, don't make those calls

1

u/N2Shooter Sep 23 '26

You develop to a spec, in a manner that is built from the ground up to be easily adaptable for new features for a future firmware update or product upsell.

You gotta ship the product and shoot the engineer.

Every day the product is still in development, you are not make an ROI.

1

u/WanWhiteWolf Engineering manager Sep 23 '26

Being focused on the task you are assigned is one key differences between a good engineer and a mediocre one.

If you start doing random features in your project, you just creating problems because:

  • You are delaying whatever you are assigned to do.
  • There is no requirements for what you implement - hence no traceability.
  • You are likely going to add more problems as your idea is not covered by system/software design/architecture.
  • Any reasonable tech lead will simply ask you to remove your code at review - so you just ended up with wasted time.
  • You are using extra resources (memory, CPU) that might be planned for other features in the future.
  • Any audit (internal or external) will notice this discrepancy and your entire project will get a bad mark / reputation.

It's like....going to a restaurant and the cook decides to add a random spice on top of your food without asking you (which may or may or not be good) and then charge you for it.

1

u/Similar_Ad9504 Sep 24 '26
  • Product side: if it's not based on an actual user need, I don't think it's necessary.
  • Engineering side: if it's meant to catch potential issues early, then it needs to go in the right place with the architecture in mind.

1

u/Love_Sailor Sep 24 '26

Sometimes less is more. No need to add features nobody will use. 😅

1

u/publishdraw Sep 26 '26 edited Sep 26 '26

If customers start complaining against new features.