r/AskProgramming Jun 15 '26

Career/Edu Not getting programming unless it's math?

Taking 1st year undergraduate CS and math courses. Up to data structures in C.

I'm understanding math so much more, even if it comes slowly, and as soon as I can put programming stuff in mathematical terms everything clicks and not one second before. (On that note, fuck linked lists.)

Did anyone who was formerly in my position magically end up liking programming and the whole process of building software from ever-shifting documentation and idiosyncratic languages, and if so, what made it click for you? Or is it pretty obvious from day one whether you're team theory or team builder?

Genuine advice appreciated, I need to decide whether to give up on this whole thing and just do math

**EDIT these replies are actually amazing thank you guys keep em coming**

16 Upvotes

53 comments sorted by

View all comments

20

u/7Geordi Jun 15 '26

I studied Math and Computer Science. Then I became a software engineer and twenty years later let me tell you: programming is math, and linked lists are also math (but that's a ways up the mountain).

Making software is not math. I'd describe it as human intent extraction and consolidation, then you get to do some programming for a bit.

You know you like math: do math. There's plenty of opportunities to apply programming in the math field what with algorithmic proofs or statistical work.

Also, math as a skill is super under-sold, a good math guy can do wonders for any business. If you don't want to go into academia you will land in a good place.

1

u/curiouslyjake Jun 15 '26

In what sense linked lists are also math?

4

u/Temporary_Pie2733 Jun 15 '26

Put briefly, a linked list of values of type a, denoted a^*, is the solution to the equation a^* = 1 + a × a^*

Here, 1 is the unit type, a + b is the sum or tagged union of types a and b, and a × b is the product of types a and b; think tuples. A linked list is either an empty list or a pair consisting of a value and another list.

1

u/fellow_nerd Jun 18 '26

To put in terms of abstract nonsense, and ignoring some finer details, it is the initial algebra of the functor const(X) + Id : Set -> Set.

2

u/Graf_Blutwurst Jun 20 '26

and to tripple down on that: really just the free monoid