如何掌握Java?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3338865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to master Java?
提问by Abu Muhammad
I studied 2 courses in Java:
1- Introduction to programming with Java.
2- Data structures with Java.
我学习了 2 门 Java 课程:
1- Java 编程简介。
2- 使用 Java 的数据结构。
In Both courses we used Java SE.
在这两门课程中,我们都使用了 Java SE。
I loved it and I really want to be a great java programmer.
我喜欢它,我真的很想成为一名出色的 Java 程序员。
But, I discovered that I should know many technologies involved in Java software development:
Spring, Struts, JSP, JSF, GWT, Hibernate, apache tomcat and many more actually a lot more.
但是,我发现我应该了解 Java 软件开发中涉及的许多技术:
Spring、Struts、JSP、JSF、GWT、Hibernate、apache tomcat 等等,实际上还有很多。
I hope it become simple process like .NET you choose one language with one framework and IDE that is it.
我希望它变得像 .NET 一样简单,你选择一种语言,一种框架和 IDE,就是这样。
Could anyone guide me to the best route or path to master Java, please?
What do you think about these two courses:
http://www.oreillyschool.com/certificates/java-programming.php
and
Advanced Java Certificate Series (from the same school, will be available in September).
任何人都可以指导我掌握 Java 的最佳途径或途径吗?
你觉得这两个课程如何:
http: //www.oreillyschool.com/certificates/java-programming.php
和
Advanced Java Certificate Series(来自同一所学校,将于 9 月开课)。
采纳答案by Rei Miyasaka
I think most programmers have about average college graduate intelligence, including myself. What we do have a lot of though is patience.
我认为大多数程序员都具有大学毕业生的平均智力,包括我自己。我们确实有很多耐心。
That said, there are efficient ways to learn and inefficient ways to learn.
也就是说,有有效的学习方式和低效的学习方式。
- If you're stuck on one tutorial/book, try another book. Once you're done with the basics, there really is no "correct" order to learn.
- Skim through the standard Java library documentation. Don't bother memorizing it, but be sure that you know the tools are there when you need them.
- Make lots of test programs. If you're ever curious about something, try it out and see what happens. Don't know how big an int is? Write a program that prints out a sizeof. Don't know what happens when you call a virtual function of an override instance? Write a program with two classes, one inheriting the other, and try it out.
- Read other people's code. Take note of style and structure. And I don't mean silly things like whether the { should go on the same line as the statement, but how they recycle variables, how they organize their classes, how they use loops, where they bother to optimize and where they don't etc. Emulate what you like.
- Practice building "stub" programs -- you can do this in your head once you get the hang of it. Find your favorite program, and write out all the classes/methods as you think would have been used to build it. That'll help you with architecture.
- Spend lots of time naming your classes. Don't use fancy names, just descriptive ones. It's a good mental exercise to think about names, even if you don't expect to ever share your code.
- Try Project Eulerif you're into that sort of nitty-gritty mathy stuff. I don't believe that programming is all about math, but you might like it.
- Learn C sometime. C++ probably isn't worth it if you're doing java, but C will teach you how your computer works. You don't need to master it, but at least get to the point where you understand memory management and pointers. That'll help you make decisions faster when you want your code to be really fast.
- Learn functional programming someday. Haskell's a good choice, because it's a pure functional language. It's extremely difficult at first, but the concepts you learn from it are valuable regardless of what language you program in. You'll be making design decisions a lot faster, and your code will be a lot more robust.
- Keep up to date. Trends come and go in this industry as fast as in the fashion industry. A lot of it is crap, but a lot of it is crucial both to employment and productivity. Always keep an eye out, or you'll go the way of the dinosaurs.
- 如果您被困在一本教程/书籍上,请尝试另一本书。一旦你完成了基础知识,真的没有“正确”的学习顺序。
- 浏览标准 Java 库文档。不要费心记住它,但要确保您知道工具在您需要时就在那里。
- 制作大量的测试程序。如果您对某事感到好奇,请尝试一下,看看会发生什么。不知道 int 有多大?编写一个程序,打印出一个 sizeof。不知道调用override实例的虚函数会发生什么?用两个类编写一个程序,一个继承另一个类,然后试一试。
- 阅读他人的代码。注意样式和结构。而且我的意思不是说 { 是否应该与语句在同一行这样愚蠢的事情,而是他们如何回收变量,如何组织他们的类,他们如何使用循环,他们在哪里需要优化以及他们在哪里不优化等模仿你喜欢什么。
- 练习构建“存根”程序——一旦你掌握了它,你就可以在头脑中做到这一点。找到你最喜欢的程序,写出你认为用来构建它的所有类/方法。这将帮助您进行架构。
- 花大量时间命名你的类。不要使用花哨的名称,只使用描述性的名称。考虑名称是一种很好的心理锻炼,即使您不希望共享您的代码。
- 如果您喜欢那种本质上的数学知识,请尝试Project Euler。我不相信编程是关于数学的,但你可能会喜欢它。
- 有时间学C。如果您正在使用 Java,C++ 可能不值得,但是 C 会教您计算机如何工作。您不需要掌握它,但至少要达到了解内存管理和指针的地步。当您希望代码非常快时,这将帮助您更快地做出决定。
- 有一天学习函数式编程。Haskell 是一个不错的选择,因为它是一种纯函数式语言。一开始非常困难,但是无论您使用哪种语言编程,从中学到的概念都很有价值。您将更快地做出设计决策,并且您的代码将更加健壮。
- 保持最新。这个行业的趋势来来去去和时尚行业一样快。其中很多都是废话,但其中很多对就业和生产力都至关重要。时刻注意,否则你会走上恐龙的道路。
回答by James Raybould
The best way to become good at something? Practice, practice, practice.
擅长某事的最好方法是什么?练习,练习,再练习。
Don't focus on a single framework just do lots of Java, take a look around open-source projects, find something that needs fixing or implementing and do it or think of something that you want but doesn't exist and make it.
不要专注于一个框架,只做大量的 Java,看看开源项目,找到需要修复或实现的东西,然后去做,或者想出一些你想要但不存在的东西并实现它。
回答by Paul Tomblin
Write programs in it. Find open source programs that use it and fix their bugs and add functionality to them. The best way to get experience is to experience it.
在里面写程序。查找使用它的开源程序并修复它们的错误并为其添加功能。获得经验的最好方法就是去体验它。
回答by Robert Harvey
If you really want to know what you should be studying, within the realm of your examples (Spring, Struts, JSP, JSF, GWT, Hibernate, apache tomcat), then find some podcasts and blog posts that allow you to survey these technologies. You can then choose the ones you are most interested in for further study.
如果您真的想知道您应该在示例领域(Spring、Struts、JSP、JSF、GWT、Hibernate、apache tomcat)内学习什么,那么请查找一些播客和博客文章,让您可以调查这些技术。然后,您可以选择您最感兴趣的那些进行进一步研究。
回答by chimeracoder
I agree with the other two respondents (practice, particularly with open-source projects, is the best way to get good at a language). However, I wanted to add one thing. It's unclear from your answer how much experience you have with object-oriented design, and with Java, that's essential. I'd recommend looking into advanced OO design to get a sense for what's out there. My favorite book on OO design is available for free and linked below - see if it's at your level. If not, find something more/less advanced and work from it.
我同意其他两位受访者的意见(实践,尤其是在开源项目中,是掌握一门语言的最佳方式)。但是,我想补充一件事。从您的回答中不清楚您在面向对象设计方面有多少经验,而对于 Java,这是必不可少的。我建议研究高级 OO 设计以了解那里的内容。我最喜欢的关于 OO 设计的书可以免费下载并在下面链接 - 看看它是否符合您的水平。如果没有,请找到更多/不太先进的东西并从中工作。
http://homepage.mac.com/s_lott/books/oodesign/build-java/html/index.html
http://homepage.mac.com/s_lott/books/oodesign/build-java/html/index.html
回答by David Young
Java Technologies are very vast, from mobile phones, to enterprise level servers. You might want to first narrow what you want to learn.
Java 技术非常广泛,从移动电话到企业级服务器。您可能想先缩小您想学习的范围。
Your first talk about Java SE(applications programming) and then start mixing in Java J2EE, and Java EJB.
您首先谈论 Java SE(应用程序编程),然后开始混合 Java J2EE 和 Java EJB。
If you want to go down the web route or enterprise server then you need to learn J2EE,EJB,Hibernate,Spring,etc otherwise these technologies aren't seen as often when programming applications.
如果你想走 Web 路线或企业服务器,那么你需要学习 J2EE、EJB、Hibernate、Spring 等,否则在编程应用程序时不会经常看到这些技术。
It still seems like you have a long road to go, probably the most beneficial for you to learn next would be Java Swing(gui).
看来您还有很长的路要走,接下来学习对您最有益的可能是 Java Swing(gui)。
回答by duffymo
Practice doesn't make perfect - perfect practice makes perfect. If you continue to make the same mistakes, you'll only succeed in developing bad habits.
实践并不完美——完美的实践使人完美。如果你继续犯同样的错误,你只会成功地养成坏习惯。
You need to read this.
你需要阅读这个。
Your Java roadmap ought to look like this:
您的 Java 路线图应该如下所示:
- Concentrate on core Java JDK classes to start. Don't worry about Java EE until you're comfortable with interfaces, classes, and the basics. JDBC is an important part of core Java, so be fluent with it. You'll have to know about relational databases, normalization, and SQL. GUI technology here is Swing.
- Once you have that, take up servlets, JSPs written using JSTL exclusively (no scriptlets), and JDBC. You'll have to understand something about Tomcat (or another servlet/JSP engine), HTTP, HTML, CSS, and a little JavaScript as well. You can go a very long way with just these.
- Once you've mastered 1 and 2, you'll have to make a choice of framework. I'd recommend either swallowing Spring or EJB 3 whole. I'd recommend Spring first, but I'll admit that I don't know EJB 3 well.
- 专注于核心 Java JDK 类开始。在您熟悉接口、类和基础知识之前,不要担心 Java EE。JDBC 是核心 Java 的重要组成部分,所以要熟练掌握它。您必须了解关系数据库、规范化和 SQL。这里的 GUI 技术是 Swing。
- 一旦你有了它,就开始使用 servlet、专门使用 JSTL 编写的 JSP(没有 scriptlet)和 JDBC。您必须了解 Tomcat(或其他 servlet/JSP 引擎)、HTTP、HTML、CSS 和一些 JavaScript。仅凭这些,您就可以走很长的路。
- 一旦您掌握了 1 和 2,您就必须选择框架。我建议要么吞下 Spring 要么整个 EJB 3。我会首先推荐 Spring,但我承认我不太了解 EJB 3。
回答by del.ave
Practice and learn frameworks as you need them (or come across them). There are way too many frameworks out there (for Java and for .NET) to learn in one shot.
根据需要练习和学习框架(或遇到它们)。有太多的框架(Java 和 .NET)需要一次性学习。
Learning the standard Java class libraries is always a start
学习标准 Java 类库总是一个开始
回答by Derrick Turk
I get the impression from the phrasing of your question that Java is your first programming language. I laud your desire to "master Java", but if I might, I'd like to suggest that you try a little breadth before you get too much depth!
我从你的问题的措辞中得到的印象是 Java 是你的第一种编程语言。我很欣赏你想要“掌握 Java”的愿望,但如果可以的话,我建议你先尝试一点广度,然后再深入!
It's easy, I think, with a CS degree where most courses are taught in Java, to fall into the trap of believing that all programming languages are:
我认为,拥有大多数课程都用 Java 教授的 CS 学位,很容易陷入认为所有编程语言都是:
- object-oriented (and with single implementation inheritance and multiple interface inheritance)
- statically-typed (with no type-inference)
- imperative (i.e. making use of iteration constructs and mutable state)
- verbose
- 面向对象(并具有单实现继承和多接口继承)
- 静态类型(没有类型推断)
- 命令式(即利用迭代结构和可变状态)
- 冗长的
and therefore that all programming must look roughly like Java programming.
因此,所有编程都必须大致类似于 Java 编程。
I'd humbly suggest doing some reading on different paradigms and languages: learn a dynamically typed language (coming from Java, I'd suggest Python or Ruby), learn a non-OO language (like C)---and implement OO, learn about functional programming (Haskell's a great eye-opener). At least take a look around before diving head-first into Java alphabet soup (Java culture highly values acronyms---but I'll pass no value judgments on this here).
我谦虚地建议阅读不同的范式和语言:学习动态类型语言(来自 Java,我建议 Python 或 Ruby),学习非 OO 语言(如 C)---并实现 OO,了解函数式编程(Haskell 令人大开眼界)。在一头扎进 Java 字母汤之前,至少先环顾四周(Java 文化高度重视首字母缩写词——但我不会在这里对此进行任何价值判断)。
Just my US $0.02!
只是我的 0.02 美元!
回答by aaaa bbbb
The best way to become good at something? Get a job that allows you to use that technology. Get paid while practicing.
擅长某事的最好方法是什么?找一份可以使用该技术的工作。在练习时获得报酬。
There is a time to stop reading books and articles, and get to work building a project.
有时间停止阅读书籍和文章,开始构建项目。
As you are working, learn from others who are better than you. Continue to read articles on topics that interest you, and apply what you learn at work.
在你工作的时候,向比你优秀的人学习。继续阅读有关您感兴趣的主题的文章,并将您学到的知识应用到工作中。