views:

1749

answers:

25

I have been learning C++ for a while now, I find it very powerful. But, the problem is the the level of abstraction is not much and I have to do memory management myself. What are the languages that I can use which uses a higher level of abstraction.

+4  A: 

If you're comfortable with C++ syntax and style, you might find D to be an interesting language. Or if you want to branch out, any of Python, C#, Java, Ruby would be excellent choices.

Greg Hewgill
A big reason to use D is if you are wanting to use abstraction but not lose access to the low level. You can actually build abstractions on top of ASM if you are nuts enough to try it.
BCS
+3  A: 

C# if you're in the Microsoft ecosystem.

Python and Ruby seem to have the most traction in the Linux/Unix/etc space.

ObjectiveC is dominant on the Macintosh and iPhone. The most recent MacOS implements garbage collection for a subset of the frameworks, but to use the rest you'd have to do resource management yourself.

You could learn Java, as it does garbage collection as well, but the number of frameworks you'd need to become familiar with to be a productive Java developer is daunting.

DGentry
+2  A: 

Well if you're looking for a very high level of abstraction and memory management then I'd say lisp would be an ideal candidate. I'm learning it now, slowly, and it's the most fun I've had with a new language.

Having said that Python or Ruby may be a better compromise between expressiveness and popularity. Python's Django framework is one of the better RAD frameworks if you're looking for web application stuff.

Tom Martin
+4  A: 

ditto Lisp,.. or scheme

Even if you don't ever use it, it's handy. I only really got template programming after learning it.

Another one is prolog. it puts you in a non sequential mindset.

BCS
A: 

Since you are already into C++, next step would be to learn .Net through managed C++ or managed extensions for C++..this will get you a step in the big world of .Net framework..Once you understand the framework, makes it more comfortable to learn other .Net languages like C#, VB.Net etc.

One of the areas that MC++ excels in, and is in fact unique in amongst the .NET languages, is the ability to take an existing unmanaged (C++) application, recompile it with the /clr switch, have it generate MSIL and then run under the CLR. This extraordinary feat is aptly termed "It Just Works (IJW)!" There are some limitations, but for the most part, the application will just run. The C++ code can consist of old-fashioned printf statements, MFC, ATL, or even templates!

Gulzar
I'm unclear how managed c++ attains a higher level of abstraction. Blub with managed memory is still Blub.
Tom Martin
It is not about C++. It is about learning .Net and then it makes it easier for learning other .Net languages like C#, VB.Net etc
Gulzar
Edited my post a bit. Thanks for the comments..
Gulzar
Outdated - C++/CLR is the much cleaner replacement but is no longer a first-class language for .Net programming as it lacks support for WPF or LINQ.
Andy Dent
+4  A: 

Trying something really foreign like Haskell will allow you to think in different ways. It also helps you to think recursively. C++ has recursion but it infiltrates many more parts of functional languages.

cdv
I have to boost this one - Haskell will give you functional programming, /hard/. And that's good exercise for your programming mind in general. Functional programming is slowly being incorporated into lots of other languages - it'll all be a piece of cake if you've learned Haskell. Plus, f'nal will likely be behind future parallel programming languages, and it already is behind Hadoop / Map-Reduce, the very large distributed programming infrastructure at Google, Yahoo, Facebook, and other places. You can't beat it as an investment.
JDonner
.. oh yeah, and it's GC'd and at as high a level of abstraction as your brain can hold. The reason for Haskell as opposed to other functional-ish languages is that Haskell is pure f'nal, no escape hatches. But lest I make it sound intimidating, check out: http://learnyouahaskell.com
JDonner
+39  A: 

Java, C#, Ruby, Python and JavaScript are probably the big choices before you.

Java and C# are not hugely different languages. This big difference you'll find from C++ is memory management (i.e. objects are automatically freed when they are no longer referenced). You would chose these if you were interested in desktop style applications, or keen on static typing (and you'd probably choose between them based on how you feel towards Microsoft and the Windows platform). In both cases you'll find much richer standard libraries than you'll be used to from C++.

Python and Ruby take a step away from static typing, into a world where you can call and method on any object (and fail at runtime if it's not there). That is both a blessing (a lot less boilerplate code) and a curse (the compiler can't catch those errors for you anymore). Once again, you'll find they have richer standard libraries, and are higer level again than Java / C#. Performance is the main downfall, with Python being somewhat faster than Ruby as I understand it. To choose between them, you'd probably choose Ruby if you're interesting in web development for the Ruby on Rails framework community, and otherwise go with Python.

JavaScript is even more different from C++ in that it does away with classes entirely. Objects are simply cloned from other objects and can have methods and properties added to them at runtime. Very flexible, but also very easy to make into a total mess. JavaScript is the only real choice if you're interested in running applications in a browser, which is really coming into its own as a platform. You'll find the standard libraries available rather limited if you're not doing a lot with the browser, but there are quite a few good frameworks which fill in some of the gaps.

