• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to think logical in java?  RSS feed

 
chris wil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, this may seem like a stupid question but I was wondering if there are ways that I can improve the way I think logically for Java or how to think logically in java or ways to breakdown a problem to solve it? Or does this just develop over time with practice. i'm in a intro to java class and I feel like i am struggling with this part. I know what kind of syntax I should use but I struggle with on how to solve it . Are there any websites that are good to learn more about logical thinking of java?..aside from you tube. I feel like it just takes me longer than most people to think of how to write up the code. And do most Java developers use flowchart than go to coding? any help will be appreciated. thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

I think you'd like to read StopCoding
 
chris wil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow that's totally different on how school teaches us. My teacher tells us we should sit down a couple hours a day playing around with our different codes we use..is this good practice? judging by what I have read it sounds like it's not.
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to follow the advice of the Pragmatic Programmers to learn one new programming language every year. In 2013, I learned Python. This year it's Scala. In between, I've been boning up on Unix shell scripting as well as JavaScript, using JQuery and NodeJS and other related tools. Once in a while, I'll dabble in Groovy or Ruby. The thing I found that helps me a lot when I learn a new language was reading other people's code. I'd look for books that got good reviews and read the examples in them. I'd look for any tutorials online. I'd hit GitHub and browse through projects there. And naturally, I'd do this in conjunction with practicing to write my own programs. I'd try to do something myself, then look at how other people solve the problem and try to see if there were any differences in my approach versus other people's approach.

Of course, you have to spend some time familiarizing yourself with the syntax and language constructs that are particular to a language but once you have that down, at least for me, it comes down to getting into the same "mode" of thinking that other good programmers use. For example, Scala, Python, and to some extent, JavaScript have a lot of functional programming elements to them, so you have to understand that mode of thinking. For Java, it's still largely Object-oriented although functional constructs like lambda expressions and functional interfaces are now present in Java 8.

One more thing I'd like to mention, and some may not agree that this is something that beginners should try to tackle, but at some point you have to familiarize yourself with certain program design principles like SOLID, DRY, and SLAP. You may feel like these topics are way too advanced for you but if you are not aware that such things exist and can help you write better programs, I really believe that your ability to improve as a programmer will be severely limited.
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't totally disagree with your prof. It's the same way you get to Carnegie Hall, right? "Practice! Practice! Practice!" But to Bear's point, you can't just plunge headlong into writing code without getting your thoughts together and forming up an initial plan of attack. Sometimes stepping away from a keyboard and drawing or writing things out first is the best way to organize your thoughts.

To put it another way, you can watch how people swim, you can read how people swim, but *you* have to get in the pool and paddle around to actually learn how to swim. The question is, how well prepared are you and how much an idea do you have of what you want to do when you get into the water? It's not going to be easy, but don't get easily discouraged if you struggle at first. We all go through that learning phase but perseverance and diligence seldom go unrewarded.
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
adam wilson wrote:wow that's totally different on how school teaches us. My teacher tells us we should sit down a couple hours a day playing around with our different codes we use..is this good practice? judging by what I have read it sounds like it's not.


One more thought about "Stop Coding:" There are circumstances when you really don't know how the technology works. Say you just want to see how to create a GUI box. Or maybe you've never used a switch before.

But before you tackle a significant program, you should map out the logic. In my day they called this flowcharting and I couldn't turn in a program without a flowchart. ("Significant" will change as you get more experienced.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!