Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Greg Kitchin
Greg Kitchin
31,138 Points

Commonalities in programming

I'm writing my own small programs to help consolidate my knowledge, but want to write up some notes of the basic elements that are common to all languages, such as loops, conditions, data types (lists, dictionaries etc) functions/classes, etc, and have them nearby so I can refer to them at a glance. Then, hopefully take the same approach to other languages (currently doing Python, though I've done some Java in the past).

So what elements are common to all languages then?

1 Answer

Daniel Vigil
Daniel Vigil
26,473 Points

I have found programming languages to be similar in almost every way except for the syntax in which the language is written. The languages I have worked with, all have variables, methods, flow control, class definitions and with OO languages the basic format to objects. Their only difference seems to be the syntax. For instance, in Java you create a variable by declaring the datatype, in JavaScript you declare a variable with the keyword "var", while languages like Python and Ruby you can just name a variable.

You can get into more specifics about what is under the hood of the language and why each one requires the syntax that it does but I think if you can get an understanding of general functions like loops, conditions, math functions, comparison functions, functions/methods, classes and Object Oriented programming you will find it to be a lot easier to jump into new languages by focusing more on how the language needs to be structured for those basic elements.