r/coding • u/Denommus • Jun 12 '12
"The Dharma of Programming". Had this idea yesterday, at night, and thought it was a good start for my blog. Please, criticize
http://dharmaprogramming.wordpress.com/2012/06/12/the-dharma-of-programming/6
u/jredwards Jun 12 '12
I read the post and I'm not sure what your idea was.
-3
u/Denommus Jun 12 '12
Well, if I have to explain later, I have failed to express myself.
Only to be clear to you: I was trying to create a "problem solving" philosophy for programmers.
5
u/name_was_taken Jun 12 '12
Haha, as if the world was ever that 'obvious'.
Right View: understand the problem and the cause of it. Please. This is the most important thing. Don’t try to solve a problem without understanding it.
Sometimes, the best way to solve a problem is to dig into it and attempt to solve it. This will eventually lead to understanding. But if you refuse to dig into it until you understand, you may waste a lot of time or never get anywhere.
5
u/bushel Jun 12 '12
Agreed. Like how the best way to learn is to teach, sometimes the best way to understand is to solve.
1
u/Denommus Jun 12 '12 edited Jun 12 '12
You are right and I'll revise it. But the main idea will keep on: you must understand the problem. When you dig, you are making your part for understanding it, and the problem will only be solved after you finally understood it.
If something is "solved" and you don't understand why, it is not solved at all.
EDIT: revised.
4
u/bushel Jun 12 '12
Programming is a craft. As such it is part engineering and part art.
As far as engineering is concerned, if it is "solved", it matters not if you understand why. A working machine is a working machine.
(Of course that lack of understanding will hamper you if it fails again later)
3
u/Denommus Jun 12 '12
I disagree.
I agree that programming is part art (there are infinite ways of solving even the simplest of tasks), but it is also an exercise of problem solving.
If you are doing a math test, and you get to a right result using the wrong methods, were you right or lucky?
2
u/bushel Jun 12 '12
I think of it subtly differently...not as problem solving, but as "explaining"
thea solution to a problem. Of course that pre-supposes you've solved the problem before you can "explain" it to the computer.And, I reiterate, it's engineering, not math. If it works, it's right. Lucky or not. If it works using the "wrong" methods, it's still "right". Math has only one correct method, so "right" and "wrong" are clearly defined. Engineering can have many "right" solutions, so long as the end-result does what was intended.
3
u/Denommus Jun 12 '12
I understand your point. But I still think a solution that you do not comprehend is only a time bomb.
3
u/bushel Jun 12 '12
Of that I completely agree with you.
But now we're talking about methodology, not results.
3
u/Denommus Jun 12 '12
A methodology aims to some result. If the result is unpredictable, it's a bad result.
4
u/bushel Jun 12 '12
Agreed. An unpredictable result is basically useless (unless you're building a randomness generator, heh). But an algorithm that gives correct results but is not understood is still correct. Unmaintainable, not-provably-correct, etc, etc, but still right
As example I submit: genetic algorithms. Often we don't understand what it's doing, but it does provide reliable results.
3
u/Denommus Jun 12 '12
You are making me see this as something much more complex than what I had in mind.
That's why I love programming. :)
→ More replies (0)
5
u/phao Jun 12 '12
I learned a lot. I learned that programming is difficult because it's difficult.
Thoughtful.
-1
6
u/bushel Jun 12 '12
1
2
1
u/fuzzylollipop Jun 13 '12
There is a lot of wrong thinking here in that blog post, it is proven that the way to solve the really hard problems is to NOT think about them.
This reads like someone with just enough experience to be dangerous in that they don't know what they don't know. Come back and read your post in 20 years and you won't think it so insightful or philosophically correct.
1
u/Denommus Jun 13 '12
it is proven that the way to solve the really hard problems is to NOT think about them.
Could you provide some sources? It would be really interesting if I learned it, because I never heard about it.
Come back and read your post in 20 years and you won't think it so insightful or philosophically correct.
Probably. The main lesson of my life is that I am, and always will be, dumb. But this won't stop me from thinking. ;)
0
Jun 12 '12
[deleted]
1
u/Denommus Jun 12 '12
In which stage I seem to be? Abstraction freak? I'm a little bit, but I try not to be too much. I understand that abstraction is only useful when the code in question is going to be reusable. Coding too much without needing it only makes the code too complex.
When I talk about design principles, I'm talking about this, too. Excessive abstraction is a design flaw, too.
2
Jun 12 '12
The Guru
Distinguishing code features: Only writes in dynamically-typed languages with a strong functional component.
Hahahaha.
2
u/richy_rich Jun 12 '12
Nice link, I've seen that before but on reading it again I feel that you need to go through all 5 of those stages and settle upon being a bit of all of them in varying quantities.
The excitement of being a newbie and playing with new things is awesome, if I lost that I'd give up tomorrow. The other points all stem from that, the experience of having been through the process before helps certainly, but you always keep learning...
0
Jun 12 '12
[deleted]
3
u/Denommus Jun 12 '12
Thank you. English is not my native language, so I may make some mistakes.
Thanks for the suggestions, I'll try to arrest me to the facts on future posts. This first post was experimental, and I wanted to see what people would think about it.
0
Jun 12 '12
[deleted]
1
u/Denommus Jun 12 '12
Corrected. Thank you.
1
u/InfernoZeus Jun 12 '12
It says 'understandedood' or something now :P
1
u/Denommus Jun 12 '12
It was an accident. I corrected it some seconds before your comment. See it again.
2
7
u/[deleted] Jun 12 '12
Real world business code often goes to shit because of changing requirements - not really because the design is fundamentally flawed. The design fit the original spec. Didn't fit the changes. The cave collapsed, and we call died a little inside :(