[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Frustrated about programming

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 3

I'm learning programming for already one year,specifically C language(but language is less important now, I would frustrated in any other programming language too). I did book exercises,could use formulas to calculate things, could write very primitive program, for short typical tasks that many beginners can do.(Well I'm also beginner), but a few days ago I found "project euler" and "codechef" but was stuck even understanding what the exercise was about(don't mean that exercises are hard). I was stuck even to calculate gcd of a number or write program to calculate even fibonacci numbers. and I really feel very frustrated now. I won't say that I'm not "mathematical-type minded", I'm good at math,even good at calculus at university, I know what fibonacci numbers are, but I couldn't do it with the code, or write the code.

I'm very eager to learn programming,I was dreaming about being a good programmer since I was 15. I know Computer Hardware,a bit Computer Science, love physics and electronics,have some future ideas. Even now I have a great motivation to sit and continue learning but frustration gives me a very bad vision of future. If I can't write such easy code to calculate fucking gcd, how I'm going to be a good programmer.

I don't even know when to call myself a programmer and more importantly a good programmer, 2 years ? 5 years ? 10 years ?

What can you tell me folks ? What was your experience as a beginner, can you write mentioned programs easily without thinking a lot ?

TL;DR I'm very frustrated that I couldn't write very easy program, and think that I won't be a good programmer in the future because of that.
>>
File: Sagan & Dhali.jpg (53KB, 700x467px) Image search: [Google]
Sagan & Dhali.jpg
53KB, 700x467px
I had a professor who put it to us plainly. You must learn algorithms. You will not be good at it when you start, but it is a struggle you must endure.

tl;dr Get an algorithms book. Struggle. Success.
>>
>>56072556

learning algorithms is necessary for more complicated things I think.

>Struggle. Success.

Yes, but learning without result is very annoying and frustrating.
>>
>>56072518
Are you in university OP? See if your uni offers an "Algorithms and Data Structures" class.

Learn about recursion, time and space complexity, and different types of data structures and how to implement them.

Good luck Opie.
>>
When you attempt to solve a problem, do you start writing code right away or do you actually sit down and think about how to solve the problem?

If it's the former, then there's your problem. Figure out an algorithm and implement it.

Dissect the problem. As an example if we take the GCD problem.

What we want: To find the greatest common denominator between two numbers.

Things we need:
* A way to check if a number 'x' is a common denominator between the two numbers a and b
* A way to see if this is in fact the largest number with this attribute

How do we do this?
* Check if x evenly divides a and x evenly divides b
* Finding the largest number with this property: Let x start with the value of the smaller of the values a and b. The GCD can't be a number bigger than any of the two numbers, so if we start here and work our way downward, we know that the first number we hit that matches the condition above will be the largest number with this property.
int gcd(unsigned a, unsigned b)
{
unsigned x = min(a, b);
while( x > 0 )
{
if( x % a == 0 && x % b == 0 )
{
return x;
}
--x;
}
}

Note: I'm not sure if GCD also counts for one of the numbers itself, i.e. if we have 15 and 30 is the GCD 15? I assumed it is.

Anyway what I'm trying to say is that before attempting to solve a problem, it's easier to first dissect the problem and break it down into managable chunks; divide and conquer. Someone will probably shit on the code I posted but that's the main point of my post.
>>
>>56072687
>Anyway what I'm trying to say is that before attempting to solve a problem, it's easier to first dissect the problem and break it down into managable chunks; divide and conquer.

This is very, very good advice.

I have entire notebooks with pieces of code and weird sketches in it.

Before I start coding, I sit down and kind of write out or draw what I want to do, and how to go about this. After that it's just translating that to code.
>>
>>56072687

Really great advice,thank you very much

>>56072675

Yes I'm student and I'm going to take related class.
>>
>>56072675
I am self-learner. Is there any book or sites that i can use to learn it?
>>
>>56072800
We used this book for the course:

http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP003087.html

However, I don't think it's a good resource for self-teaching.
>>
>>56072518
OP dont be a lazy cunt and just wine on 4chan that you didnt get gcd by your first few attepmts.

Instead try this: when dealing with new concepts (even not in the scope of programming) try to implement it.
In your case - take your fav IDE and write something. Anything. If shit doesnt work, try something else. Now this is the crucial part that everybody gets wrong: if you keep failing you just cant keep doing the same shit over and over again.
Think differently OP. Try new stuff, try to input errors by hand ( its better to know what doesnt work than not knowing it), maybe even try rewriting your syntax, wtv.

If nothing goes right, try getting help. This is also tricky and just plainly copying other people's code wont get you far. Try asking a friend for a clue, or get a pseudo code and rewrite it as actual code.

If you still dont get it - search it on google.
Find your answers, but then again: try to fully grasp what other people wrote. Why it works. What doesnt work. Try to give it something you know will fail. Try everything until this new algorithm is yoir best friend.

And most importantly: write a lot. Just sit, and write shit.
>>
>>56072809
thanks for the input. Any source of learning is good reference.
>>
>>56072518
I get the impression English is not your first language. Where you from?
>>
File: rr811.jpg (111KB, 550x687px) Image search: [Google]
rr811.jpg
111KB, 550x687px
>>56072675
I took a Algorithms and Data Structures course and it was really good for learning when to use different data structures. The algorithms we learnt were sorting algorithms which tied in with big o notation.

>>56072518
first time i did that course ^^^ I failed and found it tricky, didn't think I could become a programmer if i'm failing simple courses, but to my surprise many others failed as well, almost a 1/3rd of the class. The second time around they had made the course MUCH harder but I made sure to work my ass off until i fully understood the content that we were going over that week. Managed to pass after having to wait a year to resit and was happy I didn't give up like many others.

moral of the story is lots of people out there struggle with programming (I cant write C for the life of me), but something i've been told by friends who are good programmers is that you just need to simply program anything, I always ran away from programming since I'm not that great at it, when I should have been doing more of it in my spare time. It's like reading, the more you read the bigger your vocabulary can grow, the same with your knowledge about a language your programming in.

try think of something really basic you can program and just complete it.
>>
>>56072962

Russia :)

>>56072979

The problem is that why you get into programming, you think that you can do anything, you can program complicated programs, create impressive GUI,write web and android apps etc. but when you learning isn't that easy.

I think that I should know more and I should do more,because I learn it for already 1+ year and still I'm a beginner. If I got a job and see how other programmers work and deal with hard taks, I'd happy.

>>56072837
thanks, I never copy the code,I always write it myself. Yes when I don't understand the problem, I always google it, but it doesn't help a lot,because the answer isn't original and mine.
>>
>>56073034
>>56072979
>>56072837
Not OP but I am a CS student at the moment and my pipeline for writing code isn't great. If I have to think more than two steps ahead or back for data flow, my brain just stops there and I will stare at my code for hours. I usually end up resorting to simple trial and error until my tests behave like they should.
>>
>>56073048

play chess
>>
>>56072518
How long are you into your career op?
>>
>>56073034
maybe you underestimate that even googling the solution to your problem and implementing it into your own code is quite an accomplishment.
>>
>>56073121
I won't call it career.

I'm interested in programming and in computers since I was 15. Now I'm 18 years old, I'm still beginner,amateur you call it. I have some knowledge, but it's still nothing compared what I should know.

>>56073135
it's not accomplishment, everybody can search code in google, copy and compile. You learn nothing from it.
>>
>>56072709
>I sit down and kind of write out or draw what I want to do, and how to go about this. After that it's just translating that to code.

I try doing this but I can never figure out how to do with the code what I have planned out.
Thread posts: 20
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.