Art of programming

Started by
8 comments, last by Kylotan 18 years, 4 months ago
Just something that has been bothering me for a while. What is programming all about from the point of view where people consider themselves good. Is programming all about memorizing code if we cast aside the fact that it's a good idea to know how it works in general? If that was the case it would be much easier to code from a reference. Which could be done without any knowledge at all, any clueless person would make it, isn't that kind of frustruating to you? especially when the most of the people in a forum like this are spending much time and energy on programming. Don't you agree that the main point in programming is the art of memorizing code and use it, discuss I really need to know anyones point of view on this one :)
Advertisement
I think its good to know both.
- GDKnight
Quote:Original post by password
Is programming all about memorizing code if we cast aside the fact that it's a good idea to know how it works in general?


No! That's exactly what programming isn't about. Programming is all about the thinking and being able to look up what you do not know. A good programmer's got experience with programming, he's knowledgable of how to do things and has practiced programming for a long time.

Quote:If that was the case it would be much easier to code from a reference. Which could be done without any knowledge at all, any clueless person would make it, isn't that kind of frustruating to you? especially when the most of the people in a forum like this are spending much time and energy on programming. Don't you agree that the main point in programming is the art of memorizing code and use it, discuss I really need to know anyones point of view on this one :)


No, I don't agree with that. And I don't think anyone here does. Sure, it is much easier to code from reference, in fact, it is almost impossible to program without it. Every "great programmer" (whatever that means) is using reference almost all the time.

And having a reference and being able to read it really isn't all. [smile] You need to understand it and from the information you've gathered from it into a usable program. Saying that having a reference is all you need is like saying that having a dictionary is all you need to be able to speak some language. It's quite a lot similar here in fact. For instance, I am not a native speaker and I assure you I wouldn't be able to type all this, even with the help of whatever dictionaries there are, if I didn't know the English grammar. Same with programming — reference is completely useless to you unless you know how to program.
Maybe one facet of programming is learning patterns, or approaches so to say. A problem presents itself for the first time and you're baffled. When you solve the problem and come across the same situation, you already know of one way to solve it. This time, you'll most likely find some optimization to your solution which makes it smaller, more elegant, faster, whatever. With time, you know more and more patterns, including bigger and bigger patterns that are made up of - now trivial - smaller patterns you learned earlier.

I'm not strictly talking about design patterns here, there are a lot of common solutions we tend to find and reuse, from below the idiom level up to the architectural pattern level, regardless of what kind of programming language we speak.

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
You're confusing beeing 1337 with actually being able to write code.
As a programmer I create something. Ok, detailed parts of that stuff is used zillion times before, especially in form of widely known alogrithms. But also words are used zillion times before, nevertherless an author may be successful with writing a new novel.

IMHO programming has to do with memorizing solution patterns, yes. That is something I would name "programming experience". It definitely helps to progress faster. On the other hand, programming is also assembling all the little details to a whole, making them fit to build up an application, finding a working solution.

In this sense it is easier for a talented artist than for a programmer: All people see the colorful pixels and hear the beating sound, but nearly nobody sees the (hopefully) elegant code.

So no, I definitely disagree w/ password. Neither it is possible for a clueless person to program (I don't mean a "hallo world" order program) nor am I frustrated in this sense. Without meaning that people are clueless if asking something here (I've 22 years experience in programming and still learn nevertheless), but how could a forum like GDnet live if programming is that simple?

[Edited by - haegarr on November 30, 2005 9:21:04 AM]
Painting is not about putting colored liquids onto a canvas. The paint and the canvas are coincidence; they are merely the tools used to perform painting.*

Programming is not about typing magic words into a computer. Code is a coincidence; it is merely a tool used to perform programming. Programming is in the mind.



* Some postmodernist will probably disagree with me. I'll defend against this with the blanket assertion that "modern" art is not painting, it's putting colored liquids onto a canvas.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

So much could be and has been said elsewhere about programming. Paul Graham really glorifies our trade.

I would say that with the best references, most complete docs, and widest aray of very well flushed out examples, it still comes down to sharp intuition and an ability to discern myriads of overlapping patterns. These skills are not something you can "cheat" to gain.

Now, to be fair, there are two distinct approaches to programming. One kind of programmer likes to hop in, and just get it done, writing a stinky pile of hacks that conform to the fractal-like complexity of the other API. He is concerned with making FOO do X and proceeds to do what he can to make that happen. He benefits greatly from every single little bit of reference assistance that he can get, and also benefits from a detailed memorization of how a specific API does things. My old boss was one of these guys. Absolutely brilliant at producing useful work. But, it was shocking how bad he was at designing anything.

The other approach is probably too abstract. This programmer knows that he's already seen a solution to a certain kind of problem before and is mostly concerned with defining what his problems are. An understood problem is a solved problem. He wishes to reduce patterns down to unique atoms that can be applied, so that the program is 100% original stuff for that program, with no fluff from reproducing similar structures everywhere. I've usually been one of these guys... and the problem is....

Programming is very ugly. It wouldn't be ugly if

1) you knew what your program was going to do 100.000% before you wrote a line of code.
2) and you were writing 100.000% of the code that your program relied upon.

But you can't do this. It's too much work. The OS API is ugly because it hides ugly hardware hacks. So far, the best way that I have found to code stuff is to go through the process they teach you in school. Write the ugly hack code, and do it quickly without much concern for the future. Clean it up, abstract patterns out of it. Repeat. This way, you are only abstracting where you actually need to, and your patterns always reflect your real world use for that particular application or kind of application.

Many great programmers use documentation or reference books when they code. Some don't need to unless they get really stuck. It's just all about how much time you put in and how well you know certain topics. A lot of people can program. Some use their memory and some use the references. I guess it's just a matter of how good you are at a certain API or topic. If you are comfortable than you can just blaze through the code.
I like to think of programming as a craft. I don't think it's worth considering it an 'art' as that leads to missing out on crucial scientific principles that go towards making correct and robust software. On the other hand I don't think it's an exact science, and it certainly isn't 'engineering', as the requirements and materials are so much more fluid than a typical engineering project, not to mention that we don't have any methods that are close to being optimal for the production of software. So what you have is something in between, where it helps a lot to know the formal properties of the things you are using, but the ability to think laterally and sculpt the result in an individual way is also massively important.

This topic is closed to new replies.

Advertisement