We present a general deep learning framework for code. This framework tackles a wide range of tasks including deobfuscation, code completion, code summarization, and captioning. The main idea is to leverage the rich syntactic structure of programming languages to facilitate effective and efficient learning. In the talk, I will demonstrate the strength of our approach using two models: (i) our code2vec model (http://code2vec.org) that predicts meaningful method names from source code, and (ii) our code2seq model (http://code2seq.org) that predicts descriptive natural language sentences from code. Our models significantly outperform previous models that were specifically designed for programming languages, as well as state-of-the-art Neural Machine Translation models.