Live data from Hacker News

Tips for stable and portable software

begriffs.com

31–40 of 63 posts

Re: Tips for stable and portable software

#32

Seems like good advice. I'd add another one that seems completely obvious, but some sloppy developers ignore it: avoid undefined behaviour. If you're going to work with C, you need to know about undefined behaviour and take it seriously.

If it were so easy, there would be already specified a subset of C without undefined behavior and you could be able to automatically check your code against it.

Re: Tips for stable and portable software

#33
post #5

One day, maybe when I am retired, I am going to develop a programming language-agnostic algorithm specifying language with which you can generate code for programming languages ;-). A kind om Mathematica, but than for software.

> programming language-agnostic algorithm specifying language with which you can generate code for programming languages

That's just a programming language tailored for transpilation, no?

Theoretical computer science shows us there is no 'one true representation' for algorithms.

Re: Tips for stable and portable software

#34
post #32

Seems like good advice. I'd add another one that seems completely obvious, but some sloppy developers ignore it: avoid undefined behaviour. If you're going to work with C, you need to know about undefined behaviour and take it seriously.

If it were so easy, there would be already specified a subset of C without undefined behavior and you could be able to automatically check your code against it.

You could follow NASA standards. They've got a pretty good record with c. But it'll cost you.

Re: Tips for stable and portable software

#35

Really weird that he recommends Motif. Motif is not comparable to Web/Gtk/Qt since it has only the most primitive widgets, and no 3D support. I would propose doing a web-app if you really care so much about compatibility. Web also allows for more custom widgets.

So now you have to support all browsers : Firefox, Safari, Chrome and Edge. Plus some old stuff because this customer still has a Centos 4 Workstation running and another has a few Windows XP PCs that are mission critical.

I don't know if Motif is better at that, but I wouldn't bet on web-apps personally.

Re: Tips for stable and portable software

#36

Earlier quoted context omitted.

> I'm betting on the tooling to stay backwards compatible or with minimal changes in the codebase This is actually why I'm pretty bullish on things like RoR, Laravel, et al. The sheer speed at which they go to a new version that breaks BC is actively making the web less secure. I've lost count of how many times I've found a new client with this software that's been working for years but suddenly broke, only to realiz…

The same reason why my default stack is still Java/Kotlin with Spring and Hibernate. A stable environment, stable runtime that is guaranteed to not change too much and has a culture of backwards compatibility.

How are you liking Java with all the versions that are dropping. Are you still on 8? Correto? Or are you keeping up? and do you see the value in the features that are dropping.

Re: Tips for stable and portable software

#37

I'm currently "betting" on Go for making a back-end (just a REST API + sqlite database) that will last a decade; I'm betting on the tooling to stay backwards compatible or with minimal changes in the codebase; I'm betting on the readability of my own code for the next decade, and I'm betting on the language + tools to continue to be developed whilst sticking to their original goals. Generics is going to be fun.

I can't tell if you want generics or not? I've been thinking about the topic for a while and sort of think Go doesn't need em. It's less a technical reason but more a cultural reason. The language shipped without them as a feature. So why deprecate that feature and make lite-version of Java/C#.

Re: Tips for stable and portable software

#38
post #32

Seems like good advice. I'd add another one that seems completely obvious, but some sloppy developers ignore it: avoid undefined behaviour. If you're going to work with C, you need to know about undefined behaviour and take it seriously.

If it were so easy, there would be already specified a subset of C without undefined behavior and you could be able to automatically check your code against it.

My point was only that C programmers should be keenly aware of the pitfalls of undefined behaviour, rather than blithely ignoring it. I've been surprised by the sloppiness of some developers on this point.

> a subset of C without undefined behavior

There are various projects out there that let you produce C code guaranteed to be free of undefined behaviour, but they're not 'quick fix' solutions, so they're not widely used.

https://www.eschertech.com/products/

https://github.com/zetzit/zz

https://blog.regehr.org/archives/1069 (ctrl-f for actually)

Re: Tips for stable and portable software

#39

I'm currently "betting" on Go for making a back-end (just a REST API + sqlite database) that will last a decade; I'm betting on the tooling to stay backwards compatible or with minimal changes in the codebase; I'm betting on the readability of my own code for the next decade, and I'm betting on the language + tools to continue to be developed whilst sticking to their original goals. Generics is going to be fun.

> I'm betting on the tooling to stay backwards compatible or with minimal changes in the codebase This is actually why I'm pretty bullish on things like RoR, Laravel, et al. The sheer speed at which they go to a new version that breaks BC is actively making the web less secure. I've lost count of how many times I've found a new client with this software that's been working for years but suddenly broke, only to realiz…

> This is actually why I'm pretty bullish on things like RoR, Laravel, et al.

Do you mean bearish? I think you do as I was confused for about half of your comment before I realised

Re: Tips for stable and portable software

#40
post #34
post #32

Earlier quoted context omitted.

If it were so easy, there would be already specified a subset of C without undefined behavior and you could be able to automatically check your code against it.

You could follow NASA standards. They've got a pretty good record with c. But it'll cost you.

Link: https://web.archive.org/web/20190213011655/http://homepages....

Alternatively, NASA host an uglier scan of the document at https://ntrs.nasa.gov/citations/19950022400

Post reply on HN