7 Replies - 2010 Views - Last Post: 05 April 2012 - 07:47 AM

#1 Hikaroshi  Icon User is offline

  • New D.I.C Head

Reputation: 8
  • View blog
  • Posts: 42
  • Joined: 26-April 09

Cracking the Programming Code

Posted 31 March 2012 - 08:30 PM

...I didn't know where to put this and I was thinking it might be here or the student lounge.

For the past few nights of finally being able to start on my homework assignment I think it finally hit me.
I'm not the best programmer, in fact I'm relatively weak and I think it's because since I've started school every computer science course I've taken is never in the same language as the previous one. I feel like having a time frame to complete these assignments (okay, a short time frame ie: a week) is a little daunting and I feel rushed, sometimes not even being able to complete my assignment by the deadline. I end up spending so much time on an assignment and not completing it that I don't get a chance to try to do all the cool things I wanted to do with it, especially since I'm a slow worker in general. I like to take my time and experiment too...

Every class after the beginning (or even every lesson) assume that a student should have mastered the fundamentals or previous material. I'm starting to think since the level of my classes are getting more advanced over time, I become more aware of my weaknesses, but fail to officially fix them as I have to focus on the more advanced aspects along with the smaller bits -- I force myself to only learn how to solve the current problem, but I fail to solve the smaller problems that might make fixing the next big problem a whole lot easier.
I personally believe that might be a factor in my lack of understanding.

I've read similar posts before and it's always 'practice' and I think many people at my level fail to understand what is gained to practicing. I personally know that I get stumped on the 'thinking' processes when I have a problem in front of me, or sometimes I simply don't understand how that line of code managed to get that program to go from point a to point b. But, I learned that as a beginner in programming it's advisable to:

