The simple answer to this is that it depends on the language and the size of the project. Larger projects require more RAM than smaller ones. The second part of your question, “for coding”, needs a bit more explanation.
What kind of coding do you mean?
Coding for websites and apps, graphic design, AV work, sound editing, industrial robotics… all these different tasks require different amounts of RAM for optimal performance.
Most languages will run into problems if there isn’t enough memory available to complete their task. For instance: Java will crash with OutOfMemoryError exceptions; iOS apps written in Objective-C will quit unexpectedly due to low memory warnings; Python will use 100% CPU time as it chews up your RAM.
To give you an example of how RAM affects performance, let’s take a look at the following computer specifications for different tasks:
Web browsing makes very little use of your hard drive or CPU, but it makes significant demands of your RAM. More RAM = faster loading times and less lag while scrolling.
Mobile app development can be intensive on both your CPU and your RAM. Graphics-heavy apps require more memory to handle the larger files sizes they need to process. However, high-quality sound or video editing doesn’t make much demand either and relies mainly on the speed and stability of the hard drive (but does require a lot of processing power). For this reason, we can see that mobile apps don’t always require as much RAM as other programs.
Some languages are more RAM intensive than others. C#, Java, and Objective-C all use more memory than Python. While it’s impossible to exactly predict how much RAM you’ll require for a given task, you can get an idea of the amount of RAM your computer will need by checking out these charts:
The first chart gives us an estimate of how many megabytes per square foot of floor space is required for standard tasks like web browsing, app development, etc… The second shows that iOS apps running on android require twice as much memory as Android devices themselves! Put simply, if you’re trying to code something big (like the full version of Candy Crush) then you’re going to want more RAM present in your device.
As a starting point, it’s generally recommended that you have at least 2GB of RAM installed in your machine for running apps and web-related code.