Live data from Hacker News

The language brain matters more for programming than the math brain? (2020)

massivesci.com

291–300 of 465 posts

Re: The language brain matters more for programming than the math brain? (2020)

#291
post #285

Earlier quoted context omitted.

> Not "coding uses math", I mean it is math > I mean equivalent in the way mathematicians do That sounds like you're backing off from your original claim, probably because it is impossible to defend. That you can use mathematics to describe code doesn't seem very different from using math to describe gravity, or the projected winner in an election, or how sound waves propagate. Isn't the primary purpose of math to de…

A programmer constructs a function from some data type to another while a mathematician constructs a function from witnesses of some proposition to another? Though interpreting a CRUD app as a theorem (or collection of theorems) doesn’t result in an interesting theorem, and interpreting a typical theorem as a program… well, sometimes the result would be a useful program, but often it wouldn’t be.

Interpreting a CRUD apps (or fragments of them) as theorems is interesting (given a programming language and culture that doesn't suck)! e.g. if you have a function `A => ZIO[Any,Nothing,B]`, then you have reasonable certainty that barring catastrophic events like the machine going OOM or encountering a hardware failure (essentially, things that happen outside of the programming model), that given an A, you can run some IO operation that will produce a B and will not throw an exception or return an error. If you have an `A => B`, then you know that given an A, you can make a B. Sounds simple enough but in practice this is extremely useful!

It's not the type of thing that gets mathematicians excited, but from an engineering perspective, such theorems are great. You can often blindly code your way through things by just following the type signatures and having a vague sense of what you want to accomplish.

It's actually the halting problem that I find is not relevant to practical programming; in practice, CRUD apps are basically a trivial loop around a dispatcher into a bunch of simple functions operating on bounded data. The hard parts have been neatly tidied away into databases and operating systems (which for practical purposes, you can usually import as "axioms").

Re: The language brain matters more for programming than the math brain? (2020)

#292

Good code doesn’t just solve a problem, it solves it in a way that’s readable and modular. I think the problem-solving part of coding requires math skills, while the organization part requires writing skills. The organization part affects the problem-solving part, because if you write messy code (that you can’t reread once you forget or extend without rewriting) you’ll quickly get overwhelmed. Writing large math proo…

Most coding doesn't need much of any math past boolean logic and very basic set operations. I'm much more likely to spend my time studying DB and interface schemas to understand how something works than doing a lot of mathy fiddling. Sure, some people write game engines and such, but even much of 3D graphics doesn't need anything more complicated than the first half of a linear algebra course.

Probability is math and there you have caching, hashing, etc. Then there are permutations, combinations, etc. with a lot of usecases in software. Distributing graphs across nodes? More math.

Re: The language brain matters more for programming than the math brain? (2020)

#293

Earlier quoted context omitted.

> Not "coding uses math", I mean it is math > I mean equivalent in the way mathematicians do That sounds like you're backing off from your original claim, probably because it is impossible to defend. That you can use mathematics to describe code doesn't seem very different from using math to describe gravity, or the projected winner in an election, or how sound waves propagate. Isn't the primary purpose of math to de…

> Isn't the primary purpose of math to describe the world around us? No, that's Physics[0]. I joke that "Physics is the subset of mathematics that reflects the observable world." This is also a jab at String Theorists[1]. Physicists use math, but that doesn't mean it is math. It's not the only language at their disposal nor do they use all of math. > software engineering has nothing to do with mathematical abstractio…

> No, that's Physics

Going on a total tangent, if you'll forgive me, and I ask purely as a curious outsider: do you think math could have ever come into being if it weren't to fill the human need of describing and categorizing the world?

What would have been the very beginning of math, the first human thought, or word or action, that could be called "math"? Are you able to picture this?

Re: The language brain matters more for programming than the math brain? (2020)

#294
post #246

Earlier quoted context omitted.

Writing proofs is just as important to mathematics as writing code is to programming.

Yes it is important but that's not the point. Structuring sentences and naming variables so that it is easier for other people to understand is less about formal mathematical reasoning, and more about communication. You could name a variable x, y, or Banana, but it doesn't change the logic.

Neither is it "the point" in programming. You should be concerned with communication and have every right to get upset when someone is being needlessly convoluted but that's as much of a point in programming as it is in math, physics, or any domain.

I mean the reason we get mad at this is because it is someone destroying "society" in some sense. Even if that society is your team or just the set of programmers. It would be a pretty dick move were I to just use a word that significantly diverged from conventional meaning and expected you to mull it over. Similarly if I drop a unknown out of context math equation. It would be meaningless.

And I'm on your side, really! I strongly advocate for documenting. And let's be real, the conclusion of your argument more strongly argues for documentation than good variable names. Because variable names are much more constrained and much more easily misinterpreted considering how any word has multiple definitions. Surrounding code is often insufficient to derive necessary contextualization.

https://news.ycombinator.com/item?id=43874738

Re: The language brain matters more for programming than the math brain? (2020)

#295
> the requirements for advanced math classes for every computer science major seem unnecessary

Computer science is much more than programming - and I think that most of the value derived is from being able to think about problems, which largely require the abstract type of thinking encouraged by more advanced math. Code is just a tool.

Re: The language brain matters more for programming than the math brain? (2020)

#296

Earlier quoted context omitted.

Just anecdotally based on my 2000something kid high school, the copious amount of tiering of math classes seemed to indicate to me that either we're really bad at teaching math to 80% of people, or only 20% of people will be able to handle precalculus. We had basically 4 tracks: one ended with you doing algebra 1 in senior year, another ended with you doing trig in sr year, yet another that ended with trig (no precal…

This system sounds extremely complicated. > the copious amount of tiering of math classes seemed to indicate to me that either we're really bad at teaching math to 80% of people, or only 20% of people will be able to handle precalculus Or maybe it indicates that the people designing this system should be fired? Job security through complexity? (Or maybe I’m just biased by the system I know… I’m just asking questions)

  > … I’m just asking questions
I'm not disagreeing, but just wanted to point out that this phrasing is commonly used by bad faith actors. I'm not saying you're using it this way and I legitimately do not think you are. But I wanted to point it out because I think your comment could be interpreted another way and this phrase might be evidence for someone to make that conclusion.

The classic example is conspiracy theorists. But lots of bad faith actors also use it to create leading questions that generally ignore or lead away from important context. Again, I do not think you're doing this. The rest of your comment makes me think you're acting in good faith.

Re: The language brain matters more for programming than the math brain? (2020)

#297

Earlier quoted context omitted.

> coding and math being equivalent Please see lambda calculus. I mean equivalent in the way mathematicians do: that we can uniquely map everything from one set to another

This seems like the setup to a joke about how mathematicians don't know how to communicate to ordinary folks

Well a lot of people did wildly misunderstand the Poincare quote. To me is is obviously about abstraction and I think this is true for any mathematician. I thought it would also be natural for programmers considering we use "object" quite similarly, if not identically. So... maybe it is or maybe this is the joke.

Re: The language brain matters more for programming than the math brain? (2020)

#298

Earlier quoted context omitted.

Most coding doesn't need much of any math past boolean logic and very basic set operations. I'm much more likely to spend my time studying DB and interface schemas to understand how something works than doing a lot of mathy fiddling. Sure, some people write game engines and such, but even much of 3D graphics doesn't need anything more complicated than the first half of a linear algebra course.

Probability is math and there you have caching, hashing, etc. Then there are permutations, combinations, etc. with a lot of usecases in software. Distributing graphs across nodes? More math.

State machines too

Re: The language brain matters more for programming than the math brain? (2020)

#299
post #260

Earlier quoted context omitted.

> It's an actively stupid fiction for people who don't understand what math is. This comes off quite judgmental, and doesn't help me understand your actual point. Could you elaborate on the differences, as you see them?

In higher math (typically 2nd year and onwards at US universities) there is fairly little explicit calculation, and math is more about studying the (formal) relationships between mathematical objects. For example, we can abstractly define topological spaces and abstractly define algebraic “groups,” and algebraic topology studies the relationships between topological spaces and algebraic groups. This is somewhat like…

One personal project I'd love to find the time for is to try to write out a sequence of math notes that essentially builds up a Lean repository, intentionally "refactoring" as it goes along. So you do some explicit coordinate vector or system-of-equation calculations with both real and complex numbers, eventually define interfaces for fields and vectors, do your linear algebra proofs, realize that linear endomorphisms are almost-but-not-quite a field, so define rings and go back and refactor your field proofs to use them, realize vector spaces are "K[T] not-quite vector spaces", define modules, refactor your vector space code, etc.

This was kind of how math classes worked, but without that explicit phrasing. It would certainly make the analogy between the two activities more obvious. I also wonder whether people would have less trouble with quantifiers if they were phrased in programming terms: a proof of "forall x, p(x)" is a function x=>p(x), and a proof of "there exists x such that p(x)" is a pair (x, p(x)). e.g.

Continuity: (epsilon: R, h: epsilon>0, x_0: R) => (delta: R, h2: (x: R, h3: d(x,x_0) d(f(x),f(x_0)) Uniform continuity: (epsilon: R, h: epsilon>0) => (delta: R, h2: (x: R, x_0: R, h3: d(x,x_0) d(f(x),f(x_0)) proof of UC => C = (epsilon, h, x_0) => let delta, h2 = UC(epsilon,h) in (delta, h2(_,x_0,_))

So when you're trying to figure out how to do the proof, it's clear what kind of type you need to return and your IDE could help you with autocomplete based on type inference.

Re: The language brain matters more for programming than the math brain? (2020)

#300
post #35

And yet CS grad programs seem to care about only the math section of the GRE

Societally we made that association, so it's not the programs fault, they simply live the same world we live in. Kurt Vonnegut: See, I came up through a chemistry department. Charlie Rose: Yeah, right. Kurt Vonnegut: And so I wrote and there was nobody there to tell me whether it was any good or not. I was just making my soul grow, writing stories. There's some stuff about his opinion on training for writing that cou…

Maybe they didn’t invent the problem, but the admissions priorities are theirs to repair
Post reply on HN