Logic and Programming

Shadow Conception

Golden Member
Mar 19, 2006
1,539
1
81
Now, I aspire to become a programmer when I grow up. I plan to major in it and all, mainly due to the cashflow and my comfort when working with computers.

...but I think I suck at it. I decided to get an intro to Java by taking AP Comp Sci A this year. I find the stuff really taxing on my mind compared to other classes; a bunch of brainteasers. We've just started loops, and we finished up if-statements a while ago. The logic is tough, but transcribing it into code is cake.

I mean, d'you get better at it as you do it more (is there light at the end of the tunnel?), or do some people just inherently suck at it? I've always sucked at logic problems, too. I love math (meaning algebra-type stuff, even boolean algebra) and I'm pretty good at it, but the logic itself blows my mind away.

And then, I look at our teacher who took trig in fifth grade, managed a huge online game in his high school years, got a full ride to Virginia Tech, and now teaches us. Do I really have to be like that to be a good programmer?

I really like the type of assignments we get in AP CS, and most I can do myself fairly quickly. But some of them... woah.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: Shadow Conception
Now, I aspire to become a programmer when I grow up. I plan to major in it and all, mainly due to the cashflow and my comfort when working with computers.
Cool. Good reasons. By the tone of your statement, I'm going to assume you're in high school right now. So before you read the rest of my post, know this: Very few people know in high school what they're going to do for a career. Its good that you have a clue. Don't be afraid to change if it doesn't feel right.

...but I think I suck at it. I decided to get an intro to Java by taking AP Comp Sci A this year. I find the stuff really taxing on my mind compared to other classes; a bunch of brainteasers. We've just started loops, and we finished up if-statements a while ago. The logic is tough, but transcribing it into code is cake.
Few people pick it up instantly. Give yourself time.

I mean, d'you get better at it as you do it more (is there light at the end of the tunnel?),
Yes, practice makes perfect. Really.

...or do some people just inherently suck at it?
Yes, some people inherently suck at it.

I've always sucked at logic problems, too. I love math (meaning algebra-type stuff, even boolean algebra) and I'm pretty good at it, but the logic itself blows my mind away.
If you're good at math, then you should consider looking more at logic. And I don't mean logic problems, I mean mathematical logic. You'll be forced to do it in college anyway if you study CS, so do it now. Maybe that is the grounding you need.

Learning to program has a lot of fundamentals in logic. The practice is a bit different, but the logic is necessary. You'll find that a lot of the programming courses you'll take are all about logic problems.

And then, I look at our teacher who took trig in fifth grade, managed a huge online game in his high school years, got a full ride to Virginia Tech, and now teaches us. Do I really have to be like that to be a good programmer?
... and yet, the guy is a teacher. If he was a superstar programmer, he'd be doing that instead. I'm not saying he's not a superstar teacher -- but he's not a good example of a programmer.

I really like the type of assignments we get in AP CS, and most I can do myself fairly quickly. But some of them... woah.

Sounds like an AP course to me. Concentrate on what you like about CS.

 

The J

Senior member
Aug 30, 2004
755
0
76
I agree with degibson on all of his points, but just wanted to add my experiences. I first started programming in AP Computer Science AB in the first year they used Java. During the first couple of weeks, it was hard for me to wrap my head around a lot of this stuff. In the book I saw things like "static", "void", and didn't understand why I had to type out "System.out.println()" instead of just some "print" function. I think that it's hard to start out because code is used to exemplify the theory, but the theory needs to be understood in order to understand the code! Soon enough, it just clicked with me, I think. Through usage and looking stuff up online when I was curious, I felt like things just suddenly began to make sense.

During my senior year of college, I was a TA for the Computer Science department here. I saw quite a few students in the intro class who claimed that they really just couldn't get their heads around anything. When I saw them 10 weeks later (we had a trimester system, so classes were 10 weeks long), I saw massive improvements. It seemed like it clicked with them just like it did with me. So don't worry, that will happen to you. :)

If you enjoy the course, then definitely stick with it. At the very least, this will help you determine if you would like to further pursue programming and CS.
 

Woosta

Platinum Member
Mar 23, 2008
2,978
0
71
Consider a more higher level language such as Python where you don't have to deal with low level details ( C, C++, Java ).. that or keep on practicing.
 

Shadow Conception

Golden Member
Mar 19, 2006
1,539
1
81
Haha yeah, I really enjoy the class. The only downfall would be the couple of weirdos in there, but that's offset by the amazing teacher and good friends. The guy apparently received many job offers from companies like Sony, but he chose teaching instead. It's crazy... he doesn't belong in teaching. He should be off programming for video games or something.

Hopefully, I'll get better, though. It's mainly the logic that gets me, but given enough time, I can generally solve most problems. Thanks for the advice, degibson and The J!

Edit: I'm just gonna start off in Java and see where AP CS takes me. After I've covered all the basics from AP CS, I'm gonna just try programming independently and see what I can make of it.

It's just awesome when you have a program finally work correctly after spending a long time on it.
 

Semidevil

Diamond Member
Apr 26, 2002
3,017
0
76
i suck at programming too. back in high school, about 10 years ago, I took programming class because I liked computers. bad logic on my part. Anyways, I took it, did not understand much and went on my way. went to college, wanted to be a computer engineer because I still liked computers - wtf. still bad logic on my part. took an intro to java course, did okay in it, until the lesson about multiple 'classes,' and calling each other. That was when I got confused. passed the class, and took "java 2 - structures and abstraction." ended up with barely passing, because we werent allowed to do everything in 1 class.

5 years later, i'm here, still no clue about programming, but this time, i'm gonna try to focus on it and take it slow at my own pace.

Anyways, do the AP CS course. If you are having trouble wrapping it around your head, I suggest find some one-on-one time with your prof, and just go over line by line of each code and analyze it until you understand it. I think once you get the flow and 'logic' of it, it will be all better. I dont think people 'suck' at programming. It's just that their mind doesn't think 'that' way, so they might they need extra attention to grasp it. Key thing is to ask for help an dont just let it go.

With programming, if you miss one concept, it's hard to make sense of everything else(imho)
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
you really need to get a better grasp of logic. once you understand more behind the truth tables and propositions and their inverse, converse, and contrapositive - the logic flow of your programming will come more naturally.

pick up one of these school books
http://www.amazon.com/Critical...qid=1229409858&sr=1-14

I've been using that book to teach logic to my 11yr old daughter (because the schools don't put enough focus on it)

I had a kickass teacher like yours, his name was Lanis Lenker. Amazing guy, could have gone really far - but loved teaching. I'm glad he was my teacher.
 

KIAman

Diamond Member
Mar 7, 2001
3,342
23
81
Practice makes perfect. Logic is all mathematical. Courses to consider are all forms of algebra, geometry and statistics. I still haven't used any calculus that I was required for my degree but use algebra all the time.

Write out psuedocode and use mathematical notations. It helps. AND = multiply, OR = addition, use parentheses to wrap a loop and the counter as a multiplier, conditions are upper or lower limits.

If you can psuedocode using just math, you know you got it.
 

kyzen

Golden Member
Oct 4, 2005
1,557
0
0
www.chrispiekarz.com
Just keep yourself busy writing code - when the class ends, don't stop. Either come up with a program you want to create, and create it (start small), or pick up a book, and complete at least 1 chapter a week.

A series I absolutely love is the "Sam's teach yourself _____ in 24 hours" books - they're very well organized, and broken down into very manageable sections.
 

Dravic

Senior member
May 18, 2000
892
0
76
The best I have to say is stick to it. There are a lot of logic classes that are taught while getting a CS/CE degree that will help with the logic. You will get exposure to how an automaton works, how loop states work and truth tables. All of them help build the "mental" tool set you'll need. Do your best, and don't be afraid after you think you "got it" to go back and look at those early sections again.

Its an on going process.

Also if you find its not fun or interesting anymore don't be afraid at such a young age to try something new. I went to a small private university that had a solid but VERY small comp sci program. We started with ~23 CS majors, 3 graduated(me being 1) CS, maybe 10 went MIS (Management information systems) instead. The other 10 had NO chance (although i did rack up every Christmas after CS 101) Even if you love computers, networks and like managing them and setting them up, doesn't necc. mean you should be programming them.

There are also gray areas. I'm an Operational Engineer. Its a sys admin on steroids. Not only do i handle the servers, and networks (2nd level support to the juniors, and no desktop support TY), I also code in house tools, website, and 3rd party API interfaces (don't ever believe a vendor that says something will work out of the box.. it NEVER does). After spending 13hrs in the lab at school while working on my own compiler for a high level CS class, I realized I did not want to only "code" for a living, as a traditional application developer, but like to code to fix issues, and solve problems.

They pay will come if you're dedicated and good at what you do. early in your career be the guy who volunteers to pick up the slack, and pitch in on the odd project.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Have you ever looked at programming for embedded devices ?
It is a lot more fun since you don't have to code much to see the results right away.
It is also an area that stays in high demand even during low points in the economy.

You can write code for things like using a remote control to move around a robot, measure distances with ultrasound, displaying temperature on a lcd display, all things that are bit more hands on and lets you see the end result a bit more than just a loop in code in a compiler.



 

Fallen Kell

Diamond Member
Oct 9, 1999
6,117
482
126
Originally posted by: Modelworks
Have you ever looked at programming for embedded devices ?
It is a lot more fun since you don't have to code much to see the results right away.
It is also an area that stays in high demand even during low points in the economy.

You can write code for things like using a remote control to move around a robot, measure distances with ultrasound, displaying temperature on a lcd display, all things that are bit more hands on and lets you see the end result a bit more than just a loop in code in a compiler.

Yeah, that may be true, but it also requires a lot of specialized equipment, which for someone who is still in high school, probably isn't feasible. If he has to purchase complete products and not go the DIY route, it will quickly become expensive. And for things like measuring distances with ultrasound requires a lot of physics knowledge...
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Originally posted by: Fallen Kell
Originally posted by: Modelworks
Have you ever looked at programming for embedded devices ?
It is a lot more fun since you don't have to code much to see the results right away.
It is also an area that stays in high demand even during low points in the economy.

You can write code for things like using a remote control to move around a robot, measure distances with ultrasound, displaying temperature on a lcd display, all things that are bit more hands on and lets you see the end result a bit more than just a loop in code in a compiler.

Yeah, that may be true, but it also requires a lot of specialized equipment, which for someone who is still in high school, probably isn't feasible. If he has to purchase complete products and not go the DIY route, it will quickly become expensive. And for things like measuring distances with ultrasound requires a lot of physics knowledge...


Nah, not costly at all.
http://search.digikey.com/scri...tail&name=ATAVRBFLY-ND

Features:
http://www.siwawi.arubi.uni-kl...erfly_Introduction.pdf

Software is free.

Ultrasound libraries are pre-compiled so you don't have to know physics, just how to ask for and handle the data. Same thing for things like accelerometers and digital compass and temperature.

I mention embedded because I know how boring it can be learning programming and not really getting to see how something you do works out in the real world. With embedded you do start to see how some simple programs can be used in everyday life.

 
Sep 29, 2004
18,656
67
91
One of the hard things early on that you need to realize is that computers will do exactly what you tell them to do. If you precisely tell them to do somethign that is not what you wnat them to do, your code iwll not work.

i<5
is not the same as
i<=5

5.3 is not representing in a computer as 5.3 It will b iehter 5.2999999 or 5.300001

Some things to remember!
 

ayaboy

Junior Member
Dec 22, 2008
3
0
0
hi! Shadow Conception good for you dude nice job you really enjoy of being a good programmer i am proud of you that you really understand the flow of the programs and it is easy for you to do it that means your a tough and a very good programmer all i can say is you have a good feature in coming a professional programmer someday just have fun and enjoy it dude ^_^
 

sao123

Lifer
May 27, 2002
12,653
205
106
Originally posted by: Shadow Conception
Now, I aspire to become a programmer when I grow up. I plan to major in it and all, mainly due to the cashflow and my comfort when working with computers.

...but I think I suck at it. I decided to get an intro to Java by taking AP Comp Sci A this year. I find the stuff really taxing on my mind compared to other classes; a bunch of brainteasers. We've just started loops, and we finished up if-statements a while ago. The logic is tough, but transcribing it into code is cake.

I mean, d'you get better at it as you do it more (is there light at the end of the tunnel?), or do some people just inherently suck at it? I've always sucked at logic problems, too. I love math (meaning algebra-type stuff, even boolean algebra) and I'm pretty good at it, but the logic itself blows my mind away.

And then, I look at our teacher who took trig in fifth grade, managed a huge online game in his high school years, got a full ride to Virginia Tech, and now teaches us. Do I really have to be like that to be a good programmer?

I really like the type of assignments we get in AP CS, and most I can do myself fairly quickly. But some of them... woah.

just rmember that being a programmer is only about 30% pounding code...
in order to be a good programmer you have to do other things...

Modeling / Flow Charting / Diagramming /

Testing / Debugging / and Documentation

 
Sep 29, 2004
18,656
67
91
Originally posted by: sao123
Originally posted by: Shadow Conception
Now, I aspire to become a programmer when I grow up. I plan to major in it and all, mainly due to the cashflow and my comfort when working with computers.

...but I think I suck at it. I decided to get an intro to Java by taking AP Comp Sci A this year. I find the stuff really taxing on my mind compared to other classes; a bunch of brainteasers. We've just started loops, and we finished up if-statements a while ago. The logic is tough, but transcribing it into code is cake.

I mean, d'you get better at it as you do it more (is there light at the end of the tunnel?), or do some people just inherently suck at it? I've always sucked at logic problems, too. I love math (meaning algebra-type stuff, even boolean algebra) and I'm pretty good at it, but the logic itself blows my mind away.

And then, I look at our teacher who took trig in fifth grade, managed a huge online game in his high school years, got a full ride to Virginia Tech, and now teaches us. Do I really have to be like that to be a good programmer?

I really like the type of assignments we get in AP CS, and most I can do myself fairly quickly. But some of them... woah.

just rmember that being a programmer is only about 30% pounding code...
in order to be a good programmer you have to do other things...

Modeling / Flow Charting / Diagramming /

Testing / Debugging / and Documentation

It's funny. I used to do some of that stuff. But as you get better at things, you don't need to flow chart much.

Not sure what you mean by modeling though. Are you talking about the design phase when you say "Modeling / Flow Charting / Diagramming"?

Anyways, coding is about 20% if you properly plan things. Do some proof of concept work prior to coding to. You have to know if hte technologies you plan to use are realistic.
 

sao123

Lifer
May 27, 2002
12,653
205
106
Originally posted by: IHateMyJob2004
Originally posted by: sao123
Originally posted by: Shadow Conception
Now, I aspire to become a programmer when I grow up. I plan to major in it and all, mainly due to the cashflow and my comfort when working with computers.

...but I think I suck at it. I decided to get an intro to Java by taking AP Comp Sci A this year. I find the stuff really taxing on my mind compared to other classes; a bunch of brainteasers. We've just started loops, and we finished up if-statements a while ago. The logic is tough, but transcribing it into code is cake.

I mean, d'you get better at it as you do it more (is there light at the end of the tunnel?), or do some people just inherently suck at it? I've always sucked at logic problems, too. I love math (meaning algebra-type stuff, even boolean algebra) and I'm pretty good at it, but the logic itself blows my mind away.

And then, I look at our teacher who took trig in fifth grade, managed a huge online game in his high school years, got a full ride to Virginia Tech, and now teaches us. Do I really have to be like that to be a good programmer?

I really like the type of assignments we get in AP CS, and most I can do myself fairly quickly. But some of them... woah.

just rmember that being a programmer is only about 30% pounding code...
in order to be a good programmer you have to do other things...

Modeling / Flow Charting / Diagramming /

Testing / Debugging / and Documentation

It's funny. I used to do some of that stuff. But as you get better at things, you don't need to flow chart much.

Not sure what you mean by modeling though. Are you talking about the design phase when you say "Modeling / Flow Charting / Diagramming"?

Anyways, coding is about 20% if you properly plan things. Do some proof of concept work prior to coding to. You have to know if hte technologies you plan to use are realistic.



correct
 

IronWing

No Lifer
Jul 20, 2001
71,092
30,473
136
Your logic will improve as you program more. It's almost inevitable because the compiler or your output will tell you where your logic was flawed. Also, in your free time, try different languages to see different approaches to programming logic. One might come more naturally to you than another. I programmed BASIC in HS and it clicked almost immediately as did FORTRAN and perl. I still struggle with object-oriented programming languages; the logic is internally consistent but it is not how I usually think about things.