Both of you using MDF for shelves - I'd use ply. Less saggy, less heavy, less horrible dust. Takes paint just as well - maybe better on the end grain once sanded.
What would be your method of fixing ply shelves to the sides of a bookshelf. The MDF shelves we have a just screwed straight through from the outside. I imagine that would split ply.
Correct size of pilot drill and hole depth for your screw with accurate perpendicular drilling and you can screw into the edge of 12mm ply or thicker. 3.5mm screws for 12mm, 4.0mm for the rest.
Both of you using MDF for shelves - I'd use ply. Less saggy, less heavy, less horrible dust. Takes paint just as well - maybe better on the end grain once sanded.