Are any of you guys neurotic? (Are all of you neurotic?)
I'm super neurotic. And I fear that, more than it helping me to program well, it gets in my way. I am obsessed with doing things the right way, and I begin to feel very uncomfortable if something I'm working on is becoming too complicated in the wrong way -- but somehow I'll be completely oblivious to how overblown my "clean and modular" solution ends up. But sometimes, the solution isn't obvious to me -- so if something is really stumping me, it eats my productivity and prevents me from feeling good about my work.
How do you deal with this? What general rules do you follow, and what do you do to put your mind at ease? For one thing, I'm thinking of getting a fish to put on my desk so that I can unload my stress on him.
Name:
Anonymous2010-07-08 13:53
I have a field of points and a vector in direction which the point field will be moving. I want to generate a bounding box around the field in such a way that the box's front and sides are aligned with the vector and its perpendiculars. It's driving me crazy that the only way I can think to do this is to iterate through all the points and use a lot of vector projection math, and that I'd have to do this every time I'd need to use a bounding box which is every time something represented by a field of points needs to move.
I can get so obsessive about my shit that i refuse to eat, or sleep or even my other duties and if i do sleep, my subconcious still keeps thinking over this problem, but not in the cool "im in the matrix way" but just the same feeling echoing i have at day.
When i have problems i think for days about my shit without results mostly, even knowing what i will gain nothing of it, i just cant stop thinking.
Reduce salt consumption and you'll get less neurotic.
______________________________
(\_/) This is Bunny. Copy and paste
(='.'=) Bunny into your signature to help
(")_(") him gain world domination
When you've been a programmer for a while, you usually start to see where some solution may be, ah, problematic. For instance, I can immediately see the problems involved in venting on a fish.
Name:
Anonymous2010-07-08 22:41
>>1
Always happened exactly the same for me. If I somehow get the impression that what I'm working on has become impure, I can't set upon anything else until I figure it out.
Do the very simplest thing that could possibly work.
That attitude has always helped me, take it easy, premature optimization is evil. It's a way of life, don't build anything for the future, even if you know you will need it, when the future comes, it'll be much clearer what you need and more often what you don't need.
>>16
Are you implying that this fish idea is actually a second problem?
Name:
Anonymous2010-07-09 16:03
>>1,17
Yeah, I get this also. I've been working on a side-project and I have spent *a lot* of time refactoring it over and over just trying to get a style and architecture that makes sense to me. I don't have enough experience with this stuff to understand how to do it properly.
The best solution I've found to keeping it under control is YAGNI (you ain't gonna need it). Basically exactly like >>19 says: do it in the most straightforward way possible, even if it leads to some dirty code or a small amount of duplication. Only refactor it if it starts being a big problem.
The only thing I don't agree with >>19 is that it's not a matter of optimization. I'm not trying to make it fast; I'm trying to make it clean, where clean is ill-defined. I only know that it's dirty when I look at it. That's the root of the neurosis.
I'm not neurotic, I'm just very, very good and have an eye for details. I alternate between designing clean, perfectly structured programs and hacking together the most ``clever'' code I can manage as my fancy strikes, though the latter only on personal projects.
For work I put some effort and research into a clean start and flexible design, but if some of the pieces won't quite fit towards the end I often just jam them in instead of backtracking and trying for perfection.
>>22,24
Actually this is the other "best solution" to the neurosis is to code for someone else; when you're on the clock, and programming someone else's ideas instead of your own, you just get shit done and don't worry too much about how dirty it is. I work in the industry and unless you're building rockets, it pretty much works like that. When it's your own code and your own time though, it's a lot different.
>>29 I work in the industry and unless you're building rockets, it pretty much works like that.
Don't project your own incompetence onto the world at large, Leah.
>>32
The real anus poster at least has the decency to sage.
Name:
Anonymous2010-07-10 18:32
* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g
o \ \______// _ ___ _ (_(__> \ | o
a \ . C ___) ______ (_(____> | / a
t /\ | C ____)/ \ (_____> |_/ t
s / /\| C_____) | (___> / \ s
e | ( _C_____)\______/ // _/ / \ e
x | \ |__ \\_________// (__/ | x
* | \ \____) `---- --' | *
g | \_ ___\ /_ _/ | g
o | / | | \ | o
a | | / \ \ | a
t | / / | | \ |t
s | / / \__/\___/ | |s
e | / | | | |e
x | | | | | |x
* g o a t s e x * g o a t s e x * g o a t s e x *
I'm trying a new strategy where I work the whole thing out on paper. It's hard to do that because I find the class/object diagrams tedious and unhelpful, as well as some flowcharts -- but my theory is that problems like these most often lie in the design, not a detail of the implementation.
I'm also going to start keeping a journal that I post in only when I'm feeling this way, so that I can get a better idea of what the problem domain is. I know that these sorts of issues feel very particular to the case at hand, but I have a suspicion that there are some very general trends to what sorts of problems cause these feelings of anxiety; identifying this will be helpful because not only will it add familiarity to the problem, it will also provide general guidelines for the solution (which also, in the moment, seem highly specific to the case).
Both of these strategies are not novel. The first is common in the enterprise and the second is common among good creative thinkers of any kind. But only recently have I realized that I'm keeping myself in the dark by trying to suss these things out in my head, rather than plotting them on paper.
Name:
Anonymous2010-07-10 23:07
>>41
Yes and no. You should, of course, write clean and well structured code, but you shouldn't make it more complex than necessary right at the moment. Liek, don't create factories for simple objects, not matter what "future changes" you have in mind, just don't do it, if it isn't necessary.
>>45
Only if you are using a crippled language like Java. ;_;
Name:
Anonymous2010-07-12 3:13
>>21
>The only thing I don't agree with >>19 is that it's not a matter of optimization. I'm not trying to make it fast; I'm trying to make it clean, where clean is ill-defined. I only know that it's dirty when I look at it. That's the root of the neurosis.
i suffer from this as well and it stops me from ever getting anything done.
i keep trying to tell myself that perfect is the enemy of good but anything not perfect is, as far as my brain is concerned, garbage...
>>47 not a matter of optimization. I'm not trying to make it fast; I'm trying to make it clean
That's still optimization, you have something that works, but you're trying to make it better - optimization.
Name:
Anonymous2010-07-12 11:09
I do the "First it runs, THEN it runs better" approach, too, and while it has its advantages, you'll sometimes find that if you'd gone for the Best Practices approach from the start, shit would've been easier.
>>49
My fear with that is that I spend too much time conforming the code to best practises over getting to run well (if even runs at all). I've found it much easier to do prototypes then reimplement it to something I could be proud of.
Name:
Anonymous2010-07-12 13:14
The problem with cheap solutions of mine it that i often dont design a framework/interface and the face lots of trouble when i have to bring my programs in some state.
Name:
Anonymous2010-07-12 17:28
I have a minor problem where I try to make things 'clever' and I'll sit there planning and coding ignoring other tasks until I'm satisfied.
This probably has something to do with rhe large amount of Java boilerplate code that I had to write in a previous life and saying 'This is easy so why does it take so many lines of code to express it?'
The fact that MS has created LINQ makes this problem even worse as I'm doing a pretty large C# project atm.