Friday, January 22, 2010

Vim as IDE

I've discovered that it seems quite feasible to set up the VIM text editor as an Integrated Development Environment for C++ programming. This is exciting because it's a lot smaller and faster than most full-featured (i.e. bloated) IDEs, is the best programmer's editor (in my opinion), and allows me to do programming in Linux without using Eclipse (which takes an enormous amount of resources). The software you need to put this together is as follows:

gvim, of course.

gcc, of course, to compile C++ code.

make, for writing a "project" that lets you add your source files and get compiled into your program with one command.

ctags, so that you can jump from a variable's use to its declaration with Ctrl+] (and then jump back with Ctrl+t), and as a prerequisite for code completion (see below).

yavdb and gdb. yavdb lets you do debugging in vim by attaching gdb to an existing vim window. Then you can use the function keys in your code to set breakpoints and step to lines of interest, and press F10 to see the value of the variable under the cursor. When you want to examine more complicated information, go to the terminal you started yavdb from and use gdb commands. Simple and quite effective.

omnicppcomplete, which does code completion in vim by using your tags file generated by ctags. There are some slightly involved (but straightforward) instructions involved in setting it up, but I had no trouble getting it to work. Once it's set up, you get a list of member choices whenever you press ., ->, or ::.

Finally, you'll probably want to set / remap some shortcut keys so the function keys do what you want. For example, to set keys for building the project, and going to the next / previous compilation error, add lines like these to your ~/.vimrc file:


map <F4> :make<Return>
map <F6> :cnext<Return>
map <S-F6> :cprevious<Return>


which sets F4 to build your project, and F6/Shift F6 to go to the next / previous compile error.

Friday, January 1, 2010

Why I'm not a Vegan

Since I believe so strongly in animal rights and environmentalism, and especially since being accosted by a few vegans over the past few years, I've thought a lot about the topic of the morality of food and have seriously considered veganism. I've rejected veganism and vegetarianism, but I also believe in a rich moral tapestry surrounding food. I thought it might be useful for me to share my ideas and arguments, since they differ so drastically from that of most meat eaters (e.g. eating meat out of habit, or because of the idea that humans are more important than other animals).

There are 3 main arguments for strict veganism - the death of animals, the suffering of animals, and the environmental impact of farming. Let me address each of them in turn.

Sentience and the welfare of plants and animals

I do believe that animals are sentient (have experiences) and can suffer, and therefore we ought to care for their well-being. I also reject the widespread belief that humans are elevated above the other animals. Even if we were created in the image of God, it doesn't make us more important, especially since we've fallen.

Many vegans claim that we shouldn't eat things that are sentient. I disagree, because I see no reason for them to stop at animals. I believe all life is sacred, and, as far as we know, could be sentient. Yes, I believe plants may well have experiences, and therefore we should care about their well-being as well. You'll undoubtedly respond that it's absurd to think that plants are sentient because they don't have a brain. But there is actually no reason to associate sentience with a brain. Sentience is a subjective quality, and therefore there cannot be a scientific experiment done to confirm or refute it in plants (or animals, or other humans). So, given this lack of knowledge, to say that specific groups of living things are or aren't sentient based on physical qualities like brains, language, or reasoning ability, is discrimination. It's no different than the belief many held hundreds of years ago that certain races, which were used as slaves, were not human.

As mentioned, I believe it's OK to eat (things that are sentient) respectfully. Otherwise I wouldn't be able to survive, since I practically have to eat animals or plants. Eating respectfully means not wasting. I don't believe it's OK to murder things that are sentient. This is a difficult concept for some people to understand, because they think eating is a type of murder. These same people probably also think it's always wrong to do an action that results in harm to someone. But that can't be, because you cannot make everyone happy at once. An action that averts one person's harm may bring harm to someone else. Rather, it's wrong to cause unjust or unneeded harm. So, yes, eating causes harm, but it is not unjust. If everyone (all sentient beings) stopped eating, everyone would die.

So the argument to not eat animals because they're sentient doesn't work, because then you'd have to eat more plants in place of the animals, and as far as we know, plants are sentient too.

Animal imprisonment

