News for hackers. Stuff that matters.
Re:A significant amount of programming is done by superstition by avmich on Wednesday March 25, 2015 @07:29PM (#9266787)
> Experimentation is the key to science.

Computer science is a branch of mathematics. Here you build models, reason about them, find properties, then prove them, then rely on them. Tests - a.k.a. experiments - are usually not exhaustive and don't provide guarantees of correctness.

Having said that, I agree that experiment is of crucial importance - how else you would validate your models in the first place? However, both experimenting and reasoning can be flawed, and part of the trick is to learn how to do that properly. Computer science is difficult.

Re:A significant amount of programming is done by superstition by GauntletWizard on Wednesday March 25, 2015 @07:41PM (#9266830)
Programming is a branch of engineering. Very little programming is done by proof; It's done by experimentation, debugger, and tests are human-reasoned and hopefully cover all codepaths and critical junctures (for every x > 0, you test x=1, x=0, x=-1).

Proof is of critical importance - It's how you find those junctures, for example, how you optimize, how you design and how you reason about runtime, etc. But programming as practiced in the field is engineering first, mathematics second.

Re:A significant amount of programming is done by superstition by dasil003 on Wednesday March 25, 2015 @08:47PM (#9267088)
Reminds me of the famous Knuth quote:

> Beware of bugs in the above code; I have only proved it correct, not tried it.

Deep thinking and mathematical proofs are tremendously useful when thinking about a well-defined and scoped problem at a more or less fixed level of abstraction.

The problem with software engineering is that in practice all abstractions are leaky, and so you inevitably find yourself dealing with issues that are too far-flung and random to be mathematically tractable. The best you can do is be rigorous about the core problem you are solving, but there is always some amount of hammering and duct tape to build it into a non-trivial real-world system. It's possible to attack this problem asymptotically with a rigorous engineering process such as NASA employs, but we don't because it's simply not cost effective for the majority of software.

Re:A significant amount of programming is done by superstition by Osiris on Wednesday March 25, 2015 @10:42PM (#9267507)
because it's simply not cost effective for the majority of software.

That's a great point. We utilize best practices, like automated tests, to narrow the gap between pure experimentation and mathematical proof. Proofs in most code would be difficult to impossible because most of use libraries that use other libraries, etc., so we just do the best we can given the time and monetary constraints that we have.

Re:A significant amount of programming is done by superstition by Iftheshoefits on Wednesday March 25, 2015 @09:00PM (#9267149)
This is a great comment. The category error you've identified is manifest in more than the comment you're replying to as well: it's at the heart of one of the biggest problems with software interviews in a certain sector of this industry (the heavy focus on academic CS in startups and many Bay Area tech companies).
Re:A significant amount of programming is done by superstition by rtpg on Wednesday March 25, 2015 @11:43PM (#9267697)
Even in math, you don't build models, you discover them. Pythagoras wasn't worried about the axiom of choice, he was discovering how geometry works.

I don't mean this to be a "mathematics from nature argument" (even infinite sets are hard to justify as coming from nature), but the course of history has usually been "solve similar problems in an ad-hoc manner many times, then generalize"

Re:A significant amount of programming is done by superstition by kenzokai on Thursday March 26, 2015 @01:11AM (#9267938)
I think "write code and see if it works" may be tad more succinct and closer to reality than "build models, reason about them, find properties, then prove them, then rely on them. Tests ... provide guarantees of correctness." wrt to OP's comment.
Re:A significant amount of programming is done by superstition by olavk on Thursday March 26, 2015 @06:17AM (#9268655)
Then most programming is not computer science.
Re:A significant amount of programming is done by superstition by ecnahc515 on Wednesday March 25, 2015 @10:10PM (#9267421)
Physics of also a branch of mathematics. But experimentation is key to proving correctness.
Re:A significant amount of programming is done by superstition by Tenobrus on Thursday March 26, 2015 @01:34AM (#9267999)
What? Physics is not a branch of mathematics, it just uses mathematics and mathematical properties. That's like saying psychology is a branch of mathematics because it involves statistics. Using math isn't the same as being math. Admittedly physics is one of the "mathiest" fields, but it still involves doing experiments and coming up with mathematical models that fit the data rather than coming up new kinds of mathematics. The line was much more blurred in Newton's time, but these days the distinction is pretty obvious.
Re:A significant amount of programming is done by superstition by ihm on Friday March 27, 2015 @08:50PM (#9280002)
Certainly physics is not a branch of mathematics, but it isn't uncommon for papers in theoretical physics to essentially be math papers with an eye toward applications to some physical notions, and physicists do come up with new math.
Re:A significant amount of programming is done by superstition by fsloth on Thursday March 26, 2015 @05:32AM (#9268540)
I would restate this so that software engineering and physics are fields concerned about building practical models. They are similar in a way that they both employ and invent models communicated through a mathematical formalism. "Model" is the key here, not mathematics.