Java Programming Question (not technical)

This forum is for actual topics of discussion that do not fit the above categories.
Locked
trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Fri Jan 10, 2003 12:34 pm

klinky wrote:However, I think you would best be learning C++ first. Then move onto Java. I hear alot of people find that Java is easier doing certain things. So if you get acustomed to the ease of Java and you try to migrate to C++ you're going to get all befuddled over why it doesn't work like it works in Java.
Actually, a lot of constructs work the same way in C++ as they do in Java. C++ and Java have their own set of novel constructs, but they are very, very similar.

Java teaches you some good programming habits, such as staying away from multiple inheritance (it's a good idea in theory, but in practice, it's a mess), defining clear interfaces for interobject communication, adhering strictly to the object-oriented paradigm (which is a good thing if you plan to learn the OOP style), and so on. (There's something new called aspect-oriented programming that's emerging; I'm not quite sure what it's about.)

danielwang
Village Idiot
Joined: Fri May 03, 2002 12:17 am
Location: Denver, CO Banned: Several times!
Contact:
Org Profile

Post by danielwang » Fri Jan 10, 2003 4:14 pm

I would, realistically say, that C++ and Java are not necessarily better than each other in the general sense. WHich language you are going into is your choice depending on the scenario.
C++ is good for raw hacking, and high-level languages like Java (proprietary) and PHP are good for quick apps.
In the middle you have things like nasty little Perl and ASP/VB .NET (it's not as bad as the Perl Lobby wants you to think), which allow you to fine tune your apps for security and performance which easing the process for n00bs and script kiddies.

I decided to analogize this to how a (language) programmer would use an ATM machine. I didn't want to do the toaster, toilet or airplane jokes, for OBVIOUS reasons.

Java:
Stick card in ATM. Enter PIN. Take money and card.

Perl:
Stick card in ATM, but pieces at a time. Pointer pointer pipe pipe balh blah. Move the PIN code from something to something else. ReDim PIN as a integer value... clobber cobber clobber. Module communication blah blah. Now enter the pin using some fancy API. Blah blah.

ASP/VB.NET:
Make sure you have the right ATM card, and the right PIN. Make sure this is an ATM machine. Declare the ATM machine and the PIN. FInd out the ATM's interface. Move the ATM card object and send it into the machine, keeping the channel open. Move the pin and send. Take card and money, and make sure it's your card and the right amount of money...

Hard Level:
EXCUSE the horrible syntax. I am making it easier to read.

Code: Select all

#Declare ATMCard AS Magnetic.Card.ATM.Access
#Declare PINcode AS Integer
#Include atm_io.h
#Include atm_pincode.h
#Include junkapi.c

var PINarray = for each char in MyBrain[PINcode] // Get's PINcode from memory
var integer PINlength = PINarray.length[] class _.Length
var int PINcode == for Each char in PINarray while i < PINlength { PINarray[i],i++, }

/* Check the PINcode to make sure */

for Each char(trim(PINcode)) in PINcode while i!=PINlength{ if char(trim(PINcode,i) != PINarray[i] then GOTO Oops! else next}

/* Give the ATM the Card! */
get ATM.CardSlot
obj CardSlot = use atm_io::ATM.CardSlot
CardSlot << ATMCard

/* Give the ATM the pin...

// Ensure that the buttons on ATM  are in the right order
You don't want to see the rest.... it's just too silly

Locked

Return to “General Off Topic”