I am studying software development and I need a laptop which can survive around 4 / 5 hours or more of coding(using internet,stackoverflow,codeblocks/visual studio etc).I also consider learning the Swift language(I heard that it is hard to do without a mac) but I am not 100% sure about it.I have around 1300-1600 dollars(1000-1250 euros).So I will be glad to hear your recommendations on what should I look for. :)
It's going to be difficult to find laptops that have a 4/5 battery life without sacrificing on performance. I have decided to curate 3 laptops an I think you'll see that it may be worth it to go for a slightly cheaper option that has much more performance. As a student it would be strange if you were to be in a position to code without any power near by (library, cafes, etc) unless you explicitly tried to code somewhere without power.
You also stated that you wanted the laptops to cost less than 1,300$ USD, but since I am recommending laptops that you can purchase today to be shipped to Bulgaria, I had to use the exchange rate: 1.3k USD -> 2,063.75 Bulgarian Levs.
XPS 13: Long battery life at the cost of performance
лв 2,068.97 at newegg, MSRP лв 2,483.46
This XPS 13 configuration has a 7200U processor. If you're not familiar with the Intel letter system, U stands for power saver, which means that the processor is designed for long battery life instead of performance. It also features 8gb of DDR3 RAM and a 128 gb ssd. It has no dedicated graphics card which will also help for longer battery life. This laptop is in common use by university engineering students in the US (usually in it's more powerful, less battery efficient variants in order to support 3D modeling).
According to this review:
The XPS 13 9370 with 1080p non-touch screen lasted 12 hours and 37 minutes on the Laptop Battery Test, which involves continuous surfing over Wi-Fi.
ASUS Zenbook Pro: Long battery life, High performance, Bigger cost
лв 2,987.85 at newegg, MSRP лв 3,586.17
This laptop features a much more powerful i7-7700HQ Quad Core. It also features a PCIE NVMe 512 GB SSD. If you don't know PCIE ssd's are dramatically faster than traditional ssd's (up to speeds of 1+ gb/s read/writes) which will make heavy applications visual studio load much faster. It also comes with a thunderous NVIDIA GeForce GTX 1050 Ti 4 GB which will make any 3D/game programming a breeze. It also features a generous 16gb of DDR4 ram which have feature slightly faster RAM timings that allow for faster application load in (iex. visual studio).
In addition this laptop features an 8-cell Li-ion battery, which will help with battery life. According to this review:
Asus' notebook endured for 7 hours and 38 minutes on the Laptop Mag Battery Test, which involves browsing the web continuously over Wi-Fi.
MSI GL62M: Best performance, Lowest cost
лв 1,580.99 at newegg, MSRP лв 2,054.99
This laptop is the cheapest laptop among the 3, and has arguably the best components for the best value. It features a high powered Intel Core i7-7700HQ Quad Core, and additional discrete graphics card -GeForce GTX 1050 Ti 4 GB GDDR5, 512 GB M.2 SATA SSD (a little bit slower than PCI-E), as well as 16 GB of DDR4 RAM.
As an additional note, this laptop will have the best keyboard among the 3 choices, as it is a gaming laptop, featuring MSI's signature anti-ghosting steel series keyboard. I personally own the GS-60 Ghost, and can say the keyboard is very good for a non mechanical keyboard.
In terms of battery life the MSI is going to fall back, but in exchange you'll be packing a punch in performance and price.
According to this review:
The laptop lasted only 3 hours and 33 minutes on our battery test, which consists of continuous web surfing over Wi-Fi at 150 nits of brightness.
I highly recommend option 3, but if you absolutely demand a 4/5 hour battery life, you might as well buy a portable battery for laptops like one of these, and it will still be cheaper than the 2 options.
Special Considerations regarding Mac based application development (Swift)
You've probably noticed that I didn't recommend any Macs. This is because they are not as "friendly" to application development as other operating systems, and tend to be overpriced if you buy them specifically for the hardware that exists in them. I personally program using the Xamarin technology to create universal, cross-platform mobile apps, but this requires me to have a mac available to even build and test the iOS version of my universal app. In order to get around this I use a Virtual Machine emulator, specifically VM Player with a special patch which allows me to run a mac virtual machine on windows. This site offers a guide on how to do this.