
Why a mathematician can be an excellent software engineer - ot
http://poisson.phc.unipi.it/~maggiolo/index.php/2012/03/why-a-mathematician-can-be-an-excellent-software-engineer/
======
dkarl
_Can_ isn't a very strong statement. In my experience mathematicians are all
over the place, from the very worst developers I've worked with to the very
best. As the article points out, mathematicians are indubitably intellectually
equipped to work with software. What it boils down to is how much they care
about stuff that isn't mathematics. The worst occupational hazard for
mathematicians writing code is what I call X-ray vision: being
constitutionally incapable of seeing, thinking about, or caring about anything
that you don't consider mathematics.

Imagine you live in a house, and you have Superman-like X-ray vision that
makes anything non-metallic invisible to you, and you can't turn it off. In a
way, it's awesome. You can see all the wiring and plumbing and instantly
diagnose any problems with it, you can see into your household appliances, and
you never lose your keys or your cell phone. Many things that are mysterious
to other people are immediately apparent to you. On the other hand, you're
covered with bruises because you keep walking into doors and walls. You're
extremely strong and determined, so when you discover invisible objects in
your way, you hit and kick them and continue on your intended path. All your
furniture is knocked over and kicked against the wall, and your non-metallic
possessions are randomly strewn about on the floor, not that you care, because
you only care about things you can see, things made out of metal. Luckily,
someone values your superpowers enough to come by every day to feed you, bathe
you, place a fresh set of (invisible) clothes in your hands, and cajole you
into going through the motions of putting your clothes on, even though you
literally don't see the point.

Because you walk into things so much, and just for general maintenance
purposes, workmen regularly come by to repair and remodel your house. They
yell at you for destroying their work. You get angry at them, because they
make a lot of noise, and it takes them forever to get out of your way, and
when they're done, everything looks the same way it did before. They say they
delivered a new dinette set and replaced a broken window frame, but the wiring
and plumbing is all the same, so you accuse them of jerking you around and
wasting time. They beg you not to destroy their work this time, which just
makes you feel insulted and angry. Sometimes they reroute your wiring and
plumbing so they can install a new door and repair a hole you've knocked in
the wall. You rip out the wiring and plumbing and put it back where it used to
be. They're yelling at you and making fun of you because you've just routing
the wiring and plumbing through the middle of the door. You ignore them and
commence bashing a new hole in the wall where the old hole used to be. The
effort makes you hot and sweaty, so you take your clothes off.

The workmen marvel that you are strong enough to bash a hole in the wall using
only your head and your fists, but they constantly grumble that they shouldn't
put up with being forced to work with this angry naked superman, no matter how
strong you are or how super your X-ray vision is.

That's what it's like when a software organization has a mathematician who can
only see mathematics and can't see software :-)

(My degree is in math, but I am not smart enough to get away with X-ray
vision, so I have to pay attention to the code I write.)

~~~
yaks_hairbrush
So funny, and true in a lot of cases. Ultimately, though, I think your naked
superman with X-ray vision just has problems with communication, working with
people, and most of all adapting efficiently to his environment.

The X-ray vision guy is blatantly choosing to continue bumping into things
where the more efficient solution is to put things in place, leave them there,
and remember not to walk into those places. That's the failure to adapt to the
environment. A mathematician who made an honest effort to, at the least, not
upset the software could do pretty well. Probably.

~~~
gruseom
Just? You're not giving nearly enough credence to the otherworldly state that
dkarl has brilliantly described.

There's a famous story about von Neumann (don't know if it's true) that he had
a hard time finding his house. One day he walks up to a little girl and says,
"Excuse me, little girl. Can you tell me where the von Neumann residence is?"
And she says, "Yes daddy, it's that one over there."

