You can tell the safe/desirable neighborhoods by getting a good neighborhood map (http://en.wikipedia.org/wiki/List_of_Manhattan_neighborhoods) and paying attention to which neighborhoods CL ads lie about being in (for instance, in Brooklyn, it's common to see ads for apartments that are physically in Gowanus saying they're in Park Slope or Carroll Gardens instead).
Astoria is relatively cheap (as noted above) and safe; other nearby neighborhoods in Queens can be even cheaper, if not quite as safe (Sunnyside, Long Island City), and if you are commuting to midtown (or in my case, not commuting at all) you're looking at <30m.
IMO, Brooklyn apts tend not to have the same value, taking safety and commute time into consideration, but plenty of people would argue with me on that point.