Some say; you have to get better at your swimming technique before swimming longer distances. But others (minority) suggest that you have to develop swimming fitness before worrying about technique? Which is the right way to start?
I am going to assume that you are coming from a mostly non competitive swimming background.
There has to be a baseline of both, but I lean towards the emphasis that you need to be a fitter swimmer before you can really start effectively working on your form. Even if you do 2000 yards/meters in increments of 50 (two lengths or one lap) working strictly on form, if you don't have the fitness to swim a 200m distance, as soon as your fitness fails, your form will soon follow.
Also, there is some evidence that gross flaws in your stroke will self correct as you get fitter, so that by the time you can swim a decent distance, some of your worst mistakes will have corrected themselves. Obviously, the fine points of the stroke won't magically fix themselves, but some of the bigger flaws will.
My recommendation would be to follow a program such as the Ruth Kazez 0 - 1 mile program (6 weeks to swim 1 mile) to get a good baseline of fitness, then you can develop a program that will continue that fitness while you add in stroke refinement drills.
Good drills for stroke improvement:
However, there can be a limit to how much you can improve your stroke on your own without feedback from an instructor. Not a coach, a coach is someone who can build a workout season, an instructor teaches strokes and refinements. They can be one and the same, but often are not. For other feedback, I also highly recommend the SwimSmooth program, which is a good online resource, and there are also a lot of technique videos on youTube that you can go through.
I used to have this notion that I would get in better shape by swimming with suboptimal technique, and therefore get more resistance. My girlfriend at the time was a good swimmer and thought the idea was ridiculous. I later had a friend who was quite into swimming as well, and had to stop entirely due to some serious muscular dysfunction in his shoulder from thousands of reps of a technique that was just a bit off.
So even if you do somehow get better fitness by not worrying about technique, you're still prone to injury. Technique first is the only sensible way to go. You're not going to get in better shape if you're sidelined due to an overuse injury, and the people who are good at swimming seem to think you get the fitness from the technique.