Live data from Hacker News

Algorithms.js – Atwood's Law applied to CS101

github.com

21–30 of 36 posts

Re: Algorithms.js – Atwood's Law applied to CS101

#21
post #17

Earlier quoted context omitted.

What percentage would you say are clueless about CS101 basic things?

I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).

This seems high...I just went through a bunch of front end web developer interviews and nearly everyone I was asked some algorithm or data structure question. Maybe it's just NYC or maybe it's where I was applying.

Re: Algorithms.js – Atwood's Law applied to CS101

#24
post #17

Earlier quoted context omitted.

What percentage would you say are clueless about CS101 basic things?

I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).

That maybe used to be true, but these days that's absolute incorrect. A lot of non-Web developers are becoming "web developers", because such a large percentage of new software is written for the Web.

Re: Algorithms.js – Atwood's Law applied to CS101

#25
post #15

Why not try to implement the iterative O(ln(n)) Fibonacci from SICP (Ex 1.19), rather than the old O(n) one? Or the Matrix exponentiation solution (he'd probably want to implement iterative matrix exponentiation too... doesn't look like he knows clearly how to do this)? https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form

Considering that the Fibonacci sequence is exponential, and hence the Nth Fibonacci number contains O(n) digits (well, in any sane base at least), you cannot compute the Nth Fibonacci number in under O(n) time.

Given the guys programming in Javascript and not using arbitrary precision arithmetic, he's always using 64 bits and representing his numbers as floating point, so I don't think you are reasoning correctly about the asympototic complexity here. I mean, if you really want to argue this, then to quote Leibniz: "Calculemus!"

The javascript solution presented does everything in O(n) arithmetic operations, and the SICP way does it in O(ln(n)) arithmetic operations (actually, there are a lot of ways to do it in O(ln(n)) operations).

Re: Algorithms.js – Atwood's Law applied to CS101

#26
post #21

Earlier quoted context omitted.

I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).

This seems high...I just went through a bunch of front end web developer interviews and nearly everyone I was asked some algorithm or data structure question. Maybe it's just NYC or maybe it's where I was applying.

It's likely an artifact of the jobs you're applying for but also consider that they're might be asking those questions now because in the past there were too many applicants who weren't qualified. It's only been fairly recently that front-end development has been taken more seriously as an engineering discipline.

Re: Algorithms.js – Atwood's Law applied to CS101

#27
post #11

Earlier quoted context omitted.

There are a couple of GCD algorithms that have better asymptotic performance than Euclid's (an old one is due to Knuth): http://www.ams.org/journals/mcom/2008-77-261/S0025-5718-07-0... I'm surprised the author didn't implement the binary gcd, however, although it has the same big-O as Euclid: https://en.wikipedia.org/wiki/Binary_GCD_algorithm

I've been doing this sporadically and in my free time, just for fun, so there are a lot of fundamental things that haven't been covered there. :)

I do this sort of thing sporadically in my free time too... it's still good to go back and do stuff smarter when you learn better rather than accepting whatever they taught you in CS101 as the end of the story.

Re: Algorithms.js – Atwood's Law applied to CS101

#29
post #25

Earlier quoted context omitted.

Considering that the Fibonacci sequence is exponential, and hence the Nth Fibonacci number contains O(n) digits (well, in any sane base at least), you cannot compute the Nth Fibonacci number in under O(n) time.

Given the guys programming in Javascript and not using arbitrary precision arithmetic, he's always using 64 bits and representing his numbers as floating point, so I don't think you are reasoning correctly about the asympototic complexity here. I mean, if you really want to argue this, then to quote Leibniz: "Calculemus!" The javascript solution presented does everything in O(n) arithmetic operations, and the SICP wa…

[deleted]

Re: Algorithms.js – Atwood's Law applied to CS101

#30
post #26
post #21

Earlier quoted context omitted.

This seems high...I just went through a bunch of front end web developer interviews and nearly everyone I was asked some algorithm or data structure question. Maybe it's just NYC or maybe it's where I was applying.

It's likely an artifact of the jobs you're applying for but also consider that they're might be asking those questions now because in the past there were too many applicants who weren't qualified. It's only been fairly recently that front-end development has been taken more seriously as an engineering discipline.

I get the feeling these days most JS developers at least professional ones aren't totally clueless about algorithms and data structures.
Post reply on HN