Back to General discussions forum
Hello
I started programming about 2 months ago and I have solved 73 questions so far but still i dont feel my approach
problems has not changed a lot so i would like to know few things
I would like to know from you how do you approach or solve a problem
Like are they any steps you follow
Like first solve the problem on paper and then does the coding
Whats your way of solving problems ?
How do you approach the problem ?
How do you deal with a situation you get stuck ? you move to new problem or keep working on that until you
succeed . how do you stay motivated ?
Do you use a IDE ? Do you use debugger ? If no then how are you able to avoid them ?
Any advice other advice you would want to give.
Thanks
I first quickly read the page.
If it’s not enough:
I don’t use an IDE, unless you think that Kate is an IDE. No debugger other than print().
Firstly I create a simple unittest from example.
If task looks difficult and more completive i create a set of simpler unittests.
Now i'm using JetBrains PyCharm Coomunity Edition as IDE.
While developing I also like to use paper/pencil sketches.
Ashish,
For your first questions, I generally try to envision what needs to happen to the input data to get it to the desired output state. Then I use those steps to write pseudocode as comments to the code. Last, I work through coding the problem one step at a time.
If I get stuck, it depends on how badly I get stuck. It took me a long time to figure out the two's complement/parity check problem for example (thanks Python for making negative numbers so tricky!). I left that one for a couple of days. I figured it out a while later when I found out how to format numbers for a different problem. Most of the time I keep at it though. The satisfaction of finally getting it to work is usually enough motivation for me.
I use Code Runner (which I highly recommend for Mac OS X coders). It's a lightweight text editor that automates the process of invoking the commandline interpreter/compiler for about a dozen different languages, including lots of popular ones like Python, C++ and Java. But I don't use anything like Eclipse or XCode because Code Abbey problems really don't demand it (at least not ones I've gotten to yet). Occasionally, I do break out my scratchpad if I need to derive formulas to simplify a task (for example, "Duel Chances" needed a sum of an infinite series) or to draw a sketch to envision the problem's data set. I'll say potentially += 1 to PyCharm, if only I could get it to work on OS X Yosemite. It looks sharp. I've heard many good things about JetBrains products.
My tools:
Python interpreter in command line
Sublime Text 2
cmd.exe
notebook (paper, not computer)
TDD (Test-Drive Development)
Wikipedia and Google
For motivation read book "Mindset" by Carol Dweck. This book really change me. I hope, it change you too.
Google about Marshmallow Test, Locus of Control and Cognitive Bias.
Main advice: learn a functional programming language, not for everyday use, but for expansion of consciousness.