Advice for a Java newbie taking a Java + Algorithm intro class.

Status
You're currently viewing only Tigranis's posts. Click here to go back to viewing the entire thread.
Not open for further replies.
Okay, So I took a class in Python about a year ago with a really nice professor (basically Comp Sci I class), who was extremely supportive of students having problems with learning the language and the syntax. Having passed that course with flying colors, I'm now thrust into a class with a professor that's a total dickwad, the kind that is out to get you (Comp Sci II, with my previous class being the prerequisite). He advertises the class as a focus on data structures and creating efficient algorithms with a side of java, basically its very little java, and a whole lot of other stuff. To me as a comp sci newbie, putting a very syntactic and type literal language of which I have had virtually no prior exposure to (I tried a little self-teaching to no avail) combined with a focus on data structures and algorithms sounds like trying to maneuver a wheelchair up a flight of stairs. The main questions I'm asking are:

- Can I expect there to be some traps with this combination, i.e, lack of java immersion proves to be fatal in the long run or is java actually rather easy for teaching data structures and good algorithm practices.
- What kind of bad habits can I develop from going from Python to Java that I can avoid so I don't get chewed out.

Textbooks are Algorithms and Data Structures and Head First Java
IDE is BlueJ

edit: reworded the thread title for more relevance
 
The Python class covered most of standard topics, (classes, file I/O and basic GUI creation using more simplified libraries than Tkinter) and we spent most of the time writing simple programs, such and dice rollers, poker games usually with simple GUI's. This particular professor is very by-the-book, he most likely will take nearly all the course materials from them. It also seems that hes a "there's one correct way of doing this" kind of criticizer. If you use a for loop to solve a problem that a while loop can do in two less lines, he chews you out. In the first class period alone, he straight up took a python program and translated it into java, but explained virtually nothing about what he was doing and why he was doing it what any of it means.

The more I'm thinking about this, what seems the most hazardous portion of this "essentially" introductory course is the fact that the professors "my way or the highway" approach is going to cause tons of problems in learning the material. Java itself doesn't seem terribly hard, but I have a feeling this professor is just going to make it hard on purpose which is why he smushed an algo class into an introductory course.
 
ShuggyCoUk":pipcs6mz said:
As to the use of java, for most data structures none of the OO aspects will be remotely relevant so really it boils down to writing C like code on a platform with array bounds checking and null reference checking. This is definitely a net win for what you're doing, be it building reference based structures (many trees and graphs) which would be likely be implemented in terms of pointers if the course was done in C or C++ or for ones based on using arrays (as you might for Heaps and the like).

So if I understand you correctly, most data structures in java are basically functional programming rather than being represented as objects. Sounds like the love-child of Python and C. You also make it seem like having static arrays is a good thing but from my experience with Python, being able to change the length of lists and dicts was a godsend on some of the applications that I was working on (other than the occasional error resulting from using a non-existent index on a list).

ShuggyCoUk":pipcs6mz said:
I should also point out that some universities take the view that, once you have learnt a 'paradigm'* in one language you should be capable of teaching yourself any other language in broadly the same genre and expect you to do that yourself (certainly that was the case in mine). With the exception of the type system (static verses dynamic) python is pretty much strictly more powerful than java** going to it as a language (as opposed to a platform) should be fairly simple if you can force yourself to be stop using any of the functional aspects of python unless you start dealing with generics.

* sorry
** in terms of the assistance from the compiler in providing more of the implementation compared to boilerplate either via syntactic sugar, support for first class functions/events and closures

So Essentially once I learn the libraries and get past the syntax its not much different other than not being able to actively use an interpreter to make changes on the fly. It may be difficult to get used to using classes for everything, as only the last two weeks or so in the python class did we actually deal with classes and interactions between them. the rest was purely functional code.
 
benInMa":2jc7dbmd said:
You will need very little of the Java Syntax for this class, and if you're cut out for this field of study you should be able to pick that syntax up extremely quickly. (It is an extremely reasonable requirement in a CS program IMO) Java's core syntax is pretty small if you ignore generics, threading, inner classes, etc.. which you wouldn't need for this class. What takes a while to learn with Java is all the libraries that tend to be used in real world software. Actually if he is good the professor should be teaching generics as part of this class, they fit in well with data structures and it is a natural fit to make you implement the data structures as generic types.

When I got back from the first class, I opened up the textbook and started working through a few of the examples and I immediately began to get a majority of the syntax after about 15-20 minutes of typing it. It's some of the stuff from today's lab which was arrays and the ArrayList library which promptly caused my brain to implode trying to figure out the difference between the two (or why the hell I was using ArrayList when making an array could have been much simpler...) It seems like they both perform the same function just that ArrayList allows for fancier stuff.
 
Faramir":1y5mtghe said:
Tigranis:
Among other things primitive arrays in java can't grow dynamically. They have to have to have a fixed size when they are instantiated.

Understanding something like this cheat sheet is more or less the point of your class
http://www.coderfriendly.com/wp-content ... ons_v2.pdf

rep++ to you sir, this looks like my new best friend.
 
Status
You're currently viewing only Tigranis's posts. Click here to go back to viewing the entire thread.
Not open for further replies.