------
sqrt17
Now, from a logical viewpoint this title could also be "why an excellent
software engineer can be a mathematician", or (assuming that excellence in
mathematics does not affect your ability to engineer software) "why a software
engineer can be an excellent mathematician". Now, to get all the angry
mathematicians from stabbing me, here's another truth: bad software engineers
(i.e., people who do software engineering but aren't good at it) are useful
and are often paid real money for what they do. Bad mathematicians are chased
away and either become jobless or find a new destination of being a physicist,
software engineer, or restaurant owner, because bad mathematics doesn't pay
for itself.

Intuition (the thing that the article's author bumps his head against without
noticing it) is really important in mathematics, even though its importance is
usually played down wrt. the importance of handling the technical details
(correctness of a proof, keeping mathematical structures in your head). In
fact, the same faculty used for the formal work is also used for your
mathematical intuitions, but then the intuitions are turned into a proof by
checking and re-checking how it all fits together.

Eugenia Cheng (a category theorist) uses the term "morality" for the
mathematical equivalent of design patterns:
<http://cheng.staff.shef.ac.uk/morality/morality.pdf>

~~~
gruseom
Wow, that looks like a fun paper. I'm going to read the rest of it later. But
I must protest at your equating it to design patterns. I wish design patterns
would go away. They're clumsy and mislead people. Good software intuition is
something more refined and ineffable. It can't be written up or formalized any
more than mathematical craft can, or poetic craft for that matter. By
pretending it can, design patterns poisoned the culture. I'd bet money Cheng
isn't talking about anything like that.

------
mtkd
Some of the best developers I've worked with have come from academic maths
background and the development they worked on was the first time they'd
written any significant software.

It's easier to teach a mathematician to code than it is to teach a coder some
maths.

------
hndl
Genuine interest and patience. You'll need that to be good at anything. Trite,
but so rarely exhibited by the folks in the fast lane.

~~~
meric
Was about to write the exact comment. Sad to see this at the bottom.

Anyone who really wants to be a programmer can be a software engineer, because
if you are really interested in programming you spend a lot of time
programming and that will be enough to get you an engineer role somewhere.

My dad, an MBA, would never admit to it, but I once caught him coding Excel
macros. I asked him "Isn't that programming? There's loops, conditions,
variables and procedures!" And he goes "I don't program, I automate tasks for
moving Excel spreadsheet data into the our data warehouse.".

Moral: Not all programmers can be software engineers, you have to be someone
interested in programming.

~~~
gruseom
Jerry Weinberg has a concept called "oblivious programming" in which people
are writing programs but don't know it. Spreadsheet users are the canonical
case of this, which implies there are more oblivious programmers than
conscious ones.

------
grepherder
Isn't this trivium? It's almost like saying a mathematician can be an
excellent physicist.

Also, beware - correlation fallacy. In my experience it doesn't have anything
to do with the education itself, I believe you can easily generalize and say
the average person taking up mathematics has a better analytical mind than the
average CS major who's in it for the hype.

~~~
eshvk
Yes, that is true but the training does help _a bit_ (or there is some
correlation): Depending on the type of math classes you are taking, you can
rapidly ramp up training your mind to think analytically which helps while
doing CS. Let me offer one data point: Back in school, I took real analysis
and operating systems in the same semester, I could definitely see the
grueling work in handling abstractions at the math class help me to easily
navigate back and forth up the abstraction layers in the OS course.

On the other hand, I feel software engineering is a slightly different ball
game compared to thinking mathematically. E.g. most applied mathematicians who
write scripts try not to go overboard on modularizing the code mainly because
it is easier to pattern scan with code that fits into a page (and average
mathematical models do). Another useful technique is to use the same variable
names that were used while deriving the model in the code. While, I am not
necessarily defending the practice, I have from painful experience (writing
convex optimization code) found that trying to modularize and introduce
"meaningful names" to replace those that you just used while deriving out
analytically the model and also making sure that your code doesn't go wonky
can definitely be a challenge to get right. So yeah, there might be some
retraining needed to do at times, depending on the intransigence of the
individual involved this might be impossible or fairly easy.

~~~
grepherder
OK - I stand corrected, actually rereading what I wrote it came out a bit
strong ("doesn't have anything to do with"), it does have more than a bit
even, true.

Concerning the other point, it's also true but it's something else entirely. I
never meant a mathematician will outdo someone with software engineering
education, obviously he will at least have to read about good software
engineering practices. I can also confirm your experience, from firsthand
account even, as someone who began coding to do basic applied math. Thinking
mathematically generally leads to (at best) efficient but unreadable, one-
time-use-only code.

------
orbitingpluto
If a mathematician has done his graph theory, combinatorics classes, and a
special topics class or two, it's probably a good idea to snap them up. A good
mathematician can sometimes turn O(n^2) performance into O(1). Of course a
good mathematician can also create an algorithm that runs as a fraction of
O(w) time and be happy about it as long as it proves the theorem.

Academically w.r.t maths, mathematicians start where computer scientists end.
The biggest bane to graduation of a CompSci student is usually a basic
combinatorics class. One guy I knew was given special dispensation to take the
class after having exceeded the maximum number of fails allowed for a single
class. He was to devote the entire term to just that class. He had finished
_everything_ else. Intro Biochem and Discrete Maths I were the two most failed
classes.

~~~
tseabrooks
Interestingly I've had a somewhat different experience (In the U.S.).
Historically, my university had discrete math required for only the C.S.
majors and the math majors could take the course as en elective.. few if any
ever did.

Then the dark times, the school made Discrete Math I a required class for math
majors. The math majors rebelled strongly after more than half of them failed
the course for 3 semesters straight. Eventually the school removed the
requirement on math majors. It seemed in our situation that Math majors were,
as a generalized body where exceptions of course exist, unable to accomplish
the logic portions of the course. Most did fine with set theory and
combinatorics but completely floundered in the rest of the course.

------
qntm
Mathematicians are able to quickly pick up new technical concepts and systems.
Also, studying mathematics trains you to recognise and focus on important edge
cases. That's good for designing software to be robust, finding problems in
specifications, and testing.

------
wslh
What I can say is that Daniel Bernstein (<http://cr.yp.to/>) doesn't have
practically bugs in their qmail code. You can read his own paper on
<http://cr.yp.to/qmail/qmailsec-20071101.pdf>

------
Craiggybear
Most mathematicians I know _are_ highly competent programmers and are easily
on a par with pro software engineers and often outshine them totally.

