Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18557

Re: Snippets

From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
Newsgroups comp.lang.java.programmer
Subject Re: Snippets
References <45cdb21d-de35-4de6-ba4e-ae830f0a84dd@googlegroups.com>
Message-ID <m7L1s.19839$EJ7.12984@newsfe10.iad> (permalink)
Date 2012-09-05 09:31 -0700

Show all headers | View raw


On 9/5/12 8:17 AM, bob smith wrote:
> Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?
>
> I'm looking for snippets like for "starting a thread."
>
Google is a good place to search for snippets. For your example, 
<http://lmgtfy.com/?q=starting+a+thread+in+java>

Though this is a terrible way to program, because people often don't 
fully understand what the snippet does (especially if this is the only 
way they program).  Often times there are multiple ways to approach 
something, each with different trade-offs and implications. Simply 
copying the first snippet that seems to work will eventually lead to 
disaster.  This is true with any language, not just Java.

I suggest instead learning how to actually program in Java.  Read 
tutorials, buy books, ask smart questions.

If you're interested in threading specifically, a must-read is "Java 
Concurrency in Practice"

<http://www.amazon.com/dp/0321349601?tag=virtuinfinnet-20&camp=14573&creative=327641&linkCode=as1&creativeASIN=0321349601&adid=070QHH97QBDPJ8X254PX>

Yes, buying from that link gives me money, but you can search for the 
book on Google if you feel they deserve the money more than I do :-)

They have plenty of "snippets" in that book too, BTW.

Anyway, good luck,
Daniel.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Snippets bob smith <bob@coolfone.comze.com> - 2012-09-05 08:17 -0700
  Re: Snippets Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-05 11:44 -0400
  Re: Snippets Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-05 09:31 -0700
  Re: Snippets Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-05 15:05 -0500
    Re: Snippets Lew <lewbloch@gmail.com> - 2012-09-05 13:13 -0700
  Re: Snippets Roedy Green <see_website@mindprod.com.invalid> - 2012-09-06 22:33 -0700

csiph-web