Live data from Hacker News

Code != computer science

ultrasaurus.com

71–80 of 148 posts

Re: Code != computer science

#71
post #54
post #20

I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. There can also be a bit of an attitude, like the person is thinking "of course this is good, I we…

> I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. I would have ignored your comment were it not for you mentioning that you write javascript. I s…

> What the hell was I smoking when I wrote this? I can't even read it myself.

It's what you get for being lazy (non judging here, I'm guilty of it too) and not naming your variables accordingly. When you write the code you probably know what ndi, q, p, lnk, etc. are supposed to mean. But then you leave the code for some time and when you return you are lost. Just write out variable and function names so that your code reads like english - programming Obj-C for some time really helped me there :)

And with pointer-heavy code I tend to create aliases for offsets so I don't have to write out things like *(q->lnk+!dec) every time I reference that specific address.

Yes, maybe it will cost me wizard points with colleagues because they start to understand my code but my sanity is it worth to me ;)

(Also trailing/leading underscores are the devil!)

Re: Code != computer science

#72

Speaking from experience, this is true. You also don't really know when true CS is useful until you run into it. I graduated with the equivalent of a minor in CS. When I started coding for an web-based gaming start-up in 2007, it was mostly irrelevant. You don't need a CS degree to learn Ruby on Rails, nor is it necessarily useful (beyond your basic intro courses) to have taken CS courses. Flash-forward a year, after…

These "hardcore" problems like AI and pathfinding are definitely tough problems. The issue is that there's an infinite supply of such problems and there's no way a 4 year degree can cover them all. In fact, even if they did, most lessons would be forgotten before they could be proven useful in the real world. Why not just learn these areas when needed? Taking an Advanced AI course in just a 2-3 month semester is how…

While it's true that there is an "infinite supply of these problems", a good CS program it's supposed to teach you how to think, hence teaching you how to learn.

If you have a very solid understanding of the fundamentals, you should be able to go and solve problems you've never seen before. If you don't, you could be stuck using other people's solutions to your problems, hence not being able to solve new ones that you might encounter.

Re: Code != computer science

#73
post #54

Earlier quoted context omitted.

> I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. I would have ignored your comment were it not for you mentioning that you write javascript. I s…

> What the hell was I smoking when I wrote this? I can't even read it myself. It's what you get for being lazy (non judging here, I'm guilty of it too) and not naming your variables accordingly. When you write the code you probably know what ndi, q, p, lnk, etc. are supposed to mean. But then you leave the code for some time and when you return you are lost. Just write out variable and function names so that your cod…

I'll confess, it is deliberately obfuscated. *(q->lnk+!dec) and the like were originally written in macro.

Re: Code != computer science

#74
post #54

Earlier quoted context omitted.

> I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. I would have ignored your comment were it not for you mentioning that you write javascript. I s…

What I find when I work with "pointy" data structures is that it really, really helps to draw diagrams to clarify your thinking. I can write a doubly-linked list extraction with my eyes closed (and it'd probably help to do it with closed eyes, since I can more easily picture what's going on) but it very likely won't look anything like yours... what's dec for? And all the extraneous underscores in the variable names,…

One underscore indicates a pointer, two indicates a pointer to pointer.

Re: Code != computer science

#75
post #20

I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. There can also be a bit of an attitude, like the person is thinking "of course this is good, I we…

The more you get exposed to other people's code, the less likely you are to dismiss it as bad immediately. Your first impressions are built upon what styles of coding you're already familiar with, and aren't to be trusted as an objective measure of whether the code is maintainable. In many cases, what you might think is a good practice is really just a fashionable one, and holds little engineering value when examined carefully.

After enough projects, you get used to navigating codebases that are layered with multiple styles and grungy bits from years of effort. At that point, you have some hope of knowing what can and can't be maintained.

Re: Code != computer science

#76
post #56
post #54

Earlier quoted context omitted.

> I look at this from the other side as well. I've worked with brilliant people with ivy league CS degrees who wrote much messier and less maintainable code than me, an autodidact designer/js dev with 1.5 years of experience. Maybe I'm wrong, and there was something in their code that I wasn't seeing, but I don't think so. I would have ignored your comment were it not for you mentioning that you write javascript. I s…

So you never told us what you were smoking.

I cannot remember, but it was damn good stuff.

Re: Code != computer science

#77

Earlier quoted context omitted.

The code was a little convoluted, but those comments totally cleared things up.

Sure, "/* ie. dec==_DEAD_, no which ain't it not worth man */" really cleared things up.

If you think that snippet was bad, you should see the rest of it. It covers nine files and around 500 odd lines.

Good practise though.

Re: Code != computer science

#78
Well, it's true. Code is not computer science any more than paint and brushes are artistic paintings or nuts and bolts mechanical engineering.

People learn what they learn, formally or informally, and then they either develop a passion for what they learned, or not. Not everyone who studies art can produce artwork most would enjoy, much less a masterpiece. And, in this regard, having encyclopedic knowledge in the field isn't a solution.

What I am saying is that it is about the person, not the encyclopedia. Developing artistry requires knowledge, passion and dedication. Knowledge alone isn't the entire equation. Knowledge without passion and dedication is useless, no matter where it comes from. And this might very well be the reason a lot of CS grads falter.

Re: Code != computer science

#79

Speaking from experience, this is true. You also don't really know when true CS is useful until you run into it. I graduated with the equivalent of a minor in CS. When I started coding for an web-based gaming start-up in 2007, it was mostly irrelevant. You don't need a CS degree to learn Ruby on Rails, nor is it necessarily useful (beyond your basic intro courses) to have taken CS courses. Flash-forward a year, after…

These "hardcore" problems like AI and pathfinding are definitely tough problems. The issue is that there's an infinite supply of such problems and there's no way a 4 year degree can cover them all. In fact, even if they did, most lessons would be forgotten before they could be proven useful in the real world. Why not just learn these areas when needed? Taking an Advanced AI course in just a 2-3 month semester is how…

Surprisingly many problems are similar, so in the end you can often apply the methods from one domain to another. If you use your study time well you will remember the general principles even though you might forget the exact implementations and most of the details.

Most importantly, you have a much greater chance of knowing when a solution exists and where to look for it, and more importantly know when no solutions are known.

E.g., the computer scientist recognizes the travelling salesman problem even when it doesn't involves salesmen, travelling or cities. She knows that it's NP-hard so she doesn't spend a few months trying to find an efficient exact solution for her millions of nodes, but she knows where to look to find "good enough" solutions for the problems she is trying to solve.

The autodidakt might not even recognise his problem as a TSP and thus doesn't even know that her problem is hard and which books she needs to start reading.

Re: Code != computer science

#80
post #31

Earlier quoted context omitted.

People in academia simply don't care about the quality of one particular implementation of their ideas. There's no value judgement here, it's just not their job to write and maintain good software. Just as it's not a mathematician's job to maintain a cryptographic protocol or a physicist's job to keep a satellite in orbit. The people who went to schools with strong research programs are trained by people in that mind…

While I'm following you ideologically, I'm not sure that this idea bears fruit in evidence. The computer science community still uses large numbers of algorithms (via libraries) that were written by academics, in peer-reviewed journals, in Fortran, in the 1970s. Even currently, a tremendous amount of the cutting-edge work in optimization and others is done at the university level: METIS for graph partitioning, and co…

Have you ever seen Hinton's code before? It's all Matlab :) And when you are designing/prototyping algorithms, that is quite good enough.
Post reply on HN