Get a book or some sort of resource, read the contents, look over the code to see if the processes that produced the anticipated output makes sense, type in the code instead of ctr+c/v, see if it runs, look over the code again, and then modify it (especially true if something doesn't make any sense). If it's math based, possibly adding print statements and using your handy calculator and a nice piece of paper (especially gui based stuff) might help clarify some things.

Okay, I guess that works under the grounds that ideally the a person would understand every line of code... What about if they don't and have played with the parts that they don't understand, done research, yet still don't get it? Is this where they ask for help?

The next step is to:
Take what you've learned and try to apply it to something first by considering where it can be used, and how to construct what you want to make. You'll have to consider the types of variables needed and methods and how everything interacts with each other.
IE: If a person learns loops maybe after learning they should consider when it is suitable to use a loop for something? For example, the question that might be posed would be: If I wanted to make a ball enter from the left hand side of the screen to the right, does that mean I'll use a loop until the condition is met or is it something else?

Then somewhere in between there's that segment of trying to make everything work.

Lastly is to look at other people's work and gain experience from what they're doing. I guess this includes help posts and snippets...

Anyway, I digress, I two nights ago I was finally able to pinpoint what the 'real' benefits are to practicing that are often not really explained. Obviously repetition (but I wouldn't say rote memorization because someone could regurgitate something and still fail to understand the concept) and constant exposure to the language is a benefit, but the real benefit lies in experience. Over time a person will learn because they've seen so many cases where something could be used. They will be able to approach their own problem or a new problem using previously learned knowledge gathered from learning the mechanics of 'computer logic' from doing all that was posted above.

Would anyone agree to that?

This post has been edited by Hikaroshi: 31 March 2012 - 08:41 PM


Is This A Good Question/Topic? 1
  • +

Replies To: Cracking the Programming Code

#2 wizzard1200  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 10-October 11

Re: Cracking the Programming Code

Posted 31 March 2012 - 10:10 PM

I'm not sure as to whether or not this is posted in the correct section of the forum either. Regardless, I am not a moderator so it's not my concern. I can relate to exactly how your feeling about having shady areas on the fundamentals of one language or another. I am a senior in college right now and find myself in a similar predicament, or at least I used to. When you begin coding at a university level you have this instant intuition about how to solve a problem but then as you continue to study further you realize that many problems require multiple steps and true analysis of a problem to really grasp the concept. Memorizing anything is asking for failure. Memorize things if you want to be a doctor or a lawyer, for the rest in a technical discipline we want to understand things. It's not about the code you memorized but rather about whether or not you understood the logic going on in the code. Think of it like driving a car, you realize you must turn the key or push the button to start the car. While you may not realize all the processes that go between the key and the ignition you still understand how to turn a key and have related starting a car to a simple process such as turning the key or pushing the button. Look at programming the same way, just understand the problem and try writing psuedocode to generate a workable solution then try to write code to reflect your thought process. Think of loops not as loops but as different ways of counting from 0-10 or whatever works for you. For example, I was assigned homework to parse a number with a comma in the right place so 1000 would be 1,000 and to do this recursively. At first I scratched my head but then looked at the problem in a logical sense. Smart me, knowing that every 3 numbers require a comma and that only numbers greater than 1000 would require a comma was able to develop a solution to this. I coded it in a basic for loop and then did it in exactly the reverse order to develop a recursive solution. Break things down. Type fast, think even faster if you want to survive in the industry. Corporations will expect you to meet almost unreachable demands at times and they want to hire smart people who work very fast. If you don't think you handle decomposing a sorting algorithm in an interview and are able to write real workable code in person then you may just need more practice or may be in the wrong major. How far along in school are you? Are you currently working on code outside of class? Do you work and go to school full time? Have you considered the fact that what your learning in school may not be of any use in the industry? Have you considered the fact that your probably not as dumb and incompetent as you probably feel right now? If you are feeling dumb or unknowledgeable about computer science, don't stress and remember that the whole point of going to school is show you that you don't know anything. If your feeling like that than you know your school is succeeding at teaching or introducing you to new things that you would otherwise not have thought of. Your making a smart decision by joining DIC, this site is an incredible place to connect with people much smarter with much more experience than your self. I check this site everyday to just read and learn from what others are doing. Even if I can't answer the question I still at least read it and think about it. Your also smart for keep a good programming book near you. Also remember that if your getting error messages you've never seen before then you can almost always just Google them and find out what your problem is. Anyways, I have ranted on long enough and hope that this was of some value to you. I hope for the best for you. Like I said, I know exactly how your feeling and don't feel like your alone. Just enjoy the code, it really is beautiful just as computer science is. Never stop reading new books on technology and various blogs about software development. Maybe even try to intern if that's an option for you-that should refresh your confidence.
Was This Post Helpful? 1
  • +
  • -

#3 Hikaroshi  Icon User is offline

  • New D.I.C Head

Reputation: 8
  • View blog
  • Posts: 42
  • Joined: 26-April 09

Re: Cracking the Programming Code

Posted 01 April 2012 - 02:49 AM

Sometimes I know when to use some things, and sometimes I don't, I think that's the main issue.

Oh, the loop thing was just an example, I had to do a bunch of loops in my first year. Some of those things were examples and not things I do, like rote memorization, there's no way it could work anyway. I would say my major issue is that I have the ingredients, but how do I make the meal of my choice with that? What other meals can I make with some or all of those ingredients? Sometimes there are times when you plan to make that meal you find out that you don't need x, you actually need y, or you also need z. Actually, my question was regarding what I said about practicing. I always felt like even when I try to practice I won't get far because I still don't understand the thinking sometimes. I think it finally clicked two nights ago that the ability to solve some of these problems is by learning a topic (ex: sorting, graph data structures, loops - I like loops today), think of how to how to use these 'ingredients', and find out other ways that one thing can be used by finding code, reading it, and dissecting it. By being exposed to different scenarios in the usage of a particular aspect may in fact improve thinking and therefore will improve your skills...

My major is actually not computer science but I've been taking programming classes on and off.
If you want me to be specific my first semester of my first year was in python, second semester of my second year I had to jump into data structures in java (no other java classes before it), and last semester was programming in assembly language. Now I'm back to java. I've made it a goal to work 10x since winter break, starting fresh with c++. Now that I have to do my assignments in java and since they take me so long I spend forever doing them to the point that I don't have time even for my other assignments. In terms of practicing by myself sometimes I wonder where to start since there are sections where I think I have mastered, but maybe there's more so I spend so much time on literally the basics. I also end up trying to focus my attention on the current programming language I'm learning in school. I don't know if I should do that or just stick to one language regardless of what I'm learning in class.

I also work-- part time (I grade for an applied mathematics class), go to school full time--since that was your question. I forgot, I'm on the second semester of my third year, doing a 4-yr program (that's the maximum at my school).

I started to take my time and plan things out once I entered the data structures class. For me planning things out is easier said than done, but I'm sure that's part of the process. I've been in situations where I would believe my thinking is at least somewhat there and later find out that it wasn't even close and have to start my homework assignment again, sometimes deathly close to the due date/time. Maybe it goes back to my thought of not being exposed to different scenarios in order to think of a problem more clearly? Sometimes I have the idea and it's right for the most part but when I want to program it I get stuck because I realized I cannot use something the way I thought I could, so I spend more time staring at the screen. I guess the real problem goes like this: "How do I place the key in the keyhole and turn it?" "First I need a key, I need a keyhole, I need the key to be inserted, and I need to turn it upon being inserted". I stand back for a second and I realize "how do I actually turn this"? I know I need the key and the keyhole... maybe even the insertion part is a little bit fuzzy.

I'd say since taking that data structures class, I've noticed that I have an easier time when I only have to deal with my own code. When I have insert lines of code into previously programmed code (that is not my work) I have a harder time.

So far with a lot of the classes I've taken I spend more time looking things up and often contemplate not going to class due to frustration (but I do go). Like in data structures the teacher had a hard time explaining things, we didn't really see working code, it was filled with a lot of jargon I didn't understand and would sometimes mix up even when after looking them up (information overload?). When it was time to do the assignment I felt like the class vs the homework was like comparing two irrelevant things, like comparing a faucet to a mango, especially when the teacher would make assumptions that we would know that we should use something we have never seen or known about in our lives until we've met with the tutor after encountering an issue. UC berkeley's online youtube video on java topics proved more beneficial to me than my actual classes. The final exam and midterm were more on the conceptual side that I've never gained from the class. It didn't do any justice that we had to write about something we've gained from the program when a lot of people bragged that it only took them 2 hours before the deadline to complete.

Yet, a lot of my classmates somehow didn't seem to have the issue I was having. They were able to relate to the teachers a whole lot better, and honestly I've never seen any of them plan out their code and that part of programming was never really introduced in any of those classes. For a while I was under the impression that if I couldn't immediately bang it out on screen, there was a huge problem.

In both assembly and java my teachers only spoke about the program, but I didn't think there was that guide into the topic. I always bring my ideas with me when I see the teacher or a tutor, but often times they never want to look at them because they know how the program should work so, they just want to focus on the code.

A question to your question: how would you know whether or not you have a the ability to become a programmer? Apparently some people say they already think like a robot so it's easier for them.

I want to intern, though I feel like I'm aiming too high when I look for jobs and see that they require something that I don't feel like I excel in. Even with my major, since I will obtain a general engineering degree upon graduation I know I must go to graduate school in order to actually be marketable because last semester was the first time I've taken an EE course, and since my first year in engineering I've been really interested in microcontrollers or at least using the breadboard to create cool things but never got around to playing with it beyond my first year, and end up considering it every now and then thinking I'd learn programming better and expand my EE knowledge if I do something that I'm interested in. I like practicality, but my school lacks in those classes that I'd like to take such as more hands-on, practical learning type stuff. Theory is always nice, but things become more solidified once a person can see exactly when and where something can be used. My end of the semester project in EE was about simulating different types of hearing loss by extracting a specific frequency range of a song, we had to use filters for it. That was the only time I had something hands on, and it helped me to actually remember and visualize what I had read in the book through doing (like setting the operational amplifier to +15/-15 Volts).

I'm sure I'd know how to decompose a sorting algorithm or do a problem I was asked to solve on an interview question once I was more confident in my abilities. Then again, I haven't been in a real world situation to know whether or not my speed would hold me back significantly. Since grade school I've always been the last person to finish a test (or... not finish a few questions because time was called) and still do well.

I don't post often on this board because sometimes I simply don't know how to do something and I'm too afraid to ask because I'm too stuck to be able to even say that I did x, y, z or I was thinking x, y, z. I know how people are about people like that.

This post has been edited by Hikaroshi: 01 April 2012 - 02:57 AM

Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6049
  • View blog
  • Posts: 23,475
  • Joined: 23-August 08

Re: Cracking the Programming Code

Posted 01 April 2012 - 03:47 AM

Quote

every computer science course I've taken is never in the same language as the previous one.


I feel your pain. My user name comes from the fact that I've had to learn new programming languages on the fly all. the. time. In the real world, many people don't get to just choose one language and then just never leave that comfort zone. You're always learning new languages, technologies and paradigms. Fact is, logic is logic. Once you achieve an understanding of the logical processes involved in a problem, then it's simply applying the syntax of the language you're using -- all of which is readily available via Internet search - to the problem at hand.


Quote

I feel like having a time frame to complete these assignments (okay, a short time frame ie: a week) is a little daunting and I feel rushed, sometimes not even being able to complete my assignment by the deadline.


Again, welcome to the real world! Just wait until you perhaps enter the work force in this field (or many others), and this sort of thing is foisted upon you. Instead of your grades at risk, though, it's whether you can feed your family next week!

Quote

Every class after the beginning (or even every lesson) assume that a student should have mastered the fundamentals or previous material.


This is the case in every class you've ever taken since school got "serious", perhaps back in the second grade.

Quote

Get a book or some sort of resource, read the contents, look over the code to see if the processes that produced the anticipated output makes sense, type in the code instead of ctr+c/v, see if it runs, look over the code again, and then modify it (especially true if something doesn't make any sense). If it's math based, possibly adding print statements and using your handy calculator and a nice piece of paper (especially gui based stuff) might help clarify some things.


There is good advice there. The best tip I can personally give you here is to learn well whatever debugging tools you have available to you in the language/development platform you're using. Compile code in debug mode and step through it. Place breakpoints on lines in functions you don't understand, step through the code line-by-line and watch what the variables are doing.

Quote

I don't post often on this board because sometimes I simply don't know how to do something and I'm too afraid to ask because I'm too stuck to be able to even say that I did x, y, z or I was thinking x, y, z. I know how people are about people like that.


OK, here's your mistake. Don't be afraid to ask a question if you've tried something and it doesn't work. As long as you've TRIED YOUR HARDEST -- and we can tell -- you WILL get help here. Develop a thick skin though, because many of us -- myself included -- will be blunt in our criticisms of your code (You are not your code). If you can manage to do those things, you WILL learn the right way to do things while you're here. We REALLY like helping people who actually WANT to learn, and especially demonstrate that they ARE learning; too many come here just looking for someone to do their actual thinking -- or their whole assignment -- for them, and we get pissed off. It would be an absolute PLEASURE for most of us to have someone come in and say "I did this assignment, here's what I have, but I don't feel like it's up to snuff. What can I do to make it better?"

Good luck, and keep your chin up!
Was This Post Helpful? 4
  • +
  • -

#5 Hikaroshi  Icon User is offline

  • New D.I.C Head

Reputation: 8
  • View blog
  • Posts: 42
  • Joined: 26-April 09

Re: Cracking the Programming Code

Posted 01 April 2012 - 05:56 AM

I know what I'm saying are things that I'll experience in the real world especially since I hear stories. I also think that's what contributes to my lack of understanding. Just because I will face that same situation upon finding a programming job doesn't mean before that I should continue to jump around and rush through everything if I have conceptual issues. I'm starting to think I should try to keep things consistent, maybe instead of trying to learn syntax and what I can/can't do with the current language of a course I should choose a default language and work with regardless of what I'm currently learning until I feel comfortable enough where the syntax is only seen as a tool used to solve the problem.

As I've said before, sometimes I don't know how to phrase my questions especially when I don't even know how to even start. They might be interpreted as: GIB ANSRS PL0X... and then everyone will be mad and I'll be on the 'don't help that person' list of a specific programming section.

I'm always worried that if I said something along the lines of: I'm writing a program that holds an array of people and their weight and then gets the combination of the maximum number of people allowed in an elevator based on their weight... I've been trying to see how I can manage to calculate that value, but honestly I want some help on what types of things to consider when planning out what I should do.

That might cause a problem.
Was This Post Helpful? 0
  • +
  • -

#6 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7621
  • View blog
  • Posts: 12,849
  • Joined: 19-March 11

Re: Cracking the Programming Code

Posted 02 April 2012 - 09:21 AM

Quote

Type fast, think even faster if you want to survive in the industry.


No, think slowly and thoroughly first, then type deliberately. Making a mistake takes a tenth the time of doing it right. Fixing the mistake takes ten times as long as doing it right did. End result: you end up taking nine times as long to get to the same place.

As you get familiar with a language thinking slowly and deliberately through a problem will take less and less time, but it's never going to be a good idea to put typing first and thinking second.
Was This Post Helpful? 1
  • +
  • -

#7 karabasf  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 202
  • View blog
  • Posts: 417
  • Joined: 29-August 10

Re: Cracking the Programming Code

Posted 05 April 2012 - 04:24 AM

Just my share of thoughts ^^

Quote

As I've said before, sometimes I don't know how to phrase my questions especially when I don't even know how to even start. They might be interpreted as: GIB ANSRS PL0X... and then everyone will be mad and I'll be on the 'don't help that person' list of a specific programming section.


I think you're being a bit too pessimistic over here. Although I haven't been hanging for long on this board (became a member somewhere in 2008), I have seen quite a lot of useful advice, even when the posts were like textspeak and what not.
As long as you state what problems you're exactly encountering, you will always find an answer. Ok, sometimes it takes a while of questioning, but I guess that holds for every programming assignment/question (remember/seen this before? http://pileofphotos....1182820927.jpg)
Of course, some of the members are/can a bit harsh, but as JackOfAllTrades said: we don't know who you are. We cannot determine from your code and your post if you're an awesome guy who want to genuinely pass a course with understanding the principles. The truth is that many on the board hang around and just want the code to get a "pass" for that single course. There is no way we could determine which "type" you'd be.
So, be persistent, show the efforts you put into and be clear what exactly you want. Struggling over and over the same thing won't bring you further, it only brings more frustration. If you can't grasp the concept or can't solve the problem, better ask for another pair of eyes. Why do you think that at some software companies (not all companies do this though) have peer reviews before an user checks in code in the depository? And I know that even the most skilled programmers (at my work for example) will ask their colleagues for a second opinion.
So I come to a phrase my teacher(s) always said: "there are no stupid questions, there are only stupid people who don't ask questions." (Not meant as an offence)


Quote

I'm always worried that if I said something along the lines of: I'm writing a program that holds an array of people and their weight and then gets the combination of the maximum number of people allowed in an elevator based on their weight... I've been trying to see how I can manage to calculate that value, but honestly I want some help on what types of things to consider when planning out what I should do.


Lets assume you want to solve this problem. I can see you have a lot of requirements, but instead of throwing everything on one pile, split the problem in manageable sub-problems. Don't start coding, first think and think thoroughly before you even hit the keyboard. Think what you would actually need. So from the first lines, I can see that you have people and have a certain weight. So, one of the first things I would need is a Class holding a persons name (if you're interested in the weight of a certain person) and their corresponding weight. Next to the Person class, I would need to have an Elevator class, to put this persons into. As an elevator has a maximum load capacity, I need to have something to determine that, and so on.
Structure your problem and divide it in small chunks. If you're still struggling, try to determine the order of operations or to visualize how you would do it in real life. As for the order of operations, you can always draw a good ol' flowchart.
Many mistakes I've seen could be easily prevented by good reasoning (I gave supplementary lessons in programming for Freshmen at my faculty). A lot of people seem to have no patience, start bashing their keyboards and hope that "some magic" occurs to get their program working.

And of course the further you get, the more advanced your classes become, the more complex the problems will be (making you to headdesk immediately). But sometimes what helps, is taking breaks. Nobody codes for hours straight (unless if it's for a deadline, but even then), it helps when you're trying to solve a problem and you take distance from it. When I got my job, I didn't know anything about the API they were using, so I had times when I was really struggling with even basic things (insert Item R at positions X,Y,Z for example). Taking a small stroll at the floor of my office helps to clear your mind.

Programming is not only learning about the syntax, it's a (problem solving) philosophy. To be honest, I only started programming three years ago and currently, I am in a comparable situation as you are. I am pursuing my Masters degree in Aerospace Engineering, while following programming courses at another faculty. And yes, I noticed that the further you get, the harder it will be.
But it's still not an excuse of not asking questions. I learned quite a lot in the past 3 years by asking some of my programming questions here on the board and also by helping others. Solutions you could've never thought of are things which make you think. Sometimes I just see pieces of code and I wonder: what's wrong there, it should be working. And then you see the answer why it doesn't work (and pose the solution or read the solution if the question is already answered). Although this is rather passive learning, for me it proved to be quite useful ;)

So heads up and keep pursuing what you want to achieve! ^^
Was This Post Helpful? 0
  • +
  • -

#8 sithius92  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 36
  • View blog
  • Posts: 160
  • Joined: 01-August 08

Re: Cracking the Programming Code

Posted 05 April 2012 - 07:47 AM

There are a lot of good resources on the forum for books to read, some of them free e-books.

Quote

Structure your problem and divide it in small chunks.


This has been the most helpful piece of advice for myself. If you look at the problem as a whole, it's easy to become overwhelmed. By breaking down the problem into steps to accomplish, you can focus on one area at a time.

Don't get discouraged and don't be afraid to ask questions here. Like JackOfAllTrades said, if you show an attempt at your problem, we will be more than happy to help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1