Shift from Java to c++

后端 未结 16 1007
执笔经年
执笔经年 2021-02-05 10:49

I have been developing applications based on C# (.net) and Java (J2EE) for the last 3 years.

But now I feel, Java, C# makes you lame (from learning point of view) and yo

相关标签:
16条回答
  • 2021-02-05 11:48

    But, now I feel, Java, C# makes you lame (from learning point of view) and you can develop your apps quickly but you fail to understand the basic underlying concepts of programming.

    If you're trying to learn the concepts of programming, rather than machine architecture, there's not much benefit to learning C++. I would suggest going with something different from Java all together. A Lisp variant, perhaps.

    How To Design Programs is a pretty good book.

    0 讨论(0)
  • 2021-02-05 11:50

    C and C++ make some basic underlying programming concepts more evident, but they weren't designed by God. I'd second the suggestion to study the actual low-level systems behind your low-level code: operating systems, compilers/runtimes (try "Essentials of Programming Languages"), and machine architecture.

    P.S. In general it may be better to study C++ on its own, rather than starting with C, but for your particular purpose -- getting more intimate with low-level, unsafe constructs such as pointers, after already learning Java -- I think it's better to start with C (and K&R) where these are front and center.

    0 讨论(0)
  • 2021-02-05 11:51

    I would suggest learning assembly language first. This will give you a very solid foundation in what is happening at a low level. This will also help to reinforce the idea that "everything is really just an address".

    Taking a class which focuses on assembly language is advisable since it will "force" you to learn it (personally, I don't think ASM is /that/ fun, but it was worthwhile [and a requirement for graduation] for me to take the class).

    After you know assembly, go on to C and C++.

    Have a lot of fun!

    0 讨论(0)
  • 2021-02-05 11:53

    C++ is no more "basic and underlying" than any other modern programming language. It has a model of a computer (a flat memory address space), but the OS and CPU merely simulates that model using many layers of caching and paging, so it's not "real". The result is that the same operation may sometimes take 1000s of times longer to complete than at other times.

    Also modern C++ has lots of powerful abstractions that have no more direct relationship with how a computer works than do the abstractions provided in Java and C#. The OP mentions multiple inheritance - clearly no more elemental than inheritance in other OO languages. Many other features of C++ omitted from Java are high-level abstractions (or allow you to build them) and so in some ways Java is the more low-level language. In Java the meaning of operator symbols is always the same, whereas in C++ a simple == might build an object that will later be used to generate a SQL expression instead of being executed in-process.

    The JVM and CLR runtimes are (almost certainly) written in C and/or C++, so in that sense obviously they happen to form layers today. But at the C/C++ layer you will still be working in an abstraction that is not "how the machine really works", so you'll really just be learning a different set of abstractions, rather than "reality". And an OS (or indeed a hardware chip) can be designed specifically so that JVM or CLR like runtimes are the native low-level layer of the system; on such a system it would be the C/C++ runtime that would require a "high-level" (expensive) emulation layer in order to work.

    So it is probably not worth trying to learn how to program in "reality". No one really does that these days; it's a waste of time. You're better off learning about how programming abstractions help you to write correct programs. If a language makes life difficult for you, that doesn't prove you're doing the "real thing". It just means you picked the wrong language for what you're trying to do.

    0 讨论(0)
提交回复
热议问题