Live data from Hacker News

Are software engineering “best practices” just developer preferences?

floverfelt.org

51–60 of 369 posts

Re: Are software engineering “best practices” just developer preferences?

#51
post #48
post #4

Steven Sinofsky gave a talk and said something to the effect of, we've been building roads, bridges and edifices for thousands of years. So, best practices and solved problems abound---and even then we still get it wrong sometimes. Whereas, software engineering is maybe 70 years old (generously)? So, there is much to learn and a lot of "baseline" knowledge that has yet to be established. I think it's a good way to th…

Furthermore, there are far fewer physical constraints in software, so the range of possible designs is dramatically wider. (Actually I dare say that sotware itself has no physical constraints at all: software artifacts and software executions do.)

Which is why I don't buy the "software has only been around for 70 years so give it time" argument. Software has nothing to be grounded in like other engineers do with physics. It's most likely always going to be endless cargo culting.

Re: Are software engineering “best practices” just developer preferences?

#53
> You can’t do it “correctly” if “correct” is “whatever the guy who’s been here longer wants.”

To be honest, "correctly" is whatever actually works. But since we as an industry haven't been around for a long time and don't collectively know what actually works, it is simply the case that we defer to those who have comparatively more experience, so that we may get decent solutions now, as opposed to excellent ones later.

It took the ancient civilizations hundreds if not thousands of years to perfect architecture to a reasonable degree, where it's possible to be fairly certain about the viability of most typical designs, as well as the tradeoffs that nonstandard ones might require.

Personally, i think that we'll only be able to talk about what truly works and what doesn't once the industry cools down - when there are new JS frameworks once a month or once a year as opposed to every day (or for any technology, really). When there are very few breaking framework changes, because the frameworks would finally be stable. When the primitives around doing web development, interfacing with devices and everything else have been distilled to their most usable possible forms. When a developer doesn't need 10 languages or 20 frameworks to do their job, but can instead rely upon a few, after most others would have died off after a sort of singularity of languages.

That's when useful certifications would be possible. That's when estimates wouldn't be guesswork. That's when the education systems could actually prepare people fully for working in the industry. That's when the development of projects wouldn't be such Wild West, but instead would be a process with far higher quality, a true engineering discipline even at the expense of projects taking longer to actually develop, much like you don't construct buildings in an ad hoc fashion.

Now, whether that will happen in a 100 years, a 1000 years or never, is another question entirely.

Re: Are software engineering “best practices” just developer preferences?

#54
post #4

Steven Sinofsky gave a talk and said something to the effect of, we've been building roads, bridges and edifices for thousands of years. So, best practices and solved problems abound---and even then we still get it wrong sometimes. Whereas, software engineering is maybe 70 years old (generously)? So, there is much to learn and a lot of "baseline" knowledge that has yet to be established. I think it's a good way to th…

Also, there isn't that much in the way of scientific grounding.

Mechanical engineering has physics as a foundation.

Chemical engineering has chemistry as a foundation.

What is the scientific foundation of software engineering?

I suspect it is a mix of cognitive science, linguistics, and anthropology.

Re: Are software engineering “best practices” just developer preferences?

#55
There's all kinds of non mission-critical software that gets made with little life/death consequence on how it gets made. There doesn't seem to be the same notion of the "bridge that barely stands" in software either since compute power can be thrown at something way cheaper than a rewrite. Thus, when it comes to the people that make software, there's a wild amount of interpretation on what "good" means and here we are.

And if I can opine on your Spring Boot example, unit testing can sometimes be easier for mock purposes if you have a set of interfaces (vs concrete classes) to work with.

Re: Are software engineering “best practices” just developer preferences?

#57
post #7

Having an interface for a single implementation is just redundant. A class already has an interface - it's public API. Other than that I agree, most "best practices" are subjective and boil down to personal preference.

Interfaces serve two roles:

1. They are (usually) concise specification/contract for the implementation to follow, and for the client to use.

2. They permit substitution.

These are, from my experience, the principle and most useful reasons to make use of "redundant" interface definitions. What's worse is when people want alternative implementations but only have a concrete instance, they subclass it and break all kinds of contracts making their square peg fit a round hole.

This is less useful when you have ducktyping and consequently every lookalike is considered substitutable for each other.

Re: Are software engineering “best practices” just developer preferences?

#58
All the problems stated require more context:

- extract an interface or not -> an interface can speed up compilation (under the right conditions)

- pass more or less arguments -> how many call sites exist? What’s the performance difference? Would it complicate testing?

- testing -> depends on what you’re building, when do you need it by, and how problematic a bug may be (and more)

The reason it looks like some random preference is because over time we naturally gravitate (or been told to do) what works, and we keep choosing it heuristically since a thorough analysis of the problem is too costly or impossible.

Civil engineering has a bunch of hard rules on have X slack here because people will die for such mistakes. But I suspect you use best practices for less high stake stuff (do we use this outlet configuration or this one?) (actual civil engineers are welcome to correct me)

Re: Are software engineering “best practices” just developer preferences?

#59
post #18

I hope at least that we're in a phase of the profession where we're "discovering" the actual best practices. There have been a lot of best practices that have been hypothesized over time: OOP, functional programming, unit testing, generative testing, formal analysis, strict typing, weak typing, etc. And all these as-of-yet unfounded hypotheses are important! You've got to have a theory of how something works before y…

We're definitely still figuring out what the best practices are. In my relatively short career as a software developer, we've already flipped back and forth between separation of concerns is important when it comes to views, styling, and logic. (Frontend dev)

Gone are the days when we threw together a php, html, and JavaScript in one file... wait, or is it?

Re: Are software engineering “best practices” just developer preferences?

#60
> How can Software Engineers call themselves engineers when there’s no rules, governing bodies, or anything to stipulate what true Software Engineering is?

We call ourselves software developers in Canada.

According to Canadian engineering[1]: The "practice of engineering" means any act of planning, designing, composing, evaluating, advising, reporting, directing or supervising, or managing any of the foregoing, that requires the application of engineering principles, and that concerns the safeguarding of life, health, property, economic interests, the public welfare, or the environment.

To be considered a work of engineering, then, that a piece of software (or a software-intensive system) must meet two conditions:

1. The development of the software has required “the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software.”

2. There is a reasonable expectation that failure or inappropriate functioning of the system would result in harm to life, health, property, economic interests, the public welfare, or the environment

[1] - https://engineerscanada.ca/news-and-events/news/when-softwar...

Post reply on HN