As someone who is strongly opposed to pets because I believe animals should be free, the argument that farming imprisons animals is a compelling one to me. Let me say first of all that I'm strongly opposed to factory farms, which, as I understand it, is where most of our meat now comes from, and which needlessly imprison and oppress animals. I do advocate boycotting factory farm sources of meat. Further, I definitely don't think farming is ideal; hunting animals would be much better.

But we now live in a situation that is less than ideal. Almost nobody knows how to hunt. There aren't enough wild animals to feed all the humans (which is a big reason I advocate Voluntary Human Extinction). Perhaps worst of all, a single wild animal usually provides way too much meat for a single person to eat, which would mean it would have to be shared by many people; and it would be quite difficult to find enough people to share it with, without any of it being wasted.

Indeed, we've become so entrenched in farming that the animals we farm can be considered unnatural, unable to survive any more in the wild. They've been naturally selected to live on farms - so could it perhaps be that they don't mind living there? It still isn't ideal to assume that of them, of course, but then we can't assume plants are OK in the unnatural environments that we, of necessity, put them in either. The ideal for the long term is for use to stop having children until there are few enough humans that they could all eat the wild species, at which point they would either learn to do that, or become extinct. But in the short term, eating as few domesticated species as we can is acceptable.

(As an aside, the difference with pets is that they're not kept out of necessity, but out of selfishness - the pets are meant to bring emotional happiness to the humans. The proper way to deal with the pets that are now in existence is to neuter them all, then let them live in the country where they can be relatively free (and possibly eat some of the ones that can be eaten). Eventually the unnatural pet species would thereby go extinct.)

It's of the utmost importance that our farms have owners who care about the well-being of the animals, and treat them well. Fortunately, I doubt there's any other reason for people to operate family farms in this day and age - I certainly don't expect it's profitable. So supporting such farms has the benefit of being a thorn in the side of competing factory farms, which is a good thing. Therefore you should buy your meat from farmers instead of grocery stores.

Environmental impact

Farms produce a lot of pollution, I've been told by various sources. For example, raising cows apparently gives off more carbon dioxide than cars, totally in the world. You could reduce the impact of a cow by just growing plants and eating them, instead of growing plants which you feed to a cow which you eat. This factor is significant and I don't think it can be rightly ignored.

However, I think it is merely a good reason to drastically reduce the amount of meat you eat, if you eat like an average North American. Often, people will even eat more meat than they need to be healthy, which means the extra meat they eat that they don't need to be healthy is causing needless pollution. That's wrong, if it's not unintentional.

But shouldn't I reduce my pollution even more by eating no meat at all, and eating meat substitutes instead to give me the nutrients? This is the point that so many environmentalists fail to understand. There are so many complex factors involved that you cannot infer the environmental impact of eating a bit of meat from the environmental impact of farming as a whole. In the case of driving a car somewhere you could walk, or buying a box of chocolate, the environmental impact is direct - you can definitely tell that driving the car is causing harm that walking isn't causing, or that the production of the chocolate caused harm that wouldn't be caused by not buying it. But the impact of eating a bit of tofu compared to a bit of ground beef is not at all direct or obvious. How far did they each have to be shipped to reach you? What farming practices does the farmer use? Were they on sale so that if no one bought them they would otherwise be wasted? Are there any national or international laws that would affect the costs of production? Would economy of scale make one more efficient to produce than the other? Etc, etc.

Finally, the goal of environmentalism is not zero pollution, contrary to the ideas of many environmentalists. The environment can absorb some pollution and heal itself. There's also no reason to treat human activity as "unnatural", since humans are just another species. To a wolf, it may appear that wolves are having an impact on the deer population in the forest they live in - but that impact is just as natural as the overgrowth of deer there may be without the wolves. Likewise, why can't we view human activity as just as natural as any species? The goal is therefore not to reduce unnatural results, but to reduce the harm we cause. As far as I can tell, this can be done at least as well by eating a bit of meat (by which I mean, a lot less meat than the average North American) as it can by strictly avoiding animal products.

Conclusion

In the face of such confusion and uncertainty, our best course of action is to hunt, gather, and, when necessary, grow most or all of our own food ourselves, so we can directly see the impact of our actions. But in the interim while we work towards that goal, there is no imperative to avoid animal products entirely. There is an imperative to consider the effects of eating and try our best, given our very limited knowledge, to minimize harm in each situation we're faced with.