If I remove one device and connect another one, I noticed that the
newly connected device will not take the name of the removed device,
but will use the alphabetically following device name.
No, that depends on timing and if ANYTHING has the old device open. On my system, if I insert a USB key, remove it, and reinsert it after a few seconds, it will probably get the same device. If I mount it after insertion, and do NOT umount it, then on reinsert it will get the next device.
The letter itself isn't as crucial as the actual device major/minor. If the old one is still in use AT ALL, the kernel will use another entry.
This can be seen very evidently on SCSI/SAS tape, where the kernel expects some operations to take 30+ seconds. If the link is slightly flakey, the kernel will still have /dev/st0 open, and the hardware will still be busy when it show up again (and the kernel log will show device init as taking a long time before showing up as the next device).
From the comments, WHY do you need to predict the next device? In many cases, it's probably better to listen to udev (
udevadm monitor, or many other ways) for the next device appearing, and use that by identity, rather than any specific letter.