diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc
index a0cddbf..4762873 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -691,7 +691,7 @@
   if ((serialize_ || wcf_) && !is_exception) {
     indent(out) << "[DataContract(Namespace=\"" << wcf_namespace_ << "\")]"
                 << endl; // do not make exception classes directly WCF serializable, we provide a
-                         // seperate "fault" for that
+                         // separate "fault" for that
   }
   bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
 
diff --git a/compiler/cpp/src/generate/t_html_generator.cc b/compiler/cpp/src/generate/t_html_generator.cc
index f5185ea..8e54ac1 100644
--- a/compiler/cpp/src/generate/t_html_generator.cc
+++ b/compiler/cpp/src/generate/t_html_generator.cc
@@ -716,7 +716,7 @@
  */
 void t_html_generator::print_const_value(t_type* type, t_const_value* tvalue) {
 
-  // if tvalue is an indentifier, the constant content is already shown elsewhere
+  // if tvalue is an identifier, the constant content is already shown elsewhere
   if (tvalue->get_type() == t_const_value::CV_IDENTIFIER) {
     string fname = program_->get_name() + ".html";
     string name = escape_html(tvalue->get_identifier());
diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc
index 827af9f..b45773c 100644
--- a/compiler/cpp/src/generate/t_php_generator.cc
+++ b/compiler/cpp/src/generate/t_php_generator.cc
@@ -228,7 +228,7 @@
     return (nsglobal_.size() ? NSGLOBAL_B : NSGLOBAL) + ns;
   }
 
-  // add a directory to allready existing namespace
+  // add a directory to already existing namespace
   string php_namespace_directory(string directory, bool end = true) {
     (void)directory;
     if (end) {
diff --git a/compiler/cpp/src/globals.h b/compiler/cpp/src/globals.h
index 93d11aa..af90616 100644
--- a/compiler/cpp/src/globals.h
+++ b/compiler/cpp/src/globals.h
@@ -123,7 +123,7 @@
 };
 
 /**
- * The program level doctext. Stored seperately to make parsing easier.
+ * The program level doctext. Stored separately to make parsing easier.
  */
 extern char* g_program_doctext_candidate;
 extern int g_program_doctext_lineno;
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index 57cd460..c0166a1 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -992,7 +992,7 @@
   if (gen_recurse) {
     const vector<t_program*>& includes = program->get_includes();
     for (size_t i = 0; i < includes.size(); ++i) {
-      // Propogate output path from parent to child programs
+      // Propagate output path from parent to child programs
       includes[i]->set_out_path(program->get_out_path(), program->is_out_path_absolute());
 
       generate(includes[i], generator_strings);
diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h
index 51157aa..386f589 100644
--- a/compiler/cpp/src/parse/t_program.h
+++ b/compiler/cpp/src/parse/t_program.h
@@ -135,11 +135,11 @@
    * @return     true if a certain collision was found, otherwise false
    */
   bool is_unique_typename(t_type* t) {
-    int occurances = program_typename_count(this, t);
+    int occurrences = program_typename_count(this, t);
     for (std::vector<t_program*>::iterator it = includes_.begin(); it != includes_.end(); ++it) {
-      occurances += program_typename_count(*it, t);
+      occurrences += program_typename_count(*it, t);
     }
-    return 0 == occurances;
+    return 0 == occurrences;
   }
 
   /**
@@ -149,12 +149,12 @@
    * @return     the number of certain typename collisions
    */
   int program_typename_count(t_program* prog, t_type* t) {
-    int occurances = 0;
-    occurances += collection_typename_count(prog, prog->typedefs_, t);
-    occurances += collection_typename_count(prog, prog->enums_, t);
-    occurances += collection_typename_count(prog, prog->objects_, t);
-    occurances += collection_typename_count(prog, prog->services_, t);
-    return occurances;
+    int occurrences = 0;
+    occurrences += collection_typename_count(prog, prog->typedefs_, t);
+    occurrences += collection_typename_count(prog, prog->enums_, t);
+    occurrences += collection_typename_count(prog, prog->objects_, t);
+    occurrences += collection_typename_count(prog, prog->services_, t);
+    return occurrences;
   }
 
   /**
@@ -166,11 +166,11 @@
    */
   template <class T>
   int collection_typename_count(t_program* prog, T type_collection, t_type* t) {
-    int occurances = 0;
+    int occurrences = 0;
     for (typename T::iterator it = type_collection.begin(); it != type_collection.end(); ++it)
       if (t != *it && 0 == t->get_name().compare((*it)->get_name()) && is_common_namespace(prog, t))
-        ++occurances;
-    return occurances;
+        ++occurrences;
+    return occurrences;
   }
 
   /**