Some other interesting, though more niche choices are

  • Smalltalk - More or less in the Ruby and Python camp, and significantly faster as I understand it. Be careful though _ I've seen lots of good engineers learn Smalltalk and never come back ;)
  • Objective-C - When C went object oriented, C++ went one way (static typing), and Objective-C went the other (dynamic typing). It's quite Smalltalk inspired, and has a good standard library if you're in Mac / iPhone land. In terms of memory management, unlike everything else I've listed, it's not garbage collected (though that's now an option on Mac OS X 10.5), but it does have a reference counting scheme which makes life significantly simpler than managing memory by hand.
  • Lisp - I've never learnt it myself beyond what I needed for minor Emacs hacking. As I understand it, the libraries were nice in their day, but though the language remains supremely elegant, they've fallen a little behind the times.
  • Haskel - If you wanted a complete break from objects and classes, Haskel and it's functional approach is an interesting way to go (or Lisp as above, or F# if you are in .Net land). Basically, you're giving up loops and variables in favour of doing everything recursively. Takes some time to wrap your mind around, and probably isn't practical for most real world applications, but it's a good one to learn.
  • Eiffel - I love it - Very clean syntax, and designed for serious engineering type systems. Statically types like C# and Java, and with a weaker standard library, but it will make you really think about language and class library design.
  • ActionScript and Flex - The programming interface to Flash, which is based on what seems to be a statically typed version of JavaScript. I've played with it a bit, and it's quite slick if you're interested in developing media based applications. You can also push beyond the browser with Flex and into the Air platform to build real desktop apps.
Matt Sheppard
+1  A: 

try c# much :)

Peter
+21  A: 

I would say that from your question you probably haven't finished learning about C++. If you're still doing your own memory managment then you still have a long way to go my friend!

Check out the auto_ptr and shared_ptr - check out the Boost libraries.

Similarly with abstraction - what are you specifically complaining about? AFAIK there's not much you can't do with C++ that is present in other strongly-typed languages.

I know this doesn't answer your question - you want to move forwards, but C++ is one of those things where you never really stop learning. If you get bored, take a brief foray into templates and template meta-programming...

Thomi
Exactly. The best thing about C++ is that you can write at any abstraction level you like using many different paradigms. The levels of abstraction available are as high as you want to go!
Scott Langham
Was about to answer the same :)
Diego Sevilla
A: 

I recommend python as it's not only a sexy language, but also very widely used and easy to integrate with C++ through Boost.Python.

But as Thomi said, there's lot to explore in C++ and with the help of Boost libraries it's becoming really easy to develop in.

macbirdie
+15  A: 

I see a lot of excellent suggestions so far. However, I think there's something missing, assembler.

Why learn assembly language?

  • It's not as difficult as you may think. Assembly language is a lot smaller in scope than many modern languages, there are a few tricks you need to understand for it to make sense, but it's not that complicated.
  • It broadens your knowledge base. Knowing the fundamentals is almost always beneficial, even when working at a high level.
  • It can be extremely useful when debugging. Especially debugging native code without the source, the knowledge you gain from learning assembler enhances your ability to debug in these situations by leaps and bounds.
  • It gives you more options. When the rare circumstance comes up where assembly code is needed you won't be helpless.
  • It's good for your resume. It shows that you learn beyond just the bare minimum needed to keep your current job, it shows a curiosity about fundamentals, and it puts you in a different class of programmers, and that class tends to be more experienced and more capable.
  • It's just plain cool.

Some assembly language resources:

Wedge
While the debugging aspect certainly has merit, the phrase "rare circumstance" is an understatement. Optimizing compilers are smart enough these days that it's exceedingly rare that you would have to write in assembly to gain performance. Also, it's worse than OS-specific, it's _machine_ specific.
Graeme Perrow
The problem with that is it's self-fulfilling. If you don't have a hammer, nothing looks like a nail. There are a lot of developers working in assembly every day, and they probably like the fact that people think this is very unusual, because it means their skills are rare and they make more money.
Wedge
Sure, but how does that use a higher level of abstraction?
Matt Sheppard
I agree with Matt Sheppard. The only way for Assembly to be considered higher level than C++ would be for the developer to code upside down... More seriously, even if your post is interesting, it does not answer the question. Or did I miss some new technology like Garbage Collector for Assembly?
paercebal
...also very useful when you need to deconstruct crash dumps from applications that have crashed on remote sites, and all you have is a binary mess of a crash dump...
Thomi
A: 

