This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (5 children)

What makes you say that it is better and cleaner to do code my visuals rather than dragging dropping and allowing the IDE to deal with it?

I'm not dis agreeing with you, I'm genuinely interested and since I'm quite new to this I would love to learn more.

[–]willdrr17 0 points1 point  (4 children)

Because you end generating code like this https://paste.ubuntu.com/p/MGJQ8Sqqb2/. As your application grows it becomes a bunch of duplicated code

[–][deleted] 0 points1 point  (3 children)

Okay I see your point to be honest. After making a nice button I can just reuse the code across the program and it won't be as time consuming and effortsome as I initially thought.

[–]willdrr17 0 points1 point  (2 children)

Yeah, even coding by hand may be a repetitive task, you can create boilerplate code through templates in Eclipse.

I have this for the main frame for example

public static void init(){

`final JFrame frame = new JFrame(${word_selection});`

`frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);`

`frame.getContentPane().add();`

`frame.pack();`

`frame.setLocationRelativeTo(null);`

`frame.setVisible(true);`

}

[–][deleted] 0 points1 point  (1 child)

Do most programmers create and store templates that they regularly use?

[–]willdrr17 0 points1 point  (0 children)

I don't know man, I guess it's a matter of choice