12-13-2015, 01:40 PM | #1 |
h
Join Date: Sep 2008
Posts: 1,631
|
learning to code
I'm a first semester comp sci student and my intro course is an intro to object oriented programming which focuses on java, but I'm kind of struggling since I have no prior coding experience and I might not pass this course
I want to continue learning to code, but it's really discouraging that my first experiences with writing code have been this difficult' Does anyone have any words of wisdom/encouragement or advice on how to not suck at coding [if it makes a difference] I've been reading this book to supplement course material http://www.headfirstlabs.com/books/hfjava/
__________________
|
12-13-2015, 01:42 PM | #2 |
Banned
Join Date: Nov 2013
Posts: 8,563
|
Re: learning to code
advice is to learn how to code
honestly, if you're a first sem comp sci student and you're getting shit on by java I would recommend selecting a different major |
12-13-2015, 01:44 PM | #3 |
Banned
Join Date: Nov 2013
Posts: 8,563
|
Re: learning to code
|
12-13-2015, 01:48 PM | #4 |
h
Join Date: Sep 2008
Posts: 1,631
|
Re: learning to code
that's not encouraging
but thanks
__________________
|
12-13-2015, 01:52 PM | #5 |
Banned
Join Date: Nov 2013
Posts: 8,563
|
Re: learning to code
java is used as a stepping stone in programming for a reason, it's a very easy language to pick up and it's widely used throughout the world. are you having trouble with the language itself (aka syntax), or are you having trouble with how the language actually works (aka logic)
if it's the syntax, my advice is to spend all your time writing snippits of code if it's the logic, it depends on how long you've been in the class. if you keep struggling, you'll be utterly left in the dust later on the lack of programming experience can really only be fixed one way: by continuing to program with java. Last edited by choof; 12-13-2015 at 01:53 PM.. |
12-13-2015, 01:57 PM | #6 |
h
Join Date: Sep 2008
Posts: 1,631
|
Re: learning to code
seems more like syntax because it feels like there's a ton of vocabulary that i just am not familiar with
and i haven't written a lot of code this semester since most of the course is science and learning OO concepts i can write plenty of test code in eclipse though so i should start doing that
__________________
|
12-13-2015, 02:11 PM | #7 | |
FFR Player
Join Date: Nov 2013
Posts: 108
|
Re: learning to code
then get to coding, brEh
__________________
Quote:
|
|
12-13-2015, 02:23 PM | #8 |
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: learning to code
Learning how to code is certainly not limited to anybody with special abilities. I've never had any computer scientific courses or any maths honor class or anything else that encourages logical thinking in highschool and I still learned how to code in Java to an intermediate level. Being good at coding requires dedication and experience, none of which you currently have. You are still at point 0 and need to understand its concepts and how coding languages require you to think. You really only learn by coding yourself and trying to get programs to do what you actually want.
Java as a first programming language with all its concepts is certainly not easy to learn, but once you get that down, you will have less and less trouble picking up other (imperative) languages, getting used to them, and knowing how to program. It's like a thinking paradigma you need to understand and get used to, it comes with time. I really encourage you to constantly keep yourself busy with programming simple tasks and also challenging yourself to tackle bigger and bigger problems, even if it's just trying to understand terms like public, private, void, extends, abstract, interface, and so on. |
12-13-2015, 04:02 PM | #9 |
Kawaii Desu Ne?
Join Date: Dec 2007
Location: The Kawaiian Island~
Age: 30
Posts: 4,182
|
Re: learning to code
It's kinda hard to help considering the vagueness of the OP. So the only thing I can provide is some generic/vague suggestions:
-practice -If you get stuck, look at someone else's code (Google is your friend). When one first starts learning something, sometimes it's easiest to learn by imitation. Try copy/pasting some code and modifying it to suit your needs. If you do this though, make sure you go through the copied code line by line, and try to understand exactly how that piece of code is working. Eventually, you'll be good enough to where you don't need to Google them anymore (e.g. I would hope don't have to google "how to loop through elements in array" 30 million times before you can do it on your own). You can pick up a lot of things from someone else's code such as good coding patterns and good code styling (e.g. variable names, use of whitespace, etc). -Focus more on the algorithm/logic and the different paradigms in imperative and OO-programming as opposed to the syntax or memorizing function names in the Java standard libraries. Personally, I'm horrible when it comes to the latter (syntax and function names) but those are a quick google search away. The syntax will come naturally to you over time. -Learn how to read the official documentation. Tutorials and stuff can help, but sometimes you need to go directly to the source to get the information you need. For example, this is the official documentation for Java's String Class: here. -Learn how to effectively use your IDE. Make use of any code completion features and such. For example, for many IDE's, when you type a function call and start entering parameters, it'll tell you what the parameters are. -Comment your code. First, by commenting your code, it forces you to think about what the piece of code is actually accomplishing. Second, comments help for when other people (including future versions of yourself) have to read your code. -When trying to program, sometimes it helps to not jump straight into coding. In essence, you want to create an algorithm. In cooking, people call this a recipe. If you can write a recipe, you can code. First, think about how you would describe the algorithm ("recipe") to another person, in English terms. It can even be an algorithm that involves the other person using a paper/pencil setup. Now, for each step in the algorithm you came up with, clarify the step and/or break down the step into smaller steps such that every step is unambiguous. Once you have your collection of unambiguous steps, then they should easily translate into code. -Learn how to trace your code (by hand). Given a piece of code, you should be able to tell what the output is going to be. This is a good skill for debugging, especially for small test cases and edge cases. |
12-13-2015, 04:26 PM | #10 |
I am leonid
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
Re: learning to code
Try learning functional programming language as well when you have time (Haskell, Scheme, etc)
|
12-13-2015, 07:39 PM | #11 |
FFR Hall of Fame
|
Re: learning to code
Agreed. J is an excellent language to pick up.
__________________
|
12-14-2015, 03:17 AM | #12 |
x'); DROP TABLE FFR;--
Join Date: Nov 2010
Posts: 6,332
|
Re: learning to code
No love for Scala?
|
12-14-2015, 08:45 AM | #13 |
Kawaii Desu Ne?
Join Date: Dec 2007
Location: The Kawaiian Island~
Age: 30
Posts: 4,182
|
Re: learning to code
Jon here is struggling with the fundamental paradigms and general syntax of an imperative programming language (in this case Java). I don't think trying to get him to tackle functional programming languages is the best course of action at the moment, at least from a pedagogical standpoint.
|
12-14-2015, 10:54 AM | #14 |
ur worst nitemare
Join Date: Jan 2003
Age: 32
Posts: 1,626
|
Re: learning to code
i'm a current comp sci major and one of my professors said the same exact thing to the whole class about halfway into the semester (about assembly though, not java)
it is a tough field and if you stay stuck at this same level relative to your peers you're gonna have a bad time when you have to do interviews later on i'm gonna add the book i used to get comfortable with java to choof's list: http://math.hws.edu/javanotes/ you should be looking at a lot of sample code and this site has a pretty decent amount of it and yeah this
__________________
some feathery f**k |
12-14-2015, 11:07 AM | #15 |
Digital Dancing!
Join Date: Feb 2006
Location: 80 billion club, NE
Age: 31
Posts: 12,982
|
Re: learning to code
SML was pretty OK, too bad my professor was a massive dickhead about it.
__________________
|
12-14-2015, 11:11 AM | #16 | |||
🥓<strong><span style="col
Resident Overseer
Join Date: Mar 2007
Location: Kingsport, TN
Posts: 7,648
|
Re: learning to code
Quote:
Quote:
Quote:
Best of luck with things. Practice really does make perfect.
__________________
|
|||
12-14-2015, 03:31 PM | #17 |
Digital Dancing!
Join Date: Feb 2006
Location: 80 billion club, NE
Age: 31
Posts: 12,982
|
Re: learning to code
Guys he's in java 1, basically learn to regurgitate the following:
pretty much copy paste this into template.java and cp it to whatever you're working in Code:
import java.util.Scanner; public class PROGNAME{ public static void main(String args[]){ Scanner input = new Scanner(System.in); } } Code:
Objname refname = new Objname(args); Code:
refname.someMethod(args); Java is verbose as shit and I hate it. The syntax can get pretty messy, especially with exception handling. Commenting, tracing, and pseudocoding are good practices that have been suggested in this thread.
__________________
|
12-14-2015, 04:09 PM | #18 |
x'); DROP TABLE FFR;--
Join Date: Nov 2010
Posts: 6,332
|
Re: learning to code
Honestly, I recommend Python to most people learning to code, because it's about as close to pseudocode as you can get. Once you get the hang of actually making stuff, it's much easier to introduce things like C++, Java, etc.
|
12-14-2015, 07:20 PM | #19 |
h
Join Date: Sep 2008
Posts: 1,631
|
Re: learning to code
thank 2 all
if i pass this final i can take the next course in the sequence in the spring and i have 6 weeks to prepare and get ahead if i fail then ill have to wait until next fall to retake it which is really shitty...
__________________
|
12-14-2015, 07:42 PM | #20 |
Wiki Staff
Join Date: Jun 2014
Posts: 307
|
Re: learning to code
Everyone starts from somewhere and just trying to ask for info/help is definitely the right mindset for improving! To re-emphasize what everyone else said, it's important to think about how you want to code the solution before jumping in and realizing halfway through that it doesn't work and you have to start over again. One of my professors used to recommend about 50/50 ratio for planning/implementing, and from experience I pretty much agree give or take depending on the problem, because usually if you design or do pseudocode correctly, implementing isn't too bad.
I think at this point it's just important to ask as many questions about your code as possible. Don't just read books about Java, do lots of practice, some OOP concepts/data structures that are hard to memorize without context (inheritance, polymorphism, interfaces, abstract classes, lists, hashmaps, etc.) can become a no-brainer once you see how they're used. And also try implementing (or thinking about implementing) things different ways. Then ask, "well why does this way not work?" Or, "Why is that way better?" If you still don't get it, look for a different way of explaining that makes sense to you - everyone thinks differently, and that's okay. And if you run into any weird syntax you don't understand, GOOGLE IT! In Java, keywords (final/constant/protected/etc.) have vastly different meanings, and learning how to properly use them can prevent bugs... And another nice thing is, a lot of the keywords' concepts carry over into other languages, so it's usually worth it to try understanding them. I definitely recommend investing the time to ask the questions now, when you're in your first semester, rather than later when a good foundation will be critical and you'd also be busier with other upper level classes xD Another big thing that was very helpful for me was learning how to debug properly to find out what's not working. Adding print statements is fine at first, but a debugger is much more powerful. Eclipse has a good debugger. Last edited by llyair; 12-14-2015 at 07:47 PM.. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|