Rather than suggest a specific language, I would recommend you pick any language or languages that offer the following 4 features:

  1. Automatic Memory Management
  2. Reflection/Introspection
  3. Declarative/Functional constructs(e.g. lambda functions)
  4. Duck Typing

The idea here is to expand your programming perspective to include concepts that the C++ language does not offer you out of the box.

grok
A: 

It depends on what you want to do. If you have some specific tasks that you are interested in accomplishing then look at languages that are best for those types of tasks. The best way to learn a language is to actually use it.

bruceatk
+1  A: 

if you want to abstract memory management, Java comes to my mind instantly.

Soumitra
+1  A: 

I'd say it depends on the kind of programming you want to try. If you want to stay on the OOP side, learn Python or Ruby, both languages provide an easy way to create bindings to use your C++ code from a script (for efficiency reasons).

If you need another approach to programming, learn a "functional" language like Lisp or Haskell.

And if you need to include a fast and small scripting language inside your C++ application, try Lua.

Last but not least, if you know Java and hate it, you can try Scala, a language where you can mix your Java classes with your Scala code, very interesting.

Stacker
+2  A: 

Scheme.

The Little Schemer and Structure and Interpretation of Computer Program will stretch your mind in strange and wonderful ways.

DrScheme is a good IDE for beginners. The Scheme Programming Language makes a good, free reference.

underspecified
+1  A: 

I suggest learning database design and a query language such as SQL.

You can start with a desktop tool like Microsoft Access or use the free SQL Server Express or Postgre or MySQL.

A: 

I'd say get started with Python. It has a higher level of abstraction and it teaches you the importance of indenting and making "pretty" code. Not that "pretty" is very important, but it will make the future maintainer of your code a lot happier :)

There's a lot of example code out there, and if you are into Linux there are various distributions out there who have all (or most) of their tools based on the language. If you like digging into how managing an operating systems works (something most programmers do) it's a good start. Before I get the flames I said managing, not the actual kernel stuff for that you mostly need C and you should have that covered.

On the other hand it might be nice to dive into the C side of things, ignore the OO stuff and learn functional programming. If you head down that road I also suggest to start with basic assembly language like one of the upper posts suggested. Maybe HLA (High-Level Assembly by Randall Hyde, he wrote a great book called Art of Assembly Language Programming) is a good start. You'll either learn to love memory management or hate it for the rest of your live. Good to know in case you want to start a career in programming :)

However if you're looking to make a job out of programming, Java and J2EE is an easy money maker if you know what you're doing. IMHO it gets boring really quick though.

Kristian
A: 

Well I think there is no predefined route in learning programming languages. You may learn your next lang based on your job needs, academic research, just for fun, etc. There are many options.

In you feel comfortable in C++, you can go down and learn some assembly. It's a dark art but you'll be glad when you encounter some hard debugging session.

In terms of more abstraction, Smalltalk is extremely fun, OOP-pure and 100% dynamic (debugging is a pleasant thing to do, which is not in static-typed languages). Dolphin Smalltalk is a good implementation for Windows, even the free community edition gives enough to play with. In multiplatform Smalltalk VMs, go for Visualworks or Squeak. Visualworks is extremely stable and comes with a lot of documentation.

Python is used today in many, many fields. I don't know anything about Python excepting the basic syntax and semantics, but it's required today for many jobs.

Java it's, well Java. It's interesting that Java never catch on me. You may get interested on Java, altough. Ask here for advantages of using it over C++ or other OOP languages.

For Web development go for Javascript, specially considering the AJAX wave. It's getting interesting those days. We've talked about Smalltalk, all right, Seaside is an amazing framework for web development. It works (at least I tried on) Squeak /Visualworks... it's beatiful.

Well, there are a lot of more to get your hands on: Scheme, LISP, Ruby, Lua, Bash (!), Perl (ugh), Haskell... Try them all and have fun!

Hernán
A: 

Any language you interested will do!!

Jace Jung
+1  A: 

Qt

Comptrol
+1  A: 

Why not learn Qt? Its a great application development framework available on all platforms and even mobile devices!

Xolve
that's what I also wanted to say.With only a bit of code you can create really great GUI-programs.
Berschi
A: 

Personally, I have been programming in Java, Python, C/++ and my favorite has to be python. Although C++ can do everything Python can do and more, I wrote a Python program with about 10 lines that would take about 50 in C++. So, moral of the story, use python.

Mylo
A: 

If you haven't already, try out a scripting language. It should change the way you work & think. Hopefully, in a good way :)

Geo
A: 

I've got to put up a separate answer for Perl. While Python is roughly equivalent in functionality and considered more clean and modern, Perl has an elegance all of its own - the elegance of pure pragmatism. It also boasts a truly great library support. Take a look at Perl to expand your brain in the direction opposite to Haskel :) (although Perl aficionados claim that it can be used for functional programming).

Arkadiy