While the traditional view of marriage before pregnancy is prevalent, I believe that pregnancy can be a valid reason for marriage.
Ultimately, the decision to get married or have children should be based on individual circumstances and what works best for you.
Having children before marriage also represents a potential instance of irresponsibility. Most childbearing occurs without the consent of one or both partners, and therefore the choice to marry often leads to unsuccessful outcomes. Childbearing should be a conscious decision, not a situation imposed by force, simply because it requires a degree of responsibility that both parties must commit to, rather than a unilateral decision.