I have run Ubuntu for several years in both dual boot and VM configurations, so I'll offer my experiences.
I just want to know, what are the disadvantages of using Ubuntu in
VMware rather than then dual booting it? Does Ubuntu get restricted
under VMware?
It depends on what you intend on using your machine for. At home, I dual boot Ubuntu 14.04 with Windows 7, because I do plenty of gaming on both. Gaming consumes a lot of your system resources. And in a VM, it's important to remember that your video hardware will be by-and-large emulated via software. Try playing Minecraft on an Ubuntu VM, and you'll see what I mean. VM technology has come a long way, but video-intensive applications still run better "on-the-metal."
At work as a developer, I run Windows 8 with Ubuntu 14.04 on a VM. I do this because there are Linux-based applications that I need to use and run (for my job). And those tools are usually run in conjunction with Visual Studio projects. So I do a lot of quick switching between Windows and Ubuntu, and that is just not possible with a dual-boot configuration.
if I install codeblocks for Ubuntu (installed through virtual machine)
and then shutdown the OS. If I start Ubuntu once again, will code
blocks still be present inside Ubuntu?
Yes, your Ubuntu VM will store its data on a virtual disk. Your apps and data will still be there, just as if you had installed Ubuntu as a standalone OS.
Important to note, but your VM will be restricted only by the resource limits (RAM, disk, etc...) that you configure it with. Of course, if you give it too much, your host OS will suffer.