Live data from Hacker News

First Rule of Programming Is Don't Program

news.ycombinator.com

31–40 of 90 posts

Re: First Rule of Programming Is Don't Program

#32
This is a balance one has to make when working for someone else. Often, all of your suggestions you made end up with more limitations than freedoms.

You need freedoms within apps that are going to be around for the long haul.

Example... Do I build an app in MOSS 2007 or simply use asp.net. Ya, then comes MOSS 2010 and you need to do a rewrite, if you used asp.net then there is no rewrite needed.

Re: First Rule of Programming Is Don't Program

#33
That looks like the manager's (or any other person spending money, not writing code) point of view... In reality you missed a couple of things:

- Buy an off the shelf program and take 3 hours to read their proprietary API for extra functionality. Then learn that you cannot integrate it into the current system (because of licensing, data format, missing features). Since you cannot make changes to the off the shelf program, you have to rewrite most of the existing code, just to satisfy the programs expectation. Or spend a month writing software that does a two-way sync between the proprietary API and the current data. Then learn that the API documentation is not complete/correct, then that new versions come out once a year - whether you need a bugfix or not.

I agree with the rest though... if there is a library, use it. Pay for it if you really need it. Just make sure you can modify it when needed and that you can do what the api/docs says you can - otherwise the software you bought is worth nothing as soon as you hit a problem, or you spend more money working around the problems than rewriting the software from scratch would cost.

Re: First Rule of Programming Is Don't Program

#34
Even if it were "much faster", this isn't really the goal, because code writing is usually the quickest step; at least, it is if your employees are competent. What matters more is how maintainable your project is, and how easy it is to deploy.

I may use several libraries, but I lean heavily on platforms; for instance, I have no problem using what's in /usr/lib from a typical Linux distribution, or the Python standard library. This keeps deployment pretty simple, and I can rely on well-tested components that are widely used and unlikely to go away. The platform libraries are also usually free. And I can ask or hire anyone who knows something about them.

While I don't rule out incorporating another library, this is definitely not a rule of programming. A 3rd party library has to do a lot to justify its added deployment complexity. After all, maintainers will have to read through API documentation just to figure out what something does, and this shouldn't take more time than it would take to read through my own implementation of the functions.

Re: First Rule of Programming Is Don't Program

#37
There seems to be some tension in your argument regarding the use of code.

If everybody would reason the way you did then we'd be stuck at version 1.0 of just about everything because nobody would get off their asses to do something new every now and then.

So it's a treshold problem. At some point the tension between that which is available and that which has to be done becomes so large that someone will stand up and says 'let's fix that, once and for all'. This person will then put in an enormous amount of time on top of what it would probably have taken to fix just the original problem.

And that's exactly how progress is made in the software world.

So, the premise you make is an idealistic one, in an ideal world, such libraries and bits and pieces should be available, for sale, well documented and 100% applicable.

In reality that is definitely not the case.

You are right that many people will fall for the 'let me do that' temptation when in fact they would be better served by using something off the shelf.

To keep your engineering analogy alive: If an engineer working on a car even could go and make his own bolts then that would be the road to total madness. There is lots of standardization and materials knowledge available to 'hard' engineers that is simply not there for 'soft' engineers, and because the price of the tooling is essentially zero the threshold for re-implementation (hopefully in a novel and better way) is very low.

Maybe it's too low, but that's a policy decision, not a technical one.

And if you are not under a deadline and simple trying to get the hang of stuff nothing will teach you better than to re-implement some of the better understood algorithms, especially queues, lists stacks and so on.

These are the staple of many larger structures and to understand them well (and how tricky they are to get right) is essential knowledge.

Re: First Rule of Programming Is Don't Program

#38
If you ever want to create something better than what's out there, you'll have to program itself, and if you want to get to the situation where you can create something better than what's out there, you're going to have to do a helluva lot of programming, not just read documentation and try to fit together other's people's software with the minimum effort.

Re: First Rule of Programming Is Don't Program

#39

This is one of those mantras that I lived by when I got out of college, and then found that the reality was far more complicated than I initially believed. There're costs and benefits both to implementing something yourself and to using an off-the-shelf solution. It's a given that if you do something yourself, it will take 3 times as long as you expect, and you will be finding, tracking down, and fixing bugs long aft…

I think another point to emphasize is that using a third-party solution shouldn't in all cases be a long-term solution.

Consider keeping such a chunk of code around only long enough to get the product shipped and paying for itself. At that point, make an attempt to justify keeping it around, especially after seeing how it fits into the big picture of your product.

Re: First Rule of Programming Is Don't Program

#40
post #19
post #15

Earlier quoted context omitted.

You subscribe to the rose-colored glasses version. :) I'm sensing a trust issue or two w/r code written by others, but that's okay. In reality, while you'd like to keep your code as simple as possible, it's often impossible even to keep the simplest things simple because you have numerous bad designs from the past to use as a foundation for whatever it is you're building. UNIX? Sucks. X11? Sucks. Windows NT? Sucks. W…

Yup it is mix. You know, Life has alot of compromizes

Fortunately, academic pursuits only require compromises in terms of politics. ;)
Post reply on HN