# Shared Code

One of the best parts of using the same language for the front-end and back-end is that you can share common code between them with very little extra effort. Instead of needing to write -- for example -- your validation code twice and then maintain both copies identically over time, you can write it once and never worry about having to deal with differences between code.

Nodewood has two main focuses for shared code: models and form validation. Models are essentially simple entity objects with no database access, but can contain common calculation code that you might want to use in multiple places. Form validation can be done both in the browser and behind the API, giving you a good balance between responsiveness for the user and security on your API.

That said, you don't need to limit your shared code to just these two examples! There is a common /lib folder that can be accessed globally, and you can create a lib folder in your features as well, to help you organize shared code within features.