Should I resubmit a rejected paper to the same journal? Suppose you submit a paper and it is rejected with no suggestion of resubmission, but there is substantial feedback. Do you fix up the paper, based on the feedback and resubmit? Or fix it up and submit to another journal? What heuristic do people use, if any? Or is every case different?
I had a bad experience a few years ago. Briefly: Paper rejected after 1 yr. Fixed it up, resubmitted. Major revision decision after 6 months. Fixed up, resubmitted. Rejected again after another 6 months. This literally went on for years, and was quite, quite horrible. The original draft was in pretty bad shape, in hindsight, which partly explains it, and I'm more experienced now. I guess it was one of those character-building experiences.
However, I'm wondering if on balance, if the journal doesn't want it, whether it is better to cut your losses and move on?
For the record, I'm leaning in the direction of submission to another journal if initially rejected without the suggestion of resubmission. If the journal suggests resubmission, I suppose it is a more ambiguous situation.
It depends on the reason for rejection.

If a paper is rejected because it's off-topic, it's not really interesting, it's not really new, etc.: then perhaps you were too ambitious.  A paper may be perfectly written and the science may be very decent, but still rejected from Nature, because its impact is not really large enough.

However, if a paper is rejected with a motivation like this topic would fit our journal, but some major aspects are missing in the study, and they are so grave that we choose to reject, then you can start over and submit a fixed study.  In fact, I have the impression that some journals that have fixed deadlines for revisions, will reject if it is deemed unrealistic to submit the revision in time.  Otherwise, there could be a huge difference between the submission date and the publication date, and that isn't beneficial to anybody.