Live data from Hacker News

Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

news.ycombinator.com

61–70 of 309 posts

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#61

Earlier quoted context omitted.

This remains a serious problem on my team- Over half my team members don’t have CS degrees. They get an enormous amount done, but there is often a perf or maintainability cost. I have no intention of swapping them out because they ultimately provide enormous value, but it’s noticeable.

Is it the algorithmic efficiency that's the problem, or the ability to scale the application? I've seen things some people wouldn't believe. mod_perl 1.4 on Apache 2.0 handling 350,000 hps dynamic traffic on twenty archaic 1U's. Five tiers of caching, serialized objects on local disks, NFS in production. C-beams glittering in the dark near the Tannhäuser gate. Who cares about inefficiency if it scales?

Putting aside the damage that issues with correctness can cause, the problem is exactly that if you e.g. wrote something that grows with n^2 instead of n log n, you cannot scale by "brute force" anymore, as the inefficiency very quickly outgrows the amount of resources you can add. Seriously, your thinking that "algorithmic inefficiency" can be countered by "scaling" is almost proving the point.

CS is by far not just about runtime complexity, but it's one thing that can bite you.

Also, all the components you mentioned were likely written, at least in significant parts, by people knowledgeable about computer science.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#62
post #41
post #31

Thank you to everyone who has replied to my rant. I felt of low value for not being able to provide immediate help for most of the problems that she's being taught to work on. Some of the examples (since some of you were asking for them): https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... I realise that I may have written my original post a…

Is there a particular part of these problems that is stumping you? Perhaps breaking them down into smaller sub-problems? Where is it something else? Based on your original description I was expecting something more heavy on straight CS theory. “how do you sort an unordered binary tree in place“ kind of thing.

> heavy on straight CS theory. “how do you sort an unordered binary tree in place“ kind of thing.

I was having a related conversation earlier, and feel like I'm reprising the same argument for a new audience, but... I don't see what is either Computer Science or theoretical about that. It seems like an eminently practical task: Handling things in a tree structure, sorting items, and doing work in-place to conserve resources are all very concrete, real-world aspects of writing software. You might not need them in _every_ case, but they aren't really "theory" in any real sense.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#63
post #44
post #31

Thank you to everyone who has replied to my rant. I felt of low value for not being able to provide immediate help for most of the problems that she's being taught to work on. Some of the examples (since some of you were asking for them): https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... I realise that I may have written my original post a…

What exactly did you have trouble with? These really are simple problems, all you need are an understanding of loops, ASCII character codes, and basic arithmetic. To be honest, I'm surprised a seasoned developer of 5+ years can't do these, or at least have a decent stab at them.

We probably underestimate how many people out there are just copy/pasters. No offence OP but I hope you dont work on anything that handles money/user data/requires security.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#65

Think of it this way: application development, software engineering, and computer science (and data science and ... etc) sometimes use the same tools but are all different disciplines. Universities traditionally focused on Computer Science and their graduates would often need a lot of grooming before they could really be independently and reliably productive in the commercial words of application development or softw…

seconding this, creating value is orthogonal to knowing CS. see the creator of homebrew, Max Howell infamously failing to invert a binary tree in an interview: https://mobile.twitter.com/mxcl/status/608682016205344768?la...

I have yet to see a definition of what “invert a binary tree” even means.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#67
post #31

Thank you to everyone who has replied to my rant. I felt of low value for not being able to provide immediate help for most of the problems that she's being taught to work on. Some of the examples (since some of you were asking for them): https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... https://github.com/cs50/docs/blob/master/_pages/2018/x/psets... I realise that I may have written my original post a…

Just FYI, you may want to hang on to your LUHN algorithm implementation - I’ve had to do that for work several times. That’s actually pretty real-world relevant.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#68
post #50
post #44

Earlier quoted context omitted.

What exactly did you have trouble with? These really are simple problems, all you need are an understanding of loops, ASCII character codes, and basic arithmetic. To be honest, I'm surprised a seasoned developer of 5+ years can't do these, or at least have a decent stab at them.

I just replied above, but I've never been amazing at being able to figure out how I should be using for loops to solve problems quickly and efficiently. I do tend to make things harder for myself, as my boss and fianceè have told me before. I usually end up with a very convoluted solution which I end up coming back to and refactoring the next day.

I was actually going to recommend exactly that - I find that, when I have a problem that I’m having trouble solving, just brute-forcing the damned thing helps me focus on the hard parts of the problem, and then I end up rewriting things in a “better” way that I’m actually not ashamed to put my name to.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#69
post #12

I heard somewhere that a computer science degree is actually a history degree in how we have solved problems in the past. Programming is a creative problem solving process, but certain problems took decades to solve and it’s only by knowing the history that people are able to resolve some of these hard problems. Don’t beat yourself up for not knowing all of history and give yourself a break for not being able to imme…

Knowing things like binary trees, heaps, B-trees, queues etc. are not history. They are fundamental to writing applications. Using one data structure or a particular sort method will make your application much faster. Supposed you have had a billion elements to sort, but you knew every element in that array is between 1-100. I mean a bucket sort would be much much faster than using a quick sort.

You are, in this case, better off just using the ultimate bucket sort: shove it into a histogram.

    hist = [0]*100
    for x in xs:
        hist[x-1] += 1
Epsilon algorithmic knowledge required.

Re: Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

#70
post #50

Earlier quoted context omitted.

I just replied above, but I've never been amazing at being able to figure out how I should be using for loops to solve problems quickly and efficiently. I do tend to make things harder for myself, as my boss and fianceè have told me before. I usually end up with a very convoluted solution which I end up coming back to and refactoring the next day.

I was actually going to recommend exactly that - I find that, when I have a problem that I’m having trouble solving, just brute-forcing the damned thing helps me focus on the hard parts of the problem, and then I end up rewriting things in a “better” way that I’m actually not ashamed to put my name to.

Correct first, then simple and fast later. With more experience you'll be able to devise simpler, correct first solutions that you can then speed up later.
Post reply on HN