Hacker News new | past | comments | ask | show | jobs | submit login

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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: