• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Would this idea work?

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking at videos on YouTube about how to bring up a simple window to the screen. Lots of lines of code there. But couldn't I type the necessary lines of code to bring up a basic window to the screen, and then save that code into some kind of template, so when I started a new project, I would not have to write out all that code again. All I would have to do is paste in the template and there it is.

Just wondering...
 
Sheriff
Posts: 28370
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could certainly do that, yes. A more advanced technique would be to write a class which does what you want, and then override it with the changes you want. But yes, copy and paste is ancient technology which still works.
 
Saloon Keeper
Posts: 28483
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without Copy-and-paste from Stack Overflow, probably 90% of modern software development would grind to a halt.
 
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:But yes, copy and paste is ancient technology which still works.


I've automated parts of it for my own projects by creating 2 Maven archetypes (one for single-module projects, one for multi-module projects) because I got bored of actually copy-pasting, but essentially it's still the same.
 
Bartender
Posts: 322
12
IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Without Copy-and-paste from Stack Overflow, probably 90% of modern software development would grind to a halt.



I hope the number is a lot lower than that!

I can't remember the last time I intentionally visited that site. Partly because I kind of dislike the site and how people behave there. Not to mention it's easy to waste a ton of time browsing.

Unless it's some obscure thing or something urgent (then, anything goes), I try to start with the most authoritative sources (Javadoc, library author docs, etc.), and sometimes dependency source code. I realize that's atypical... Meaning the 90% guess could be accurate, but I don't like it.
 
Tim Holloway
Saloon Keeper
Posts: 28483
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lou Hamers wrote:
I hope the number is a lot lower than that!



Probably isn't though. Been there/did that.

It's true that SO is almost as bad as the old-time "flame forums" where you would get viciously roasted for having the temerity to ask a simple question. But you can get good copy/paste answers there.

Just be careful. Often the top answer isn't the best one.

And I wouldn't ask questions there myself. They've TRIED to improve their attitude, but it's still no CodeRanch. Plus, we supply the "why", where they mostly supply the "how".
 
Lou Hamers
Bartender
Posts: 322
12
IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Plus, we supply the "why", where they mostly supply the "how".



That's a big difference, and why SO kind of offends me. "I got it working" without knowing why is just asking for trouble.
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic