Thread: Is There a Language I Would Love More than C++?

  1. #1
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665

    Is There a Language I Would Love More than C++?

    I've been thinking about it, I'm not sure if there's any language I'll ever be more in love with than C++. If there was, I'd like to meet it.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,561
    Pardon me, but I changed the title of this thread as the original one reads like flamebait. Actually, this revised one isn't necessarily much better, but at least it makes it clearer that you're looking at your own love of C++ and what else you might be drawn to more than C++, rather than straight out doing a language comparison war with no context.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,687
    Well, lets look at the candidates....

    Erm, well there are dozens. If you love C++, maybe go with a language that shares
    similar syntax. C#, Java even PHP has braces .

    If you really want to live outside of the comfort zone, learn the language I studied before I
    went to college.

    Ada

    Beautiful language - well designed but quite difficult to decipher. I highly recommend it.
    Double Helix STL

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    1,654
    If you want something different, there's APL (A Programming Language), from back in the 1960s.

    Youtube example: Instructional video on how to implement Conway's game of life, taking very little code to implement:

    Conway's Game Of Life in APL - YouTube
    Last edited by rcgldr; 08-05-2016 at 04:43 AM.

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    I've developed a fondness for Go. It lacks many of the features of C++ that I love (operator and function overloading, templates), but it makes up for that in a number of areas. If you haven't checked out Go, I suggest you give it a try.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  6. #6
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by MutantJohn View Post
    I've been thinking about it, I'm not sure if there's any language I'll ever be more in love with than C++. If there was, I'd like to meet it.
    What do like and dislike about C++?

  7. #7
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Quote Originally Posted by MutantJohn View Post
    I've been thinking about it, I'm not sure if there's any language I'll ever be more in love with than C++. If there was, I'd like to meet it.
    For math, Fortran.

  8. #8
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Sorry, didn't mean to make a thread that sounded like flame bait.

    I've heard good things about Go. A famous JavaScripter left Node for Go, actually. I don't blame him.

    I've thought about Ada. I looked into it a little bit but I'm not sure.

    The things I like about C++ is that it's so versatile. I think it combines imperative, object-oriented and functional paradigms very adequately. Plus, it's fast, got a strong type-system and still allows you to access low-level features. It's an all-around good tool that grows with you which is what makes it attractive to me.

  9. #9
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I've purposely tried to do more tasks in Perl, Python and C# lately. I'd say I'm used to C++ and I agree it can be useful, but I'm enjoying languages with richer libraries now. I just wish I wasn't so bad at programming so I could arrive at good solutions faster in non-C-derived languages

  10. #10
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    I've been considering Ada lately. I am getting a little past PLC programming and looking more at embedded and whatnot, and the safety aspects of Ada are attractive for that type of programming, to me.

  11. #11
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Epy View Post
    For math, Fortran.
    I've heard this before, definitely.

    Which is funny too because I've implementing some basic matrix routines myself and I've really been enjoying the C++ approach where I create a Matrix class. Using things like operator and function overloading making working with it very enjoyable. Plus, I can template it and things like enable_if checks and all this jazz.

  12. #12
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Quote Originally Posted by MutantJohn View Post
    I've heard this before, definitely.

    Which is funny too because I've implementing some basic matrix routines myself and I've really been enjoying the C++ approach where I create a Matrix class. Using things like operator and function overloading making working with it very enjoyable. Plus, I can template it and things like enable_if checks and all this jazz.
    This is why anyone who does a lot of work with math + any dimension arrays would like Fortran, because it's already done for you. Math operators already work out of the box with arrays. And you can't beat the array subscripting either. It's basically the ease of use of MATLAB but with a compiled language.

    Examples:

    Code:
    ! array addition
    x = x + dx
    
    ! calculate the L2norm of an array of residuals
    res = SQRT(SUM(r**2))
    ! or if you use gfortran + GNU extensions
    res = NORM2(r)
    
    ! using array subscripting to set up the edges of a grid; first line sets the whole array to zero
    p = 0
    p(1:k-n+1:n) = 500*EXP(-50*(1 + y**2))
    p(n:k:n) = 100*(1-y) + 500*EXP(-50*y**2)
    p(2:n-1) = 500*EXP(-50*(1-x(2:n-1))**2) + 100*x(2:n-1)
    p(k-n+2:k-1) = 500*EXP(-50*((1-x(2:n-1))**2 + 1))
    Concurrency is built-in to the language in several ways, with FORALL, DO CONCURRENT, and coarray Fortran, among other things.

  13. #13
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Interesting. There's a lot of stuff that I wouldn't need Fortran for. But it'd be nice if I could write all these back-end math functions in Fortran, call them from CUDA C code and then just make it all work. I'm not sure if the tools are available for all that though. I'll have to do some research and then see if it's possible to link Fortran with C for CUDA.

  14. #14
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Quote Originally Posted by MutantJohn View Post
    There's a lot of stuff that I wouldn't need Fortran for.
    It's only good if you have to do a ton of math with a lot of arrays. OOTB built-in facilities make code much cleaner and more concise. The code is very human readable. Otherwise though, another programming language is probably a good choice.

    Edit: I'm going to keep slowly jabbing you with Fortran until you try it, simply because you're always mentioning meshing and other things related to scientific/numeric computing.
    Last edited by Epy; 08-05-2016 at 02:33 PM.

  15. #15
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    I'm also curious if I'd even see _that_ much of a speed-up. The math is largely stack-based and meant for relatively small matrices (5x5 at the largest).

    Though Fortran may not be applicable for this one application, it sounds like there's a lot of other features that would make it attractive. Namely, the syntax, inclusion of mathematical routines and the execution policies.

    I know C++17 is supposed to be getting those as well but still, it's nice knowing that Fortran would be a good alternative.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Importance of english language in programming language
    By Lea Pi in forum General Discussions
    Replies: 10
    Last Post: 04-17-2015, 07:43 AM
  2. What's the Difference Between a Programming Language and a Scripting Language?
    By Krak in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 07-15-2005, 04:46 PM
  3. I love C#
    By CompiledMonkey in forum C# Programming
    Replies: 3
    Last Post: 02-16-2003, 10:42 AM
  4. does anyone love?
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 02-03-2002, 07:16 PM

Tags for this Thread