I have done BSc IT and know quite a few programming languages. I had learnt basics of JAVA earlier. Now I want to start learning a new language and many of my collegues have suggested that Python and Ruby is the most used language in industry. So my question is, which one should i learn first, JAVA or Python ? Thanks
Well, i surely cannot give u a direct answer that u should use java or pyhton…
So, I’m gonna share with u pros and cons to both.
Syntax: JAVA might appear a bit more lengthy compared to python short code, but as you mentioned u have learnt basics of java, this wont be much of a problem for you.
Libraries: Python has much more libraries as conpared to java, also, its support of long integers is better than java. But, this all may appear quite overwhelming at first. I too know basic python, while my preferred lanugaue is java in which i have coded nearly an year.
Just one thing, do not try to start both languages simultaneously, because it might end up complicating both. Just choose a language and stick to it until u mastered it. At that point, it would be good to learn more languages.
PS:You can google and get different opinion. I just shared mine. Choose what suits u.
@taran_1407 Big reply so put it as answer
You’re really good coder then. I started coding this year in june, and its been 6 months and I still don’t know about graphs and dynamic programming and so many things to become a O.K coder!! Can you give me some tips to become a coder like you? Right now I’m learning data structures, I always use brute force in codechef to make my programs work, but now I want to learn algorithms and different data structures. What would be the best way to become a good coder? And I’m a sophomore(2nd year in CS) first semester about to end in few days, When I took CS in college I had no background knowledge about programming, my friends just suggested me to take it. And for the first and second semester of programming, I had teachers who didn’t really teach me why we’re doing programming and for the first and second semester, I used to learn the code for the test even for swapping two numbers. So, basically I started coding in September last year(2016). I learnt about what programming actually is when one of my friend challenged me to solve a question on codechef, it was a beginner question and it took me more than 10 tries to solve it but when I saw that green tick it made me so happy!! Then I finally learnt what programming is and we can solve problems like codechef problems with programming which is fun. So yeah, that basically is me!! And don’t forget to give me some tips
@kunnu120 - I started seriously in April-May though. Before that coding was just a pastime,long story short I didnt seriously start it then XD. Its not a year, its just a few months. :3
Also, brute force are important. Brute forcing means that atleast you know HOW to do it. Now to do it efficiently, you will see some tweaks and data structures being used, which should be easy to follow for Easy-medium problems. Take a step at a time, focus on what you should do now.
If you decided to do seg tree, give it time, perhaps 3 days to a week. You need to read various long blogs, practice questions (finding an easy question for a topic is hardest part- but once you do it, you are good to go).
Regarding how to learn algo, I am flexible. I first try to read from blogs. As usual, at times I STILL have a doubt at parts the blogger skipped, so I then refer to video tutorials (directly jumping to the doubtful part- videos take time to be seen).
The thing is, you should know your level and the next level. As of now, when people ask me for “How do you solve 5 questions each long?” Then honestly, I say there isnt much difference between your level and mine. Its just applying concepts.
For example, last long, p4 (that string question- “construct a string such that it has shortest possible substring which is palindrome”) it required nothing, just brute force. You just need to make the computer do the brute force for you. The problem MANY people faced was “unable to think the pattern.” Its alright, its not possible to always guess what the setter thought of while he made this type of a question. Many times alternative approaches are not there, and only a single approach gets AC. The clever thing to do was, to not to do tedious calculations and tweaking for small-moderate values of N, but rather writing a brute force which would give you answers for some values of N. The solution of first 18 values of N was enough to crack the question completely.
For the first 4 problems of long, I tell you, they are nothing special. They are simple concepts. (I replied this to yet another mail yesterday XD). p4 might be something from data structures or graph theory, it will be clear which one to use for that. From p5 things start getting serious. The jump from p4 to p5, p5 to p6, and p6 to p7 require lot of patience.
Another thing is, pry on others successful submissions. Just how many times is a single reading of editorial enough for us to get the question? And how many times is the setter and tester’s code even readable, or the most optimum? Abuse the feature that you can look on others solution. If you come across something new (eg- DS, or command)- learn it. Thats how you can introduce yourself to Data Structures and some “tricks” (:p). The hardest part, of course, is understanding that solution. But once you get the hang of it, you will be comfortable.
Lol, too many things at once, isnt it? XD
EDIT: Lol XD. Sorry for typo,
i am newbie too… and from my experience i can tell that python is much suitable for beginners…
Thank you everyone for your valuable answers. After a bit of research and your opinions, I’m looking forward to get started with Java.
I can only say one thing: large Enterprise projects can do without Python, but they are unlikely to do without Java. So to teach Java initially, in my opinion, is the right decision.
If you looking for practice on Java I can get advice about one free course. It’s called CodeGym. Maybe it will be helpful for you.
Java is sexy as well. <3
Not as much as C++
C++ can only be termed as fascinating trouble…
But i never got around liking it much except for its 0.00 time solutions.
Java is something like love at first sight
PS: i like ur veiw @vijju123
taran, you started coding a year from now?
Last september i started coding, if u dont count that i was studying ip for 1 year and a half in which i didnt even knew about arrays. (syllabus have java swing in netbeans only)
Only around last sept i started learning about arrays and programs.
U tell, when did u start coding?
I know @vijju123 starting coding a year from now too and he’s also an excellent coder like you
My first coding competition was Codejam this year, (almost clashing with my 12th exams ).
PS: I too have submitted brute force solutions to problems in current long challenge which i cannot solve. It’s a common practice, and is understandable. Brute force is the base to full solution.
Post-post-script: Use Python, swapping two numbers is just a,b = b,a
How did you do on codejam?
I started seriously in April-May though. Before that coding was just a pastime,long story short I didnt seriously start it then XD. Its not a year, its just a few months. :3
Qualified the qualification round, Was near to qualify for 2nd round too in Round 1A, but wrong file upload…
All in all, didn’t make it to round 2.
Did u participate in codejam?
No, I didn’t participated in codejam I came to know about codejam 2 months ago lol
@vijju123 sorry, I didn’t know that please give me your blessing to become a coder like you (ಥـْـِـِـِـْಥ)
In what field do you want to go? Decide on basis of that. For CP, JAVA is preferable for me over python.