Only an attorney is licensed to advise you on the advanatges and disadvantages of filing bankruptcy.
From a lending standpoint, the impact will be significant. All borrowers who have a bankrupcty discharged fewer than four years are ineligible for a loan delivered to Fannie and Freddie. This will lock you out of the low rate market for half a decade.
FHA insures loans made to borrowers with discharged bankruptcies in as few as two years provided the borrower can demonstrated the bankrupcty was due to circumstatnces outside the borrower's control such as job loss, major health problems, or death of a co-borrower.
In any event, you must have re-established credit with no lates and no collections for at least a year to be considered for a Fannie, Freddie, or FHA loan AFTER the 4 year period has passed.
There is no guarantee that Fannie, Freddie, and FHA won't chnage their guidelines. Just last month, Fannie and Freddie chnaged the seasoning time on foreclosures from 4 years to 5 years for a primary residence and 7 years on a second residence or investment property. If the foreclosure crisis leads to a wave of Chapter 13 filings, it is very likely that Fannie and Freddie will lengthen the time after bankruptcy before accepting a loan.
Even if all conditions above are met, banks can impose their own restrictions on top of Fannie, Freddie, and FHA guidelines. I heard today from a collegue whose borrower was denied for an FHA insured loan bya particular lender due to 3 late credit card payments in the 8 years sine the borrower's Chapter 7 filing was discharged. Obviously this lender is much more risk averse than FHA guidelines require, but FHA only insures loans made by banks; it does not lend.