Live data from Hacker News

GNU Coding Standards: Writing Robust Programs

gnu.org

11–20 of 111 posts

Re: GNU Coding Standards: Writing Robust Programs

#11
post #6

Earlier quoted context omitted.

Old versions of sort: http://man.cat-v.org/unix_7th/1/sort Unix utilities in the old days weren't all that great. One example I've posted about here before is how mv would refuse to move files across filesystem boundaries (because it's not a 'move', it's a 'copy and delete', so you had to use cp and rm instead).

Thanks. > BUGS Very long lines are silently truncated. And didn't know that about `mv`, good to know.

It is a good practice to use cp + (verify) + rm instead of mv. Especially when the data is important.

Re: GNU Coding Standards: Writing Robust Programs

#12
post #3

> When you want to use a language that gets compiled and runs at high speed, the best language to use is C. C++ is ok too, but please don’t make heavy use of templates. So is Java, if you compile it. Back in the early days, this sentence was more like "When you want to use a language that gets compiled and runs at high speed, the best language to use is C." . So we switched from a path where all major desktop environ…

> So we switched from a path where all major desktop environments ... were adopting C++ to a surge in C programming, as FOSS adoption started to gain steam. So you say FLOSS is responsible that the late 90s/early 2000s C++ hype slowly died off? > trying to fix the security inconveniences caused by this manifesto. And you believe those projects chose C, solely because some random GNU document suggested they do? If tha…

In part yes.

Had GNU/Linux not taken off, in the alternative universe from Windows, BeOS, Mac OS, OS/2, commercial UNIX (remember Motif++ and CORBA?) would kept writing the software in C++, instead of caring about creating FOSS stuff in C.

GNOME vs KDE is a good example of that schism and language wars.

Re: GNU Coding Standards: Writing Robust Programs

#13
post #3

> When you want to use a language that gets compiled and runs at high speed, the best language to use is C. C++ is ok too, but please don’t make heavy use of templates. So is Java, if you compile it. Back in the early days, this sentence was more like "When you want to use a language that gets compiled and runs at high speed, the best language to use is C." . So we switched from a path where all major desktop environ…

The average C++ code base has as many segfaults than the average C code base.

Windows has more exploits than Linux. But you know all that, so I wonder why you keep making these statements, which are then upvoted by the "memory-safe" crowd.

Re: GNU Coding Standards: Writing Robust Programs

#14
post #12

Earlier quoted context omitted.

> So we switched from a path where all major desktop environments ... were adopting C++ to a surge in C programming, as FOSS adoption started to gain steam. So you say FLOSS is responsible that the late 90s/early 2000s C++ hype slowly died off? > trying to fix the security inconveniences caused by this manifesto. And you believe those projects chose C, solely because some random GNU document suggested they do? If tha…

In part yes. Had GNU/Linux not taken off, in the alternative universe from Windows, BeOS, Mac OS, OS/2, commercial UNIX (remember Motif++ and CORBA?) would kept writing the software in C++, instead of caring about creating FOSS stuff in C. GNOME vs KDE is a good example of that schism and language wars.

Would you say that the predominance of C++ rather than C in FLOSS would have a net positive result?

Re: GNU Coding Standards: Writing Robust Programs

#15
post #13
post #3

> When you want to use a language that gets compiled and runs at high speed, the best language to use is C. C++ is ok too, but please don’t make heavy use of templates. So is Java, if you compile it. Back in the early days, this sentence was more like "When you want to use a language that gets compiled and runs at high speed, the best language to use is C." . So we switched from a path where all major desktop environ…

The average C++ code base has as many segfaults than the average C code base. Windows has more exploits than Linux. But you know all that, so I wonder why you keep making these statements, which are then upvoted by the "memory-safe" crowd.

> The average C++ code base has as many segfaults than the average C code base.

any source for that ? I find segfaults utterly rare in C++ >= 11

Re: GNU Coding Standards: Writing Robust Programs

#16
post #12

Earlier quoted context omitted.

> So we switched from a path where all major desktop environments ... were adopting C++ to a surge in C programming, as FOSS adoption started to gain steam. So you say FLOSS is responsible that the late 90s/early 2000s C++ hype slowly died off? > trying to fix the security inconveniences caused by this manifesto. And you believe those projects chose C, solely because some random GNU document suggested they do? If tha…

In part yes. Had GNU/Linux not taken off, in the alternative universe from Windows, BeOS, Mac OS, OS/2, commercial UNIX (remember Motif++ and CORBA?) would kept writing the software in C++, instead of caring about creating FOSS stuff in C. GNOME vs KDE is a good example of that schism and language wars.

All of those operating systems kernels were written in C (and ASM) not C++.

Re: GNU Coding Standards: Writing Robust Programs

#17
post #13

Earlier quoted context omitted.

The average C++ code base has as many segfaults than the average C code base. Windows has more exploits than Linux. But you know all that, so I wonder why you keep making these statements, which are then upvoted by the "memory-safe" crowd.

> The average C++ code base has as many segfaults than the average C code base. any source for that ? I find segfaults utterly rare in C++ >= 11

You were using C++ >= 11 in 90s/00s?

Re: GNU Coding Standards: Writing Robust Programs

#18
post #11
post #6

Earlier quoted context omitted.

Thanks. > BUGS Very long lines are silently truncated. And didn't know that about `mv`, good to know.

It is a good practice to use cp + (verify) + rm instead of mv. Especially when the data is important.

or rsync --remove-source-files

Re: GNU Coding Standards: Writing Robust Programs

#19
post #3

> When you want to use a language that gets compiled and runs at high speed, the best language to use is C. C++ is ok too, but please don’t make heavy use of templates. So is Java, if you compile it. Back in the early days, this sentence was more like "When you want to use a language that gets compiled and runs at high speed, the best language to use is C." . So we switched from a path where all major desktop environ…

C++ up to and including '98 spec was terrible from security perspective, not a iota better than plain C.

Re: GNU Coding Standards: Writing Robust Programs

#20
post #17

Earlier quoted context omitted.

> The average C++ code base has as many segfaults than the average C code base. any source for that ? I find segfaults utterly rare in C++ >= 11

You were using C++ >= 11 in 90s/00s?

I can't speak for the parent, but I've been using RAII and smart pointers in the 00s and it provided a lot of the benefits that got standardised with C++11.
Post reply on HN