• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logic problems  RSS feed

 
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been programming a little while but the logic of it seems to still really get it and its avbit of a problem. I'm getting better but not really quick enough.

Can anyone suggest anything that may actually help my logic as its really holding me back.

Thanks to anyone who has any advice!
 
Ranch Hand
Posts: 116
2
Eclipse IDE Java PHP
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What really helped me was practice practice practice. Not just with programming either. I did and still do a lot of puzzles and brain teasers such as sudoku or solving word problems and brain teasers.

Also go to codingbat.com and work through the coding problems there. Some of them have a solution you can look at. Try to solve the problem yourself. Then try to improve upon your solution. Then study the solution that was provided and figure out why they did it that way.

This was my experience anyway and it really helped me. Hope it also helps you.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alice Hampton wrote:I've been programming a little while but the logic of it seems to still really get it and its avbit of a problem. I'm getting better but not really quick enough.
Can anyone suggest anything that may actually help my logic as its really holding me back.

Could you elaborate? I'm afraid "the logic of it" is a bit vague.

However, in lieu of a reply, my advice would be this:
1. Never, ever, ever start coding BEFORE you understand the problem you're trying to solve.
Related pages: StopCoding (←click→) and WhatNotHow.

2. When you get given a problem - especially a big or complex one - don't assume that you need to understand how to do everything before you start tackling it.
Once you have a grasp of the major points, try tackling one of them. And if even that causes you sleepless nights, have a look at the WhereDoIStart page.

3. Winston's Law of Program Dynamics:
Within reason:
  • The more classes you write to solve a problem, the better the solution will be.
  • The more methods a class has, the better it will be.
  • So don't be afraid to write a new class or method.
    The "within reason" part comes with experience, but start out with the premise:
    "Got a problem (or a sub-problem)? Let's write a class (or method) to solve it..."

    4. Google is your friend.

    Good programmers aren't born, they're made. By hard work in most cases; and because they like it - so make sure you do.
    It isn't for everyone, and it's a long road - twice as long if you don't actually enjoy it.

    HIH

    Winston
     
    Bartender
    Posts: 689
    17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    With such a vague question you will only get vague answers unfortunately. It would probably be better if you found a few exercises you had trouble with, show us how you tried to solve them, and then we can give more specific and constructive feedback.
     
    Ranch Hand
    Posts: 99
    Java Linux Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    http://codingbat.com/
     
    Alice Hampton
    Ranch Hand
    Posts: 217
    Chrome Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you for all your replies, they have been helpful especially Scott and Winston so thank you. I always do puzzles myself and things like Sudoku on a regular basis as I enjoy them

    I understand my question may be a little on the vague side - I understand code and I understand what is expected off me e.g (if i was asked to make a a taxi booking app) I understand it fine it's just going from that written down logic of what is needed to getting it coded I seem to run into problems with unfortunately. I asked as I was curious as to how others on the forums got to where they are today to see if maybe there was anything I could try

    Winston - I do enjoy it! Im on placement programming

    Thanks again, means a lot when people take their time to answer my questions
     
    Winston Gutkowski
    Bartender
    Posts: 10575
    66
    Eclipse IDE Hibernate Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Alice Hampton wrote:I understand my question may be a little on the vague side - I understand code and I understand what is expected off me e.g (if i was asked to make a a taxi booking app) I understand it fine it's just going from that written down logic of what is needed to getting it coded I seem to run into problems with unfortunately.

    I guess then the thing is to get a handle on what it is about the "translation" process that you find hard:
  • If it's that you get a lot of errors, I suspect you're not compiling enough (a very common problem among beginners).
  • If it's that your programs (or classes) don't end up looking like what you wrote down, then I suspect you're not spending enough time on the "writing down" part, so you end up "designing on the fly" when you're coding.

  • I'd say that the average professional programmer probably spends about 20% of his/her working life actually coding; the rest is spent writing stuff down, drawing diagrams and/or mind-maps, scribbling notes, documenting...and THINKING.
    So if you see a Dilbert sipping coffee and staring off blankly into space in front of a 25-inch flat screen, he's not wasting company money; he's WORKING. And if he's got a few stripes or bruises on his forehead, then he's working hard.

    So:
  • Compile all the time: Every 10 lines you write; every time you add a new field; every time you finish a method; and - most important - every time you define a new class or interface.
  • Use meaningful names. Everywhere. And follow standard naming conventions.
  • Document copiously. And learn javadoc; it's wonderful.
  • If you find that your code is diverging from your design (ie, what you "wrote down"), StopCoding (←click) and do some more writing. Coding is the last act of programming, and you can't solve design problems while you're doing it.

  • HIH

    Winston
     
    Marshal
    Posts: 56610
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Winston Gutkowski wrote:. . . And follow standard naming conventions. . . .
    Although I don't follow everything on that page, I think it is unfortunate that it has been obsoleted rather than updated or modernised.
     
    Don't get me started about those stupid light bulbs.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!