Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 11 of 11

Thread: What to code? Interested in learning Java, a member introduction of sorts.

  1. #1
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Question What to code? Interested in learning Java, a member introduction of sorts.

    Imagine not having coded anything for a couple of years. Yeah, I've got the itch all right.

    I might be interested in getting into Java programming at entry level - if I had some reason to do so. Sure, I could just create small non-essential applications for the purpose of learning the language, but since I'm not new to coding as such that doesn't really seem like a worth-while endeavor.

    As a reference my latest foray into coding involved modding the game Sid Meier's Civilization IV and I learned the Python language as a result. I started with making my own custom scenario and later helped other would-be modders to get their code in order, and also to tutor up-and-coming Python scripters, one of whom actually went off to study computer science and surpass any of my own limited programming skill. I also created sort of a "modding language" enabling non-coding modders to make very advanced custom scenarios. I'm not currently playing the game though, and am not likely to get into the latest edition of the game either. So I might be done with Python as a language, and also have no reason to pick up Lua (which is the scripting language associated with Civ5 modding) either.

    I never did get into C++ programming, simply because the compilation procedure involved with modding the CivIV SDK seemed, well, messed up. That would have been the next logical step and I probably should have taken the plunge. I never did though, so I'm moving on.

    Anyhow, an old friend of mine who works as a professional programmer, and who actually attributes his own career to my early attempts at teaching him the Basic language, tells me about this Java thing, of which I know little to nothing about. I know I could learn to code it fluently, if I only had some purpose with working in Java in my spare time. Some goal to work towards. Basically any worth-while programming job (for me at least) suitable for Java.

    Any suggestions? Like, is there some manageable way to get graphics for your own Java based online game? (I'm looking to code something, not design graphics for it as such.) What are some other cool things, besides games, you Java-heads have cooked up yourselves? Feel free to post links to your stuff, whether these are games or not.

    As a side-note, I've lately been into table-top role-playing games (and despise anything electronic called a "role-playing game") and could potentially be interested in coding something that can be used for prepping - or running - such analogue games.

    Anything along these lines would probably be web-based though, right? So that implies me learning a bunch of technical server, web-page and browser associated stuff (not to mention tailor everything for mobile platforms) to get the application off the drawing board, right? In order to learn Java as such though, I probably don't have the patience, or spare-time, to learn several new computer skills simultaneously... Should I just focus on making something that would work on my own home system first, and only worry about getting it "out there" once I can grasp Java?

    And for a presentation, I'm a almost 40 years old construction worker based in central Sweden. It does seem like I missed the buss for a career in programming a long time ago, but why not feed my flame for coding as a pass-time? My other hobbies are writing role-playing game materials - and also running games as such. I'm thinking there might be a synergy there, somewhere...

  2. The Following User Says Thank You to Baldyr For This Useful Post:

    MinorLushy (July 5th, 2014)


  3. #2
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Welcome to the forum .

    That's quite the background there - and was a very useful read. To get to the point, Java is a fully OOP language that is used for all purposes
    apart from really low level technologies such as device drivers and Operating Systems. With the advancing of the language syntax's
    developed with each update to the JRE *current version 8 is the latest changes to the language have been well received and much
    appreciated from all levels.

    Java can be used to write games, and is being used in some larger studios which a couple of years ago was unheard of. It can also be used
    to write desktop applications and Applets for the Android OS (which is where the jobs are at the moment).

    One of the reasons some people shy from Java is because it's a managed language. There is no manual memory handling (pointers) which was
    common in C++ and essential in C. Not having access to memory manipulation has it's advances however. You do not need to
    clean up after each object is used, and the allocation (how much memory an object will use) is all done internally,

    What this gives you is more freedom to get the task done. Java is also a more forgiving language than some others, but it can be hard
    to learn all the different libraries. Java can also handle GUI applications through the Swing and Awt Libraries, making it simpler and
    faster to design and implement GUI applications.

    As for the syntax, it is not all different from a 'C' style language, and anything new is pretty easy to pick up. Java is also a verbose
    language - used on many platforms and for many different things.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  4. The Following 2 Users Say Thank You to Ada Lovelace For This Useful Post:

    Baldyr (June 28th, 2014), GregBrannon (June 29th, 2014)

  5. #3
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Thanks for the swift reply!

    I'm glad to hear about Java being managed as far as memory allocation is concerned. That will lower the learning-curve for me, as I know Python and no C++, although I've stared at some C++ enough to be able to follow some of it.

    I guess what I'm looking for is some way to manage the GUI end of things, and will probably look into Swing and Awt at some point. Thanks for the tip!

    The word "verbose" does seem to fit the description, as I'm sorta getting a head-ache from looking at sample Java code. I do see the similarities to C++ but get lost in the minute specifics of each line, of which all will of course seem obvious as soon as I do dig into the language. All I know at this point is that it isn't Python and that anything I code will have to be compiled before I can run it.

    As for some worth-while coding project, I might just make something associated with my day-job as a painter/decorator. I occasionally need to do some calculation of prices and materials and what-not at my current job, and instead of getting and utilizing some existing software I might just make my own. I doubt anyone else is considering the same factors as I am anyway.

    Anything one codes nowadays probably needs to be ported to the Android OS thing at this point anyway, so then I have a reason to get to that also, eventually.

    I might just enlist my programmer friend to show me the ropes and getting me started with Java, as to flatten that learning curve some more. Yeah, that is pretty much the plan at this point.

  6. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    I've sent you a reply to your PM, where I basically suggested trying out Processing to learn the basics of the language without worrying about Java boilerplate code.

    But to answer some of your questions here, Java is a multi-headed beast, and some of those heads include:
    Application development, using AWT, Swing, or JavaFX.
    Server-side development, using Java EE, Spring, etc.
    Android development
    Game development using frameworks like libGDX or JMonkeyEngine

    Which "flavor" of Java you pursue depends on your interests and end goals. But starting out with Processing will give you a chance to learn the basic syntax, imho.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #5
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    I've read through some tutorial online and feel like I could actually start doing this Java thing. I know, the proper way would be to also do all the exercises and start small and all, but I feel pretty confident I can get (back) into coding starting off with something more ambitious.

    Namely a character generator for a Swedish role-playing game I'm currently playing. Now, this particular game really doesn't warrant a computer application to crunch any numbers or even to keep track of values on the character sheet, as it is pretty minimalist in its design. I nonetheless have a idea that I want to implement, and that is creating the "attributes" of a character based on a horoscope, as astrology is a central theme in the game's setting. So, instead of the player simply allocating 8 points worth of values into four attributes corresponding to the classical four elements (Earth, Wind, Fire and Water), the player would go through a number of steps aiming at creating a horoscope. These would include a location of origin (both a general part of the setting and the more exact region therein), the birth year, the time of birth - and most importantly; the astrological sign corresponding to the month of birth. As pretty much everything in the setting can be boiled down to the old Greek phisosophy of humorism. There will probably also be some control question at the end, specifying the impact of some of the attributes further. (Like that the setting would assume that the value of the attribute "Wind" would be higher at a later stage of one's life than early on. This would however not be true if the person is youthful at hearth.)

    The point of this character generation application would be to focus more on the temperament or personality of the character, rather than on physical and mental abilities. Since each of the attributes inform both the character's abilities and mentality. Otherwise it is simply be a matter of allocating attribute points to whatever the player thinks that the character world benefit from in the game. Like the attribute "Fire" represents the flame that burns in the character's hearth (the temperament), it is also used for situations where the ability to take action (the physical attribute) is relevant. Like in a fight, making it a high priority attribute for fighter type characters.

    The problem with this is of course that most characters would have similar attributes, or that some players would opt to have basically a fixed set of attributes for every character, ignoring the impact thereof on the character's personality and the way those attributes would be (role-)played. By instead focusing on the origin and temperament of the character you might get somewhat unforeseen results - but still recognizable from the choices you made in the creation process - that might be interesting enough to trump whatever would be "efficient" as far as the rules are concerned. The challenge, then, would be to find a way make that character efficient in it's own right.

    The final output from this application would then be to present, first and foremost, a description of the character's temperament and personality, like a horoscope would. This text explanation would then be represented by a set of attribute values corresponding to that description.

    As far as coding this thing, I'm going to take a look at the Enumeration interface for most of the sorts of data used in the process of making a horoscope. Like enumerated objects for astrological signs that correspond to months, or the four elements making up the character attributes. It'll be interesting to see what impact this decision will have on my design! I'll get back to you guys on these boards once I have some questions or if I need suggestions on specific implementations.

    I'm also gonna look at ways to set these enumerated objects to the numerical values and the string values (basically descriptive text shown to the user in some sort of GUI or another) without assigning these line-by-line in my actual code. I'm thinking that I could import values from either a text or a xml document and set these to the enums in an automated process instead of doing it manually - I'll probably prototype it with reading string types from a .txt and later transfer everything into XML or something. We'll see, I guess.

    Later I might also put in the rest of the character creation in this applications, with stuff like character abilities and such, so I need a robust framework from the ground up. Also, I want to make things easily customizable as game masters (such as myself) will inevitably wanna make changes of their own to accommodate their own house-rules, take on the game setting or style of play. This shouldn't be harder than to say mod a computer game like Civilization, which supplies you with most of the game settings in easily customizable documents.

    Oh, man - this is gonna be so much fun!
    Last edited by Baldyr; July 5th, 2014 at 11:33 AM.

  8. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Interesting. I think you'll appreciate the power of OOP once you get into your project a bit. Keep us posted.

  9. #7
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Yeah, I'm thinking OOP all the way. Actually, I've coded a fair amount object oriented projects in Python so this will be no leap by any means. The difference seems to be that Java more or less requires one to be 100% OOP, where as in Python one could define some globals, helper functions and whatnot, outside of any class. But I don't see any problem as it should be as simple as to implement a class for the global stuff, making it "public", or whatever, so that it can still be accessed throughout. (I actually think I saw a lot of that in Python also, as others were doing their stuff completely with OOP.)

    Speaking of OOP and Python versus Java, my observation thus far is that Python is somewhat simplified, meaning that many things are implied, whereas one has to define everything explicitly in a high-level language as Java. This was to be expected however, and explains a lot of these wacky modifiers and properties one is expected to assign all classes, methods and even variables. Learning these specifics ought to be the single hardest thing applying what I already know about programming in general and OOP in particular to Java.

    What sub-forum could one start a post about one's own project? Like a continuing thing or a development journal of sorts.

  10. #8
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    I don't know Python, but I believe you're referring to Java being "strongly-' or 'strictly-typed" when compared to Python and many other 'simpler' languages.
    What sub-forum could one start a post about one's own project? Like a continuing thing or a development journal of sorts.
    Sounds like a blog. Do you have access to the "Java Blogs" section of the Forum (a tab or control at the top of the page), and are you allowed to start one? If not, let me know, and I'll find out what the access requirements are.

  11. #9
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Quote Originally Posted by GregBrannon View Post
    I don't know Python, but I believe you're referring to Java being "strongly-' or 'strictly-typed" when compared to Python and many other 'simpler' languages.
    Probably, yes. I believe Python to merely be a "scripting language" of sorts, since it doesn't require any compilation to execute. And on that note, I actually compiled my first ever program today! It was only the token Hello World tutorial thing since I needed something to try as I was experiencing issues with setting up my system environment. I still wonder how I could use the Command Prompt to compile and execute my code in the My Documents (sub)folder on my old WinXP machine, without firstly navigating to the folder using the cd command? (I did try to add a Path similar to the main Java \bin folder, but I guess that is for executing executable files and not compiled Java applications? Do I add a shortcut to java.exe and javac.exe in the source code folder or what?) Generally I'd say I have a much better handle on actual coding than messing around with operative systems and such...
    Quote Originally Posted by GregBrannon View Post
    Sounds like a blog. Do you have access to the "Java Blogs" section of the Forum (a tab or control at the top of the page), and are you allowed to start one? If not, let me know, and I'll find out what the access requirements are.
    Hmm... That would lend itself to something along the lines of: "Getting into Java - a beginners journey" thing. I'm not sure I should spend more time that I already am doing writing about coding, but instead get on with the actual programming!

  12. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    how I could use the Command Prompt to compile and execute my code in the My Documents
    There are ways on Windows to create shortcuts that will open in any folder. I have several. I forget how I did it on WinXP. I'm on Win7 now.

    To make a command available in any folder set the PATH variable. See: PATH and CLASSPATH (The Java™ Tutorials > Essential Classes > The Platform Environment)
    If you don't understand my answer, don't ignore it, ask a question.

  13. #11
    Member
    Join Date
    Jun 2014
    Posts
    33
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: What to code? Interested in learning Java, a member introduction of sorts.

    Almost one week into actually coding Java I'm steamrolling my project on my spare time, learning valuable lessons as I go. What I got thus far are classes for storing global values (abstract), reading data from file (with all the functionality in place to ensure easy customization or moddability of the finished application by the end user), user i/o interface (only a method for printing to command prompt thus far), debugging, and for testing the code. I also implemented a way to dynamically assign values for enumerated types of various sorts parsed from file (using my data reader class) and display this data in descriptive text strings.

    My next step is probably to separate all the classes and whatnot into separate source files and collecting everything into a package. I also think I need to implement some exception handling, so I'll have to read up on both these subjects. Once I have a dedicated file for the enumerations I'll continue adding more stuff (like geographical locations, astrological signs and character archetypes) to what is already there (like the character attributes, months of the year and major landmasses in the game world setting). All instance attribute data is parsed from text files on execution, mind you.

    Only then can I get on with mapping individual geographical enums to landmass enums - probably these need to be accessible (hashable?) in both directions for the application's purposes. Any ideas on how to implement something like this?

    Eventually I'll get to the actual application that takes some number of user choices as input and creates something similar to a character horoscope - and also a legal set of character attributes. Everything is fully customizable from the ground up, by the way, like you could use another set of character attributes completely (even another number of attributes). So the application could be used in a completely different game setting - and also accommodate some house-ruling of the game mechanics.

    By the way, is there any way to define the actual enum names (like WIND) by parsing them from a text-file. Like I'm currently using real world enum names for monts (like JANUARY) while the corresponding in-game name is Persil. Sure, I could just hard-code the enum name to PERSIL, but the whole point here is that it could be something else completely in another game setting. No big issue really, as the user will never see any of the enum names, but only as an exercise. It would also make my code much prettier (and shorter!) if I could also move all enum names to the data files.

    So instead of doing this in my source file:
    	public enum Month{
    		JANUARY (DataReader.readNewDataLine(1, 1)),
    		FEBRUARY (DataReader.readNewDataLine(1, 1)),
    		MARCH (DataReader.readNewDataLine(1, 1)),
    		APRIL (DataReader.readNewDataLine(1, 1)),
    		MAY (DataReader.readNewDataLine(1, 1)),
    		JUNY (DataReader.readNewDataLine(1, 1)),
    		JULY (DataReader.readNewDataLine(1, 1)),
    		AUGUST (DataReader.readNewDataLine(1, 1)),
    		SEPTEMBER (DataReader.readNewDataLine(1, 1)),
    		OKTOBER (DataReader.readNewDataLine(1, 1)),
    		NOVEMBER (DataReader.readNewDataLine(1, 1)),
    		DECEMBER (DataReader.readNewDataLine(1, 1)),
     
            }
    ...I could shorten it to a looping block by putting the enum names in my data file. Like this:
    PERSIL:Persil
    GYRSAG:Gyrsag
    FATESKA:Fateska
    ISKAMSI:Iskamsi
    MISISKA:Misiska
    MINDE:Minde
    MELENDO:Melendo
    BYRDO:Byrdo
    GIREN:Giren
    TARAGAN:Taragan
    NUSIN:Nusin
    TANNAN:Tannan
    As the above example illustrates, the enum names themselves would be changed to reflect whatever game world setting is associated with the game at hand, instead of using the real-world names as identifiers.

Similar Threads

  1. New Member Introduction
    By Ram85 in forum Member Introductions
    Replies: 1
    Last Post: January 6th, 2014, 12:49 PM
  2. Help me with my code (im learning Java)
    By R0bsterz in forum What's Wrong With My Code?
    Replies: 52
    Last Post: April 24th, 2013, 06:47 AM
  3. Self-Introduction as a New Member.
    By iorlahasam in forum Member Introductions
    Replies: 2
    Last Post: August 14th, 2012, 06:59 AM
  4. Help!, newbie, interested in Java, Very simple code, completely stuck!
    By munkybunky in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 30th, 2011, 07:25 AM
  5. new member introduction
    By Idy in forum Member Introductions
    Replies: 2
    Last Post: January 12th, 2010, 03:29 PM