Is there any expression/phrase which means 'thinking way ahead and into unnecessary details'.
An example would be a person thinking about the what color the doormat would be even before buying a house.
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
This is called overthinking, as in you're overthinking things. It's a form of obsessing, as in obsessing over details.
In software development, there's premature optimisation, which is the mistake of trying to preempt bottlenecks and avoid them. It's better to write clean code, and later use testing to find any actual bottlenecks and fix them.
There's also the acronym YAGNI: You Aint Gonna Need It.
Always implement things when you actually need them, never when you just foresee that you need them. -- Ron Jeffries
You can also say something like avoid getting into the long grass, but the long grass just refers to the intricacies. It doesn't imply there's anything spurious in thinking about them.
If you mean someone is kind of daydreaming and not being very practical, you could say that he or she is building castles in the air.
Fig. to daydream; to make plans that can never come true.
The Dictionary.com entry for castle in the air states:
a fanciful or impractical notion or hope; daydream.
*Note: I'm in the U.S., and I am not familiar with the other idiom listed in the Free Dictionary entry (build castles in Spain.)
There are a couple idioms in English that get more or less at the heart of what you are trying to say. However, I can't think of any one idiom that is perfect.
Basically, what this means is that you are putting things in the wrong order. This could be due to confusion about cause and effect, but it also covers situations where you are focusing on the details in the wrong order.
This idiom does not speak to the level of detail. For example, designing a moon rover before designing a rocket would be putting the cart before the horse.
This means that you are focused on unimportant details for something that's going away. For example, re-writing the source code for a program that deprecated.
This has a negative connotation, and implies a waste of time and effort. However, sometimes, I've heard this idiom stretched to mean focusing on small details of a process that may or may not come to fruition.
This idiom addresses the case when you start working on X, which is dependent on Y, without knowing that Y is actually going to happen.
Too clever by half--the phrase means way too smart for one's own good, to the extent that the smarty outwits himself. The phrase illustrates an odd British convention re: the word 'half'. 'By halves' means incomplete or or only done halfway. In the singular 'by half' it means considerably or a great deal. (New York Times language column by the late William Safire). The phrase was coined, according to Safire, by British writer George J. Whyte-Melville in his 1958 novel 'The Interpreter'.
What you described in your question sounds generally to me like "worrying" or "ruminating," although this gives it an anxious connotation which might not apply to your context.