Hacker News new | ask | show | jobs
by kamaal 1595 days ago
The real question is in asking, what are you going to use the programming language to build?

If you are going into a Math heavy domain, you are going to use a programming language to solve math problems, and hence involves learning Math.

This the same problem, with whiteboard leetcode style problems in interviews. Most people fail to understand why they have to put in months to years of practice into a domain to which doesn't concern with their everyday work.

On the other hand there is tremendous shortage of people with skills for real world problems and applications.

1 comments

Yeah. I've been writing code as a job for a decade now and have never needed to factor a quadratic equation. I really just needed a course that helped me get introduced to programming (which I ended up using a LOT in the domain I went to school for: geography and remote sensing).

(Every time I write something like this I immediately feel defensive about being an impostor. Someone saying, "how can you not know that? You should know that. You must not be doing _real programming_.)

I have been thinking about it too. I think you definitely need people who are more algorithmically inclined in software, but you also need people who can "engineer".

My current take is that the tech industry is so young that we are still struggling with proper definitions of titles and division of labor.

In my experience, after school I could do all the hard mathy/algo/data structure things, but I had no idea what REST even meant. So all startups instantly rejected me, while FAANG was very excited to have me. I felt like a huge imposter also, because if I were smart, how come I didn't know all the cool stuff that people at hackathons know.

Thank you for sharing. I love this comment because it feels like you and I are opposite sides of the same coin.

When I graduated I had no clue how to correctly statistically validate a complex robotically collected set of bathymetric data or how to mathematically explain Universal Kriging. But I did know how to design and build the data collection workflow, web portal, processing software, and PDF generation. So I was ridiculously effective at my job, but any time I was near the other roboticists, I felt like an absolute fraud. They'd be writing algorithms and formulas on a whiteboard and it was all Greek to me.

I think you are describing two different activities.

You can make something, and

You can engineer something.

If what you are building is a complex distributed software system, if you are not aware of algorithms and the implications they have on the system, then you are not engineering, you are just making. And whatever it is you are making is going to fail a lot sooner that if you were aware of the algorithms and the implications.

You would be surprised by how easy a system designs itself according to it's constrains.
> Yeah. I've been writing code as a job for a decade now and have never needed to factor a quadratic equation.

A lot of people never touch algebra again.

Some of us end up touching it a lot.

This is a bit of a tricky thing, in that:

- A whole lot of practitioners have very limited continuous math and deep CS needs, so some of these requirements are artificial barriers to some extent for many jobs.

- But is it reasonable to give them CS degrees without at least basic competence?

- Plus, part of the point of a university education is to round-out students and expose them to many things...

> - But is it reasonable to give them CS degrees without at least basic competence?

Yes, when we truly understand "competence".

A lot of "math" as talked here, is not part of what make a programmer competent FOR programming.

It only make you competent for THAT segments of math.

That is something that many has a hard time understanding: Programming is NOT math. Equally as math is NOT programming.

If you are studying FOR programming/CS, math is ASIDE. Is not the focus.

Similarly, if you are FOR math, programming is ASIDE. Is not the focus.

> A lot of "math" as talked here, is not part of what make a programmer competent FOR programming.

Basic algebra is quite useful. It's reasonable to expect most programmers to be able to do simple algebra when it comes up. There's a whole lot of reasons:

- Analysis of algorithms and work done generally involves manipulating algebraic expressions and factoring.

- Reordering numeric expressions in code means understanding the composition of operations and invertibility.

- A whole lot of work can often be avoided by being able to derive an equivalent expression.

Yes, continuous math isn't "CS math" but it's a reasonable thing to expect a programmer to be competent in.

> Basic algebra is quite useful

Similar, Perform music is too. And learn about accounting. Or law.

But IS still "aside". Sometimes, here in THIS function, I need to apply to algebra. But that is not the majority of the tasks, neither, learn algebra help me much about the whole endeavor (maybe only if I'm building an algebra library).

> but it's a reasonable thing to expect a programmer to be competent in.

Any person too?, maybe. I heard identical arguments in other fields. No joking, even in a law firm.

Curiously, by people that probably are better at THAT that the actual problem they have, in their niches, where -despite not be my job- I could have better idea...

> But that is not the majority of the tasks, neither, learn algebra help me much about the whole endeavor (maybe only if I'm building an algebra library).

Sorry-- I completely and totally disagree with you. The core things I learned about mathematical structure in algebra classes have informed my entire programming career: pure functions, commutativity and associativity, factoring and composition. Both discrete and continuous math are necessary to be a computer scientist. Yes, you may be able to do some things without them... but you're going to be limited.

> Any person too?, maybe. I heard identical arguments in other fields. No joking, even in a law firm.

Algebra is basically required for a secondary education at this point, let alone college. Yes, it has broad applicability. Even in law: we expect many lawyers to be competent at calculations that are best addressed with algebra.

If you want to learn to program go to a bootcamp or a 2 year college program. A degree in CS should be about much more than programming.
> A degree in CS should be about much more than programming.

Sure, but CS is still about "Computing", not algebra or calculus!

We're basically talking about machines that are the embodiment of applied mathematics. Yes, a lot is discrete, but a lot is very well approximated with algebra and algebra is an important tool to have at hand when tackling discrete math.
To be clear, this course was exclusively "CS for NON CS/math majors." If you were in CS, you were not allowed to take it.

They also offer a lot of "math for non mathies" courses, which would have been a great place to teach quadratics.

Yes, but I doubt you had write code to factor a quadratic equation because it's a solved problem and you have libs that will do it for you.

Imagine if you had been given an exercise of such a low level nature for every single topic you might touch in IT in the future. You would have had to code a function to do UTF8 decoding, JPEG rendering, TCP/IP error correction, font rasterization, ray tracing, PEG parsing, an USB driver, data diffing, model training, etc.

Also, you don't learn much about programming by creating a function to factor a quadratic equation. You seldom learn about types, side effects, algo complexity, or even about collections, iteration, branching, memory, debugging, etc.

You just learn to badly translate a very specific, narrow problem to the language you use.

> Yes, but I doubt you had write code to factor a quadratic equation because it's a solved problem and you have libs that will do it for you.

Actually, I have, because I've done a fair bit of embedded development and "toss this massive lib on" is not always a reasonable solution. Inferring the structure of plant in controls is often a polynomial factoring problem and it's not something that one tosses Singular or FLINT at on small hardware. But aside from that...

Factoring a quadratic by hand is something I expect a CS major to know how to do, because they might very well be doing algebraic manipulation to develop solutions to real world problems.

And someone who knows how to factor a quadratic by hand knows a number of formulaic (suboptimal) steps to perform it-- the exact kind of things that's easiest to translate to code before you have gotten into that mindset of explicit thinking.

So--- declare and manipulate variables to do the quadratic formula. OK, what if we want to confine ourselves to integers, what can we do? Can we loop and search solutions in some meaningful way like a human would?

It's a completely reasonable space to explore as an early programming problem for someone who's familiar with it.

I'm teaching a secondary student to program right now. In his core math class he's doing a lot of trig. In turn, we're doing a whole lot of exercises like "make these dots chase the other dot using atan2 and sin/cos".

> Actually, I have, because I've done a fair bit of embedded development

Can't argue there :)

> Factoring a quadratic by hand is something I expect a CS major to know how to do

Agreed, I'm more concern about teaching programming while asking such a task. Once you have solid foundation, you can have valuable insights by doing this exercise about float based maths, moving variables around, naming things, translating maths to code. But before that, I think it would hinder learning.

> And someone who knows how to factor a quadratic by hand knows a number of formulaic (suboptimal) steps to perform it-- the exact kind of things that's easiest to translate to code before you have gotten into that mindset of explicit thinking.

I disagree, because it takes 2 abstracts things and mix them together. It's a harsh first step. As a teacher, I get better results when I map coding to some concrete reality first. Later on, yes, you can mix.

> I'm teaching a secondary student to program right now. In his core math class he's doing a lot of trig. In turn, we're doing a whole lot of exercises like "make these dots chase the other dot using atan2 and sin/cos".

This is what I'm talking about. I have terrible results with those for anybody who doesn't really love maths. But creating small games and analysis the text of their favorite song are instant hits.

> This is what I'm talking about. I have terrible results with those for anybody who doesn't really love maths. But creating small games and analysis the text of their favorite song are instant hits.

He def doesn't love math. But he just finished the swarm thing and it's awesome.

I can't think of a single time I've needed to implement a linked list but knowing how to do it is still useful.

A quick search tells me that factoring quadratic equations is covered around grade 8 or 9. I'm guessing that the instructor assumed that everyone would have enough math to know how to do this or quickly refresh their memory so they could focus on the programming aspects and not the problem solving.

> Yes, but I doubt you had write code to factor a quadratic equation because it's a solved problem and you have libs that will do it for you.

It is not totally unreasonable to expect students in an intro to CS course to have some basic competency in algebra (university dependent). Giving them a problem in a domain they're already familiar with (or that where familiarity can be expected) lets them, in theory, focus on the algorithm/data structure side without having to also be taught the domain. Most of the exercises in a first CS course are solved with libraries (standard in some languages, or 3rd party in others). That doesn't mean it's not useful for developing the knowledge the course is aiming for.

Do you also think we shouldn't teach arithmetic and should only teach using calculators? (You may, actually, I know people who think that way.)

No, but I do think an intro to programming should be done without math. You can mix them later, once the students know what's up.
It's silly to make a universal statement like that, that's why I qualified it in my own. Whether or not math should be present in the assignments depends on the university and the background of its students. MIT's SICP could use calculus in its course because the students were either also in calculus or had already taken calculus when they got to the course. It was expected in their situation. Waterluvian, helpfully, clarified that the course they were talking about was for non-CS majors, so whether or not a basic algebra concept is appropriate would depend on the background of those non-CS majors. Are they all STEM majors or 99% STEM majors? Then you can assume they know algebra. Are there more humanities and arts majors? Then you can't, or shouldn't.

Besides, most intro to CS courses also include basic algorithm analysis (that may not be true for the non-major version of the course) which means the course will require the use of at least arithmetic, probably some algebra, and some basic calculus. So why not write programs that make use of math when you're already assuming the students are competent in basic math?

At least at the universities I was familiar with, a non-major first CS/programming course was generally targeted to STEM, but not CS, majors, so again familiarity with algebra would be a reasonable assumption (at GT, these were taken by the various engineering majors and used Matlab as the language of instruction, I think they previously offered Fortran).

Is factoring a quadratic equation supposed to be some example of some obscure math principle that is useless?

I feel like I'd be more on board if you said something like "compute an integral", etc. Factoring is just.... a single equation.

>Is factoring a quadratic equation supposed to be some example of some obscure math principle that is useless?

I've been a successful software engineer for over ten years, yet without looking it up, I don't even know what "factoring a quadratic equation" means, let alone how to do it.

It's from high school algebra, it's a specific instance of "factoring" where the equation has the form: ax^2+bx+c=0 and you want (x+r_1)(x+r_2)=0. "factoring" is the general process of finding what things multiply together to produce a term. Which is where we, in software, get the notions of "factoring" (described well in the context of Forth with Thinking Forth or Starting Forth, can't remember which, maybe both) and "refactoring".

Code refactoring and factoring in algebra are related in the sense that they aren't meant to change the system (that is, its meaning or behavior), but instead are meant to change its appearance. In particular, in the above, if you can factor it out you end up with the two roots (what I termed r_1 and r_2) of the equation, which are useful for various other things.

> "factoring a quadratic equation"

This is hard to understand because it doesn't make sense. Quadratic polynomials (or more generally, algebraic expressions) are factored. Equations are not factored.

?

x^2 + 2x - 3 = 0 = (x+3)(x-1)

This is not factoring?

It's something you learn in middle school or high school math. Pretty good bet that a college freshman would be familiar with it.
It's a single equation taught in high school. I'd expect nearly every adult who'd been through high school to know it or at least have basic familiarity.
I expect you're relatively young. I know what you're talking about but don't remember exactly what it looks like and doubt I could derive it--and probably haven't used it in decades.
I’m not young but HN has an international readership and you have to factor in that for people coming from countries where a heavy focus is put on mathematics the average level in the US is hard to fathom. I learned how to solve quadratic equations during my second year of highschool and by the end of it I could basically do it in my sleep, same things with basic derivation. It’s the same for everyone around me.

The idea that you might not know how to do it as someone working in a STEM related field wouldn’t come to me.

This is not an international difference, everyone coming out of a non-urban public school system will know how to factor a quadratic equation. It is typically taught year 1 of highschool.
Don't look at me; I have a PhD in CS but it took me four semesters to get through the required two semester calculus course as an undergrad. (Fortunately, the linear algebra course was mostly matrix algebra and logic and I are best buds.)
> I have never needed to factor a quadratic equation

I think this very much depends on what you end up specializing in. I bet a lot of the code we write every day has a dependency buried somewhere where all sorts of equations end up getting factored.

Yes, saying "I have never needed to factor a quadratic equation" is akin to saying "I have never needed to fly on an airplane".

Both statements can be true, but neither negates the utility of the activity.