I want to buy a digital piano and would like to sometimes play with some DAWs. I have already an audio USB interface, where I can connect a MIDI device to my PC. A lot of digital pianos don't have MIDI IN/OUT ports. So what is the basic difference between a MIDI and an USB connection? Or maybe there is none? A piano with which port would you recommend me to buy? Thanks for any help!
PCs have never had genuine MIDI ports built in. They used to have MIDI adapters that worked on the joystick port, but now almost everything is connected by wireless or USB.
I wouldn't be concerned about whether a reasonably good quality keyboard had MIDI cable or USB connectors - though if it only has MIDI you will need a MIDI-to-USB adapter to connect it to a PC.
The "problems" with MIDI-over-USB are mostly caused by cheap and nasty interfaces (for example the very cheap ones you can find on Ebay) not by the technology itself. USB is much faster, and just as reliable as a MIDI cable. An external disk drive with a USB connection transmits data thousands of times faster than a single MIDI instrument with no problems!
If you want to use very long cables, for on-stage work for example, MIDI might be a better option. The USB specification gives the maximum cable length as 5 meters (about 16 feet) for USB 2, and 3 meters (about 10 feet) for USB 3. To extend that range reliably, you need to do it "properly" by chaining USB hubs together or using "active" (or "repeater") cables. In theory, good quality MIDI cables should work fine up to 50 feet, but in practice 20 feet is a safer limit.
Don't even think about trying to use a wireless connection (e.g. Bluetooth) to replace the cable - even if it doesn't lose or corrupt the data, there is no guarantee that the timing will be accurate.
Midi is a serial connection over current loop at 31250bps. If you are using anything but the cheapest Midi cables, the connection is ground loop free. When connecting your keyboard with analog connections to an amp or mixer, this can make the difference between clean and disturbed audio.
USB has by far the larger bandwidth. However, it is an encapsulation of the Midi protocol into a bus protocol with dedicated host and clients. That means that all your connections will likely have to run through your computer. Again, not much fun if ground loops are a problem, and sometimes you just want to set up things without fiddling with a computer.
If you just want to input Midi data into a DAW or notation program or expander software or sequencers on your computer, USB is mighty fine. It might even power your keyboard.
For actual audio generation and band usage, the absence of a bare Midi connection can be a nuisance, even given its lacklustre speed.
Cheap Midi-to-USB adapters (notorious are the ones with a violin clef printed on them and OEMed by everybody) will garble messages, in particular Sysex messages. Stay away. Old "Full Speed" USB 1.1 adapters at 12Mbps are still so much faster than the end connections that they are fully sufficient (even when sharing a hub and a USB 1.1 extension line with a DAW controller though not an active audio card), and if you get long-past "high-end" equipment from reputable companies, chances are that they are quite affordable second hand.
MIDI port because if you want to connect to sound module or other gear, well it'll need to be MIDI. USB is fine for PC and nothing else, otherwise you'd need to start buying USB-midi adapters too.
Proper MIDI ports all the way ;)