Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
Bite me.

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.

user:
pass:
register,


                                 

Dictionary: C++ to Java, Java to C++

C++: cout or printf Java: println
  (+8, -3)
(+8, -3)
  [vote for,
against]

A dictionary of commands in C++ and Java. Perfect for the programmer in transition.

Sample Input: cout Sample Output: println

The output will also explain the differences between the two commands, since perfect translations don't always exist.

GusLacerda, Apr 17 2001

(??) Java to C++ conversion http://icie.cs.byu.edu/cs240/javac.html
[egnor, Apr 17 2001, last modified Oct 04 2004]

(??) Java Essentials for C++ Programmers http://www.mathcs.r...8/java/c++2java.pdf
[egnor, Apr 17 2001, last modified Oct 04 2004]

Source Code In Database http://mindprod.com/scid.html
Store source 'code' in a more abstract form than plain text; could allow such a conversion automatically. [vincebowdren, Oct 04 2004]

[link]






       I wish negative voters were forced to explain why.
GusLacerda, Apr 18 2001
  

       These are by no means the best resources out there, but they were the first ones I found after 30 seconds of searching. The point is that "Java for C++ programmers" and (more recently) "C++ for Java programmers" are both extremely common. The "dictionary" form isn't quite as common (though I have seen it), mostly because it doesn't really make sense; the important differences are not word-level substitution but deeper syntactic and semantic distinctions.   

       So, baked.
egnor, Apr 18 2001
  

       The dictionary form is useful when you're just looking up commands if you're pickung up a new language. I agree they are not " important" differences in the theoretical sense, but to the programmer, it's crucial to quickly find the right keywords.
GusLacerda, Apr 18 2001
  

       Now what would be really sweet is if this could be an automated add-on for Visual Studio, so that one bunch of source code could be ported and automatically translated into all the different languages. Then again, it might already do this, I only have C++. They already have an integrated dictionary of all the languages, but don't list similar words in different languages.
nick_n_uit, Apr 18 2001
  

       I voted against because I think the difference between these languages goes a bit deeper than just "this word corresponds to that word".   

       Thinking about it some more, though, it would probably be handy to have a separate index to my Java reference containing C words and concepts, etc. (The mapping isn't one-to-one. "char *" would have to point to strings *and* to arrays of characters. "malloc", "free", etc., would point you to a section on Java's GC behavior.) So I've changed my vote back to neutral.
wiml, Apr 18 2001
  

       Proof the squeaky wheel gets the grease
thumbwax, Apr 18 2001
  

       ease up off the geeks. and i feel superior anyway.
tkeyser, Apr 18 2001
  

       ItsMan: are you trying to sell a C++ compiler?
GusLacerda, Apr 18 2001
  

       I just want something that'll change 'const' to 'final' and the like. Why can't all languages use the same keywords?
pottedstu, Sep 19 2001
  

       [pottedstu], 'const' and 'final' mean very different things. If they were named the same, then people would be even more confused about the difference than they already are.   

       Java actually went to great lengths to borrow C/C++ syntax wherever possible.
egnor, Sep 20 2001
  

       Well, they overlap. Inside a class,
static final double PI = 3.1459; (Java)
static const double PI = 3.1459; (C++)
mean roughly the same. Since this is by far the most frequent use of final, I find the question of "why didn't they call it const?" a very natural one.
  

       When applied to functions, "final" also means that you can't override them, which enables an optimization that C++ classes allow by default and that C++ hence has no concept for. (It has a word for the near-opposite, "virtual".)   

       Which I guess points to one interesting aspect of any dictionary - word boundaries don't line up. You need to spend a long time talking about all kinds of details and language concepts until you understand just which part of the uses of const are covered by "final", and which ones aren't, and have to learn much more than you wanted to know.
jutta, Sep 21 2001
  

       I think it's worth it. I am aware of both the languages and realize very well that Java is philosophically different from c++, and yes a word to word translation does not make sense. BUT this shud be a handy tool. Last I coded in C++ 4 yrs back, I know that const and final aren't exactly the same but now that I am coding, this kind of tool wud come very handy. I don't expect it to be absolutely right neway. Given that a newbie doesn't take this as the ultimate difference in the language (which I am sure a good one wud not) , this kind of a dictionary shud prove to be really useful. I wud even recommend having this dictionary give commands in other languages like C# as well. It's just very handy.
poojac20, Oct 28 2003
  

       There was a thread on the Java Developers Forums a while ago about "obvious omissions" from the Java language (ie. a C++ programmer wanting Java to be, well, C++). It's gone now, but it covered about every technical, practical and religous issue there was. (Most of the sub-threads eventually devloved to "if you want that kind of behaviour, use C.")   

       I think people expect there to be an easy translation purely because of semantic and syntactic similarities, and not because the languages are particularly close.
Detly, Oct 28 2003
  
      
[annotate]
  


 

back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle