Live data from Hacker News

Are software engineering “best practices” just developer preferences?

floverfelt.org

261–270 of 369 posts

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

#261
post #236

Earlier quoted context omitted.

Singletons come to mind as being a better alternative in languages that can do that sort of thing.

People also bash singletons, so you can't really win. You can get issues with a singleton being accessed for the first time from multiple threads at once, for example, so you end up with more than one instance being created or a situation where one thread triggers the creation and another accesses before it has been fully initialized, depending on the code.

If you expect that sort of thing to occur, then your get method should be synchronized to prevent it.

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

#263

Earlier quoted context omitted.

> somebody got flamed harshly when he mentioned using a global variable. Harsh bashing on global variables is such a dumb thing. Yes, they can be dangerous. Yes, many had problems due to using them. Yes, we should tell beginners to avoid globals. But there is no reason to ban them altogether. Experienced programmers should utilize them whenever it makes sense (instead of passing down a value of a local one to almost…

Global mutable variables are generally a bad idea because they have nonlocal side effects which are difficult to mitigate, like aliased mutable pointers but worse. Extra non-aliasing arguments and multiple return values are free of these issues, and a better tradeoff in almost all cases (unless you're sure you'll never run 2 instances of a system in the same address space, and you have specialized constraints possibl…

This is one of the reasons GNU Emacs will probably never be symmetrically multithreaded.

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

#264
The biggest issue I saw with "best practices" in my career is the failure to take into account who it claiming it to be a best practice, and in what context. I saw too many junior developers read a rando blog article, then get a non-technical / semi-technical manager excited about something that made their life easier, even though it was by no means a good practice for the context at hand. Or alternatively, believe some vendor carte blanche when they tell you their product somehow follows a best practice.

The overarching problem is that yes, there is software engineering going on in the world, but most organizations are not willing to do engineering. I don't blame the technical staff - they often have good intentions - but rather the typical business is not willing to pay the cost in time or money to do long-lasting engineering practices. This is one of the things not enough of us think about in our career choices - am I going to a place that practices fire drills or engineering?

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

#265
post #251
post #230

Earlier quoted context omitted.

That sounds like a beautiful example of letting perfect be the enemy of good. Just like your design choices have trade-offs, is it important to realize that there's a trade-off between finishing sooner and making a better solution. Diminishing returns are usually very much in play with analysis. (I would also challenge the notion that every situation has a different "best practice". That's just creating a solution. "…

You shouldn't take forever, but what I'm saying is a best practice emerges after doing however much due diligence. Maybe you spend an hour looking into it and that's it, but you should do your due diligence to vet what sort of approaches you can take to solve your particular problem as best you can, so you can make the best decision based on the evidence you've been able to find within however much time you are worki…

Most decisions don't require that much thought. They're low stakes and can easily be changed. To build on the professor's metaphor: don't spend a week in the library in it'll only save you a day.

If it's a bit more important, do a quick Google, but only break out Excel for the comparison tables if the decision is life-changing.

Honestly, the most important thing that professors don't teach and real life does is that sometimes the optimal thing to do is to not do the optimal thing.

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

#266
post #110

Eh, kinda. Calling something a "best practice" is basically an appeal to authority. It means, "this is the right way to do things, for reasons I don't have time to explain." There are times when that's appropriate. But really, "best" and "right" are highly situational. Any rule of thumb, even the most basic and uncontroversial, has a situation where it doesn't apply. I was part of a discussion on a mailing list years…

Sometimes "best practice" is not because we need to worship a standard, but we need to have a standard. If everyone does everything in a different manner, you wind up with a tower of babel and support becomes impossible.

I'm of the mindset where an organization needs to agree to specific principles that everyone adheres. Not dogmatically but pragmatically.

Having that shared "best practice" makes is easier to support other people code/system, allows people to get up to speed faster and as a bonus, allows you to make a blog post on Medium where you can call yourself a thought leader.

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

#267
"So what are these rituals for?"

"Some are purely ritual, but some are there so that we can guard this dimension from horrors that live within!"

"Uh, I guess we should at least do the latter?"

"Oh? You can tell the difference? That's great!"

-- Girl Genius

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

#268

Earlier quoted context omitted.

Genuine question. What is so important about the word "engineer" that people not licensed to practice it want to call themselves engineer? In Canada, I studied in a mechanical engineering technology program that lead to an engineering degree if you stayed on for 4 years. It was hammered into us that we weren't engineers until after you graduated and went through the professional licensing process. In Canada there is…

> So why is there so much resistance? Because, 1) a PE license is useless for software/computer engineering. 2) the FE exam covers a bunch of irrelevant material. 3) once you pass the FE exam, there's no real mechanism to advance because there are no apprenticeships available in computer engineering. And you can't take the PE exam without the apprenticeship. My college spent a lot of money getting an ABET accreditati…

> My college spent a lot of money getting an ABET accreditation for their CS/CE programs.

Why? Even here Stanford isn't even ABET and nobody seems to care.

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

#270

Earlier quoted context omitted.

But here's the thing: aren't most alternatives to global, some other kind of global state anyway, but possibly better managed?

Singletons come to mind as being a better alternative in languages that can do that sort of thing.

[deleted]
Post reply on HN