That function isn't safe because it uses fgets(), and not because it uses a pointer. Duh.
Null terminated arrays (C style strings, in other words) are problematic to begin with, and fgets() and related functions just makes it worse by doing no bounds checking. But that is not a reason to avoid pointers, just a reason to avoid null terminated strings.
Using a pointer is NOT like juggling chainsaws. Don't be stupid.
If you allocate memory, you must free memory. It's as simple as that. If you're allocating so much memory that you can't manage it anymore, then of course, you shouldn't do it. But to suggest that no one should ever use a pointer is silly. Millions of C/C++ programmers do it successfully every day.
If your argument is that you shouldn't do it because you might do it wrong, then you need to apply the same logic to everything else. You might cause a race condition if you use threads, SO DON'T USE THREADS! In real life in fact, I find more race conditions in C code than I do memory related bugs. Java lets you use threads, so maybe you shouldn't use Java! Or what about the while loop? It's all too easy to create an infinite loop with the while statement. Too many programmers will write a loop without ever stopping to guarantee that the loop with exit. They shouldn't be allowed to do this! While we're at it, let's ban casts as well. And multiple inheritance. And exceptions. And everything else that might cause a bug. And to be safe, everything else as well.
Just to let everyone know, NetBSD has binary packages. You don't have to build everything from source. Unless, like the parent post, you decide you want to.
Correct. The hardest part about installing Linux/NetBSD/etc., is the dual booting. Windows users very very rarely do this, so they think it's a Linux problem. But it's actually harder to dual boot two Windows versions than it is dual booting Windows and Linux or BSD.
Sorry, but you're an ass. You've been fed a diet of shit so long you think it tastes good. Pointers aren't a problem, improper use of them is. Surprise! Improper use of ANYTHING is a problem!
Undisciplined use of pointers is going to cause bugs. But since undisciplined coding itself causes bugs, who the fsck cares? The solution isn't to ban pointers, but to start beating undisciplined coders over the head. I'm not saying you have to use pointers, but if you are avoiding them because of fear, it's time to learn how to use them properly.
Eat your pound of crow, take your foot out of your mouth, and listen to people who have been right.
You don't get it, do you? The "people who have been right" have been telling us for three decades that we have to radically change our lifestyles. These "people who have been right" have deliberately linked the issue with a particular political philosophy. We are told by the "people who have been right" that recycling toilet paper will save the planet.
It wasn't good enough for the "people who have been right" to alert us to a problem, instead they had to jam a particular ideological solution down our throats. No one ever told us that the climate was getting marginally warmer, instead we were told that unless we banned the internal combustion engine we would all bake to death by 1997.
Their chief concern was that we all had the correct attitude towards the environment. The conservation movement was mature, popular, and working. But it's attitude of "don't waste" wasn't the proper one, and so the environmentalists ridiculed conservation as not being good enough. So now we recycle not because it's frugal or pragmatic, but because it's the chief religious sacrament of environmentalism.
Not everyone in the environmental movement is a Birkenstock wearing neo-pagan somewhere to the left of Trotksy. Yet everyone else in the movement are content with them being their chief spokespeople.
Amen! My company used to be a Solaris house. Everyone had "smart clients", where the OS was local, but everything else, including home directories and applications, were remote. Having the OS local gave us the advantage of thin clients without the high bandwidth.
When a harddrive crashed on me, someone from IT spent five minutes swapping out the drive while I was at lunch. I never had any downtime beyond the phone call to report the problem. When we switched(*) to Windows, the same harddrive crash took a few days to recover from, including reinstalling the OS, reinstalling all applications, locating and restoring backup, and general user thrashing.
(*)How come switching away from Windows is too expensive to realistically consider, yet no one ever says anything when switching *to* Windows?
Microsoft makes more money when its software has a lot of security vulnerabilities
But only so long as people refuse to demand secure quality software. Microsoft isn't evil, it's only producing what the consumer is demanding.
People aren't demanding secure software. They may say they are, but their actions speak differently. They don't read their EULAs, don't firewall their systems, don't use good passwords, are indiscriminant in their browsing, are indiscriminant in providing personal information to anyone who asks, and according to all observation, only mildly annoyed at crashes, hangs, and malware. What they demand instead are new features, even if they're only superficial changes to the UI. Even otherwise savvy IT personnel exhibit these behaviors. As long as they're not alone in their insecurity people won't much care.
When people place so little value and security and quality, it shouldn't surprise anyone when Microsoft similarly devalues them.
He recalls one house he inspected that had 7 heated swimming pools joined together with hottubs. The owner would keep them heated year-round just in case a random party broke out. He also had 10 furnace and airconditioning units in his 35,000 sqft. house that I'm sure he ran the hell out of. He also had a 6 car garage, one spot for each of his SUVs.
So what? One isolated anecdote that way is NOT going to destroy the planet!
It's not that many people couldn't accept the premise that the climate is getting slightly warmer. If that's all it was there would have been no problem. Rather, many people had a hard time swallowing the idea that they were personally at fault. But even harder to choke down were the invariable "solutions" demanded, such as banning the internal combustion engine, banning hairspray, mandatory recycling of everything, low flow toilets, etc., etc.
Maybe if people didn't have to swallow an entire cult-like ideology and associated lifestyle, maybe they wouldn't have been so resistant to the idea that the world was getting a degree or two warmer.
Just like the fact (in and of itself) that many proprietary software companies/projects do not make money for a long time and depend on corporate funding does not make these projects any more viable.
The corporate funding is an investment. The investors expect the projects to be financially successful. Few of them are, which is why these sorts of investments are risky, and why it's so hard to prove yourself worthy of the funding. But the bottom line is that the funds will eventually get reimbursed.
But that is not what this conservancy is about. It is a pure charity. It is an admission that the projects are not commercially viable, and that they need charitable donations in order to "compete" with proprietary software. It is this point which is counter to the prior FSF stance on commercial Free Software. I have nothing against charity, and in fact donate to a few projects. I only find it odd that the FSF is now changing its tune.
Why? It isn't your code, it's BSD's code. From a user's perspective there are no differences between the BSD and GPL licenses. Since you are not the developer of the code, it shouldn't make any difference to you at all.
I myself don't particularly like the GPL, but it doesn't stop me from using GPL licensed software. I may not develop GPL software because of this, but it won't stop me from using it. I am not so bigoted as that.
For two decades the FSF has been yelling that Free Software is not hostile to commerce, that you can sell Free Software, and that you can make a living writing Free Software. They keep saying that freedom, and not price or marketability, separate it from proprietary software.
So why now the turnabout? Why are key members of the FSF now impliying that Free Software needs to be a charity case?
You don't have to look like "them", but if you want to sell to "them", it really does help. That's the point of this whole story. When you dress to deliberately alienate yourself from society, don't bitch that society won't accept you.
On the one hand, you wrote "You're talking about every KDE version since 1.0!" which sounds like I need to have every version of KDE in RAM, which is indeed a pain. Now you're saying I upgrade the apps as well, to minimize on the RAM cost.
In an app-bundle-only universe, you will want all the old libraries installed, because you don't know what the user will need. In a package-manager-only universe, everything gets smoothly upgraded all at the same time. Thus I am not confused, just talking about two very different scenarios.
Of course, the package manager solution only works when most of your software comes via the package manager. For Windows and Mac, most software is third party shrinkwrap and shareware, and this doesn't work. But for Linux and BSD, it does work, and it works very well.
Besides, microsofties wear west coast developer attire too, just they don't let them make sales calls.
That's the key right there. Microsoft spokesmen don't wair pony tails and sandals. Unfortunately, few FOSS spokesman can say the same. Bruce Perens is about the only FOSS techie I know that will wear a suit and tie when speaking in public.
Geez guys! At least put on some dockers and a polo shirt. Both are comfortable, and you can get little penguins and daemons on the shirt. It's still not sales call appropriate, but at least you'll look like a professional engineer instead of permanent Berkeley grad student.
That not very many applications. Really. There's no load on that system, and you're miles away from even beginning to fill up memory. You're basically describing my idle time under FreeBSD. Really. Last night, for example, I'm building the latest KDE in the background (massive CPU usage, in other words), automatic cron stuff is running, I'm playing MP3s and Oggs in Amarok, a couple of Konqueror windows open playing Flash animations, a large image heavy PDF open, several dock apps, and I'm using OpenOffice Writer. No sluggishness, stuttering or hiccups. Doing this under Windows is disastrous. I can't even build under Windows without WinAmp stuttering on an MP3.
My coworker has about twenty to thirty windows open, not your five or six. She probably has a couple of Outlook email windows open, a couple PDF documents open, half a dozen spreadsheets and Word documents, Visual Studio in the middle of a lengthy build, several explorer windows, a couple IExploder windows with IExploder-only company webapps running on them, both of which have their own Java VM running, Hummingbird Exceed runing an X server with several associated xterms and Solaris apps, and twenty different icons blinking in the systray. She never logs out of her system, but only hibernates, so I suspect she hasn't seen her desktop in weeks.
That is extreme, to be sure. But my point is that the equivalent behavior pattern under her Solaris workstation does not result in any slugglishness.
Also, if there are so many versions of everything to talk about, how exactly is shared libraries saving me any RAM compared to the MacOS approach?
Upgrade! When you do an upgrade you upgrade everything! When you upgrade KDE 3.5.1 to 3.5.2, you upgrade the libraries AND the applications. This is why package managers are so damned useful. Most of the time you can just rebuild and application and it will work with the new library. Other times just a few lines of patching by the distro and it will as well. There will always be a few apps you'll have to wait a a few months on, but that can easily be managed without having to keep everything since KDE 1.0 on your system.
Imagine doing a software upgrade on Mac OSX, but having it apply to EVERY piece of installed software! That's what a package manager does.
Free as in speech or beer?
Free as in "trying to herd cats." Free operating systems don't have dictatorships coercing developers into one centralized API. They don't have police telling users they're not supposed to use a certain appliation anymore. What few standards groups exist do not have the power to enforce their vision on anyone. In a free operating system, everyone does whatever the hell they want, without asking for your permission.
That function isn't safe because it uses fgets(), and not because it uses a pointer. Duh.
Null terminated arrays (C style strings, in other words) are problematic to begin with, and fgets() and related functions just makes it worse by doing no bounds checking. But that is not a reason to avoid pointers, just a reason to avoid null terminated strings.
Using a pointer is NOT like juggling chainsaws. Don't be stupid.
If you allocate memory, you must free memory. It's as simple as that. If you're allocating so much memory that you can't manage it anymore, then of course, you shouldn't do it. But to suggest that no one should ever use a pointer is silly. Millions of C/C++ programmers do it successfully every day.
If your argument is that you shouldn't do it because you might do it wrong, then you need to apply the same logic to everything else. You might cause a race condition if you use threads, SO DON'T USE THREADS! In real life in fact, I find more race conditions in C code than I do memory related bugs. Java lets you use threads, so maybe you shouldn't use Java! Or what about the while loop? It's all too easy to create an infinite loop with the while statement. Too many programmers will write a loop without ever stopping to guarantee that the loop with exit. They shouldn't be allowed to do this! While we're at it, let's ban casts as well. And multiple inheritance. And exceptions. And everything else that might cause a bug. And to be safe, everything else as well.
This is all Bush's fault! Oh wait... this is in Canada. Well it's STILL Bush's fault, dammit!
Just to let everyone know, NetBSD has binary packages. You don't have to build everything from source. Unless, like the parent post, you decide you want to.
Correct. The hardest part about installing Linux/NetBSD/etc., is the dual booting. Windows users very very rarely do this, so they think it's a Linux problem. But it's actually harder to dual boot two Windows versions than it is dual booting Windows and Linux or BSD.
Sorry, but you're an ass. You've been fed a diet of shit so long you think it tastes good. Pointers aren't a problem, improper use of them is. Surprise! Improper use of ANYTHING is a problem!
Undisciplined use of pointers is going to cause bugs. But since undisciplined coding itself causes bugs, who the fsck cares? The solution isn't to ban pointers, but to start beating undisciplined coders over the head. I'm not saying you have to use pointers, but if you are avoiding them because of fear, it's time to learn how to use them properly.
Eat your pound of crow, take your foot out of your mouth, and listen to people who have been right.
You don't get it, do you? The "people who have been right" have been telling us for three decades that we have to radically change our lifestyles. These "people who have been right" have deliberately linked the issue with a particular political philosophy. We are told by the "people who have been right" that recycling toilet paper will save the planet.
It wasn't good enough for the "people who have been right" to alert us to a problem, instead they had to jam a particular ideological solution down our throats. No one ever told us that the climate was getting marginally warmer, instead we were told that unless we banned the internal combustion engine we would all bake to death by 1997.
Their chief concern was that we all had the correct attitude towards the environment. The conservation movement was mature, popular, and working. But it's attitude of "don't waste" wasn't the proper one, and so the environmentalists ridiculed conservation as not being good enough. So now we recycle not because it's frugal or pragmatic, but because it's the chief religious sacrament of environmentalism.
Not everyone in the environmental movement is a Birkenstock wearing neo-pagan somewhere to the left of Trotksy. Yet everyone else in the movement are content with them being their chief spokespeople.
Where do you think IBM got the term "PC" from?
This is Corporatism not Capitalism.
Someone mod this anonymous post up. Groups of men granted government immunity from liability and market forces is NOT capitalism.
Amen! My company used to be a Solaris house. Everyone had "smart clients", where the OS was local, but everything else, including home directories and applications, were remote. Having the OS local gave us the advantage of thin clients without the high bandwidth.
When a harddrive crashed on me, someone from IT spent five minutes swapping out the drive while I was at lunch. I never had any downtime beyond the phone call to report the problem. When we switched(*) to Windows, the same harddrive crash took a few days to recover from, including reinstalling the OS, reinstalling all applications, locating and restoring backup, and general user thrashing.
(*)How come switching away from Windows is too expensive to realistically consider, yet no one ever says anything when switching *to* Windows?
Microsoft makes more money when its software has a lot of security vulnerabilities
But only so long as people refuse to demand secure quality software. Microsoft isn't evil, it's only producing what the consumer is demanding.
People aren't demanding secure software. They may say they are, but their actions speak differently. They don't read their EULAs, don't firewall their systems, don't use good passwords, are indiscriminant in their browsing, are indiscriminant in providing personal information to anyone who asks, and according to all observation, only mildly annoyed at crashes, hangs, and malware. What they demand instead are new features, even if they're only superficial changes to the UI. Even otherwise savvy IT personnel exhibit these behaviors. As long as they're not alone in their insecurity people won't much care.
When people place so little value and security and quality, it shouldn't surprise anyone when Microsoft similarly devalues them.
He recalls one house he inspected that had 7 heated swimming pools joined together with hottubs. The owner would keep them heated year-round just in case a random party broke out. He also had 10 furnace and airconditioning units in his 35,000 sqft. house that I'm sure he ran the hell out of. He also had a 6 car garage, one spot for each of his SUVs.
So what? One isolated anecdote that way is NOT going to destroy the planet!
It's not that many people couldn't accept the premise that the climate is getting slightly warmer. If that's all it was there would have been no problem. Rather, many people had a hard time swallowing the idea that they were personally at fault. But even harder to choke down were the invariable "solutions" demanded, such as banning the internal combustion engine, banning hairspray, mandatory recycling of everything, low flow toilets, etc., etc.
Maybe if people didn't have to swallow an entire cult-like ideology and associated lifestyle, maybe they wouldn't have been so resistant to the idea that the world was getting a degree or two warmer.
it merely aims to help service one part of a very broad Free Software church.
Church? Church! Methinks you're taking this WAY too seriously.
Just like the fact (in and of itself) that many proprietary software companies/projects do not make money for a long time and depend on corporate funding does not make these projects any more viable.
The corporate funding is an investment. The investors expect the projects to be financially successful. Few of them are, which is why these sorts of investments are risky, and why it's so hard to prove yourself worthy of the funding. But the bottom line is that the funds will eventually get reimbursed.
But that is not what this conservancy is about. It is a pure charity. It is an admission that the projects are not commercially viable, and that they need charitable donations in order to "compete" with proprietary software. It is this point which is counter to the prior FSF stance on commercial Free Software. I have nothing against charity, and in fact donate to a few projects. I only find it odd that the FSF is now changing its tune.
But I do feel that strongly about the license.
Why? It isn't your code, it's BSD's code. From a user's perspective there are no differences between the BSD and GPL licenses. Since you are not the developer of the code, it shouldn't make any difference to you at all.
I myself don't particularly like the GPL, but it doesn't stop me from using GPL licensed software. I may not develop GPL software because of this, but it won't stop me from using it. I am not so bigoted as that.
For two decades the FSF has been yelling that Free Software is not hostile to commerce, that you can sell Free Software, and that you can make a living writing Free Software. They keep saying that freedom, and not price or marketability, separate it from proprietary software.
So why now the turnabout? Why are key members of the FSF now impliying that Free Software needs to be a charity case?
But why be lke them?
You don't have to look like "them", but if you want to sell to "them", it really does help. That's the point of this whole story. When you dress to deliberately alienate yourself from society, don't bitch that society won't accept you.
Why not switch to Kubuntu and use Konqueror instead?
In an old interview Bill Gates said, and I paraphrase, "people don't pay for bug fixes." This explains a lot.
On the one hand, you wrote "You're talking about every KDE version since 1.0!" which sounds like I need to have every version of KDE in RAM, which is indeed a pain. Now you're saying I upgrade the apps as well, to minimize on the RAM cost.
In an app-bundle-only universe, you will want all the old libraries installed, because you don't know what the user will need. In a package-manager-only universe, everything gets smoothly upgraded all at the same time. Thus I am not confused, just talking about two very different scenarios.
Of course, the package manager solution only works when most of your software comes via the package manager. For Windows and Mac, most software is third party shrinkwrap and shareware, and this doesn't work. But for Linux and BSD, it does work, and it works very well.
Besides, microsofties wear west coast developer attire too, just they don't let them make sales calls.
That's the key right there. Microsoft spokesmen don't wair pony tails and sandals. Unfortunately, few FOSS spokesman can say the same. Bruce Perens is about the only FOSS techie I know that will wear a suit and tie when speaking in public.
Geez guys! At least put on some dockers and a polo shirt. Both are comfortable, and you can get little penguins and daemons on the shirt. It's still not sales call appropriate, but at least you'll look like a professional engineer instead of permanent Berkeley grad student.
That not very many applications. Really. There's no load on that system, and you're miles away from even beginning to fill up memory. You're basically describing my idle time under FreeBSD. Really. Last night, for example, I'm building the latest KDE in the background (massive CPU usage, in other words), automatic cron stuff is running, I'm playing MP3s and Oggs in Amarok, a couple of Konqueror windows open playing Flash animations, a large image heavy PDF open, several dock apps, and I'm using OpenOffice Writer. No sluggishness, stuttering or hiccups. Doing this under Windows is disastrous. I can't even build under Windows without WinAmp stuttering on an MP3.
My coworker has about twenty to thirty windows open, not your five or six. She probably has a couple of Outlook email windows open, a couple PDF documents open, half a dozen spreadsheets and Word documents, Visual Studio in the middle of a lengthy build, several explorer windows, a couple IExploder windows with IExploder-only company webapps running on them, both of which have their own Java VM running, Hummingbird Exceed runing an X server with several associated xterms and Solaris apps, and twenty different icons blinking in the systray. She never logs out of her system, but only hibernates, so I suspect she hasn't seen her desktop in weeks.
That is extreme, to be sure. But my point is that the equivalent behavior pattern under her Solaris workstation does not result in any slugglishness.
Also, if there are so many versions of everything to talk about, how exactly is shared libraries saving me any RAM compared to the MacOS approach?
Upgrade! When you do an upgrade you upgrade everything! When you upgrade KDE 3.5.1 to 3.5.2, you upgrade the libraries AND the applications. This is why package managers are so damned useful. Most of the time you can just rebuild and application and it will work with the new library. Other times just a few lines of patching by the distro and it will as well. There will always be a few apps you'll have to wait a a few months on, but that can easily be managed without having to keep everything since KDE 1.0 on your system.
Imagine doing a software upgrade on Mac OSX, but having it apply to EVERY piece of installed software! That's what a package manager does.
Free as in speech or beer?
Free as in "trying to herd cats." Free operating systems don't have dictatorships coercing developers into one centralized API. They don't have police telling users they're not supposed to use a certain appliation anymore. What few standards groups exist do not have the power to enforce their vision on anyone. In a free operating system, everyone does whatever the hell they want, without asking for your permission.
Slashdot recently removed the link to it in their sidebar, but it's been here for years.