Decision Optimization

 View Only
  • 1.  C# , Java, C++, Python

    Posted Tue February 27, 2018 01:19 PM

    Originally posted by: Bahman


    Hi everybody,

    I have been using ILOG CPLEX Studio IDE over the last year, and I would like to ask you which programming language is better in terms of the time it takes to become proficient enough to develop and run heuristics: C#, Java, C++, or Python. 

     

    Regards
    Bahman


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: C# , Java, C++, Python

    Posted Tue February 27, 2018 03:46 PM

    This highly depends on what programming skills you already have. It also depends on how fast you want the resulting code to be.

    One advantage of C#, Java and Python over C++ is that they make memory handling a lot easier (you almost do not have to care about that). If you don't know any of these languages then it may be easiest to start with non-C++. On the other hand, C++ will probably allow you to write the code that executes the fastest.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: C# , Java, C++, Python

    Posted Tue February 27, 2018 03:57 PM

    Originally posted by: Bahman


    Hi Daniel,

     

    I appreciate your prompt reply! 

    While C++ may execute the codes faster than others, I think coding in Java and C# is way easier.

    Do we have access to all callable libraries such as those of C++, for C# and Java?  Would you please advise me if C# or Java can come in handy more to implement decomposition methods or apply cutting plains, for instance.

     

    Regards
    Bahman


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: C# , Java, C++, Python

    IBM Champion
    Posted Tue February 27, 2018 04:08 PM

    AFAIK Java has access to all the same CPLEX libraries that C++ does. There are some low-level things you can do only in C (and maybe C++, using C code), but not in any of the other APIs. I've made it 20 years or so without needing any of them. I think C# has access to the same libraries that Java does.

    I code exclusively in Java (and some R), so I'm biased toward Java. That said, if you are not coming from some other programming language (such as C++), Python may be the easiest to learn. Because it is less structured (and less verbose) than Java, you can probably code up heuristics faster in Python (meaning less programmer time, not faster execution). One reason I stick with Java is that it is very good at protecting me from myself. Things that would raise compiler errors in Java will fail silently in Python. For instance, if "foo" is an instance of a Java class with a field named "bar", typing "foo.bar" is fine, but if I type "foo.bear" either the IDE or the Java compiler will complain. In contrast, if I type "foo.bear" in Python, Python will think I want to attach a new field named "bear" to "foo", and will incorrectly assume that I know what I am doing.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: C# , Java, C++, Python

    Posted Tue February 27, 2018 04:22 PM

    Originally posted by: Bahman


    Dear Prof. Rubin,

     

    I appreciate your prompt reply! I have read several of your posts on applications of Java such as the one associating with Bender's Decomposition. Most probably, I will be opting for Java or C#. 

    Regards
    Bahman


    #CPLEXOptimizers
    #DecisionOptimization