Wednesday, April 25, 2012

Which complements Python best: Java, C, or C++?


I am in the process of applying to a Computer Science program which requires students to have at least an intro-level exposure to either Java, C or C++. I have some experience with Python and I would prefer to continue working in Python before starting another language; however, the professor said that Python was too light, i.e. "it's just a scripting language, you need to know a more robust language".



Is there really that much benefit in learning Java, C or C++ over Python?



If so, which of the three would be the best second language and why?



What concepts will I better grasp by learning Java, C, or C++ as opposed to Python? For example, here are the topics they have on the exemption exam -- which they only offer in Java or C++:



  • Basic Syntax and Punctuation

  • Reserved Words, Legal Variable Names

  • Variable Types: Built In and User Defined, Mixed Types

  • Looping Constructs: while, for, repeat

  • Branching Control Statements

  • Data Declarations: Arrays and Structs and Classes

  • Scope and Duration of Variables

  • OOP Principles

  • Simple I/O including formatting output

  • Reading and Writing to a Named File

  • Simple Recursion

  • Dynamic Allocation


Source: Tips4all

3 comments:

  1. Your direct question is "Which complements Python best?", but the implicit question seems to be "what do I need to do to deal with a twisted academia?". The answer to the latter question is Java.

    On the other hand, if you truly want a complement to Python, I'd pick the one with the least overlap with Python, while being the most useful in direct conjunction with Python.

    Of the three languages you mentioned, the one that fits those criteria best is, in my opinion, C.


    There are very few projects where the question arises "Python or C?", because they generally serve very different needs.
    The reference implementation for Python, CPython, is written in C.
    Python extensions are often written in C either for performance or for ease of integration with other non-Python libraries.


    One final thing that pushes for C: it shows you how computers actually work, instead of a very high-level abstraction. Once you're proficient in C, lots of things in higher level languages make more sense, and you can think more clearly about performance and memory implications of your programs.

    ReplyDelete
  2. I think C would be a good language to learn. Yes, it isn't OOP but in the same way you shouldn't learn only procedural languages, you also shouldn't learn only OOP languages. C is also the lowest level of the three and will give you a very good insight to how the processor actually handles your code. Also, there is something to be said of working without a garbage collector and without a nice and spiffy String class

    ReplyDelete
  3. first of all - heartily agree with aaa - Python is not just a scripting language

    I would recommend learning C - it's a much lower level than Python and gives you none of the higher level structures that make programming 'easy'.

    Building ADTs and writing functional C code really gives you an appreciation of how much work higher level languages such as Python can save us.

    Then, once you're comfortable with how the underlying concepts are built, you never need to write them again. :)

    ReplyDelete