Blog Archives

Leading digits and quadmath

My previous post looked at a problem that requires repeatedly finding the first digit of kn where k is a single digit but n may be on the order of millions or billions. The most direct approach would be to

Tagged with: ,
Posted in Computing

C++ at Facebook

Andrei Alexandrescu said in a panel discussion last week that when he joined Facebook two years ago, maybe 90% of the programmers wrote PHP and 10% C++. Now there are roughly as many C++ programmers as PHP programmers. One reason

Tagged with: ,
Posted in Software development

C++ Renaissance

Dynamic language developers who are concerned about performance end up writing pieces of their applications in C++. So if you’re going to write C++ anyway, why not write your entire application in C++? Library writers develop in C++ so that

Tagged with: ,
Posted in Software development, Uncategorized

a < b < c

In Python, and in some other languages, the expression a < b < c is equivalent to a < b and b < c. For example, the following code outputs “not increasing.” a, b, c = 3, 1, 2 if

Tagged with:
Posted in Uncategorized

Using C# like a scripting language

Clift Norris wrote a clever little batch file csrun.bat several years ago. I thought I’d posted it here, but apparently not. If you have a C# program in foo.cs, you can type csrun foo.cs to compile and run the program.

Tagged with: ,
Posted in Software development

What most C++ programmers do

“Nobody knows what most C++ programmers do.” — Bjarne Stroustrup The quote above came up in a discussion of C++ by Scott Meyers, Andrei Alexandrescu, and Herb Sutter. They argue that C++ is used in so many diverse applications that

Tagged with: ,
Posted in Software development

A couple Python-like features in C++11

The new C++ standard includes a couple Python-like features that I ran across recently. There are other Python-like features in the new standard, but here I’ll discuss range-based for-loops and raw strings.

Tagged with: ,
Posted in Python

Maybe C++ hasn’t jumped the shark after all

A couple years ago I wrote a blog post Has C++ jumped the shark? I wondered how many people would care about the new C++ standard by the time it came out. I doubted that it would matter much to

Tagged with:
Posted in Software development

Calling C++ from R

This post relates my experience with calling C++ from R by writing an R module from scratch and by the inline module.

Tagged with: ,
Posted in Software development

Why do C++ folks make things so complicated?

This morning Miroslav Bajtoš asked “Why do C++ folks make things so complicated?” in response to my article on regular expressions in C++. Other people asked similar questions yesterday. My response has two parts: Why I believe C++ libraries are

Tagged with: ,
Posted in Software development

C# math gotchas

C# has three mathematical constants that look like constants in the C header file float.h. Two of these are not what you might expect. The constant double.MaxValue in C# looks like the constant DBL_MAX in C, and indeed it is.

Tagged with: , ,
Posted in Math, Software development

Math library functions that seem unnecessary

This post will give several examples of functions include in the standard C math library that seem unnecessary at first glance. Function log1p(x) = log(1 + x) The function log1p computes log(1 + x).  How hard could this be to

Tagged with: ,
Posted in Math, Software development

The dark matter of programmers

Kate Gregory said in an interview that she likes to call C++ programmers the dark matter of the software development world. They’re not visible — they don’t attend conferences and they don’t buy a lot of books — and yet

Tagged with: ,
Posted in Software development

C++ 0X overview

Scott Meyers gives an overview of the new C++ standard in his interview on Software Engineering Radio. On the one hand, some of the new features sound very nice. For example, C++ will gain Type inference. This will make it

Tagged with: ,
Posted in Software development

Interview with Clojure author

Simple-talk has an interview with Rich Hickey, author of the programming language Clojure (pronounced “closure”). Clojure is a dialect of Lisp designed to run on top of the Java Virtual Machine. The language is also being ported to the .NET

Tagged with: , , ,
Posted in Software development