Ask HN: Try helping me
While programming , I always get stuck up with inputs and conversions , i write the code (the basic logic) pretty quickly but when it comes to making it general like without having to type input , then comes the trouble, not just that , it always happens with type conversions , any suggestions ?
6 comments
There are some really neat resources that have come out in the past little while to help beginner programmers. I would recommend http://www.codecademy.com or http://learnpythonthehardway.org - both excellent resources that teach in different ways, so if one isn't working for you the other might be worth a shot.
In my opinion (but not everyone's) it's better to start with a language like Python or Javascript that makes problems like type conversions and input pretty trivial, so that once you've learned the more structural skills you can go back and mess around with pointers.
In my opinion (but not everyone's) it's better to start with a language like Python or Javascript that makes problems like type conversions and input pretty trivial, so that once you've learned the more structural skills you can go back and mess around with pointers.
Thanks .
Yeah with Python , there wont be any problem with the type, but i'm learning java , and i'm solving project euler problems and as you know the numbers they give are pretty big , for instance consider a 1000 digit number , in python u just type a= number, but in java we use string and then use Charater.digit with String.charAt , i guess u understand my problem , today i was stuck up conversion of string to int array , these things really consume time , and logic i dont take much time , its just these things , this is sounding little rude , but ireally didnt mean to be , i'm just frustrated..
Not at all - I understand. One of the most important skills to have as a programmer is choosing the right tool for the right job. That's not to say Java can't do what you want, but you might find it's better designed for tackling large abstract problems than algorithmic and mathematical ones.
For example, check out this list of people who have completed 250 or more problems (only works if you're logged in): http://projecteuler.net/index.php?section=scores&show=ve...
Correlation isn't causation and all that, but this shows you the tools that the people who finish all the problems want to use are, in order, C/C++, Python, Java, and Mathematica.
In the end, though, it's really a question of what your goal is. If you want to learn Java, then learn Java (but I would consider learning it using problems better suited to it). If you want to solve Project Euler problems, you'll have your work cut out for you just figuring out good algorithms; it's best to do it in the language that will give you the least trouble.
Incidentally, while Python automatically turns large numbers into digit arrays, if you stick with Java you might find its equivalent BigInteger class useful: http://download.oracle.com/javase/1,5.0/docs/api/java/math/B...
For example, check out this list of people who have completed 250 or more problems (only works if you're logged in): http://projecteuler.net/index.php?section=scores&show=ve...
Correlation isn't causation and all that, but this shows you the tools that the people who finish all the problems want to use are, in order, C/C++, Python, Java, and Mathematica.
In the end, though, it's really a question of what your goal is. If you want to learn Java, then learn Java (but I would consider learning it using problems better suited to it). If you want to solve Project Euler problems, you'll have your work cut out for you just figuring out good algorithms; it's best to do it in the language that will give you the least trouble.
Incidentally, while Python automatically turns large numbers into digit arrays, if you stick with Java you might find its equivalent BigInteger class useful: http://download.oracle.com/javase/1,5.0/docs/api/java/math/B...
Thanks sam, i guess i'll use python to solve Proj Euler and thanks alot for your time :)
Try using some libraries provided with each language. You also need to learn some design patterns.
Sorry murugan , can u be little more eloborate. Links would be really great .