Maybe the most noteable difference, apart from the clear differences as pointed out by DSB and stanweld, is that B31.4 is for pipeline(s) (transportation of liquid hydrocarbons), whereas B31.3 is a piping code (which may convey all kinds of fluids). This may seem like a trivial answer, but from my POV its a big difference for starters.