By all means, if you like mBed and use one of the few boards that are well supported, use it.
I have tried to use it with STM32 Nucleo boards and they were not supported at all for several months at first, despite shipping with the "mBed supported!" logo and once they got supported, many peripherals are not. Like USB on STM32F042 or F103 (not sure which one anymore).
Re code size - I have tried to do a very simple thing, initialization of I2C and getting data from a peripheral. The code ended up more than 2x in size and not fitting into my target MCU when compiled using mBed and their libs than when I have used something like libopencm3. Heck, even the version using ChibiOS was smaller - and that included an entire RTOS! The problem is their dependence on the uber-bloated HAL libraries from ST for the STM32 code, so even if everything else is equal, their generated code is always going to be larger.
When I have mentioned Arduino, I did not mean the IDE. The Arduino "IDE" is so basic that almost anything is better than that. What I meant was lack of basic things like debugger support, semihosting, access to map files to see what is taking the most space, etc. Someone coming from an Arduino will not miss those things, because they have never had them and probably are not even aware that such thing does exist. However, for a more experienced developer those things are usually indispensable time savers.
Heck, even the programming by dragging and dropping the built file - that is a cool feature for a newbie not having a debugger/programmer (even though all STM32 boards come with STLink built-in and JTAG/SWD dongles cost few bucks on eBay ..), but over time it gets really annoying when you have to rebuild the code many times while debugging.
If I have a normal programmer connected to an
offline IDE, I just push a button and the code is flashed and ready to debug. With mBed it requires at the very least downloading and saving the file, opening an Explorer window, dragging the file there, praying that it actually flashes (the STM Nucleo boards tend to flash once and then you need to unplug and replug them before it works again otherwise it silently fails. Yay!
) and only then you can start testing the code. It is not much, but all the extra steps waste time and it accumulates ...
Now, I know that one can export the mBed project and take it to an offline IDE, but I have never really managed to get that to work all that well. Moreover, the mBed libs are not open source, I believe, so you get only a binary blob that may or may not work and then you are screwed.