• Post Reply Bookmark Topic Watch Topic
  • New Topic

Programming Guide  RSS feed

 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a teacher of Computer Science teaching Java from September and so having to refresh limited and old knowledge. I have written a guide and would appreciate those with experience and knowledge giving this the once over and let me know where I have made errors, etc. the code in the guide works but I may not be recommending the easiest method, the best or may make unfounded claims/statements.
All advice gratefully received: https://drive.google.com/open?id=0B4wb08uWF_QIakJHTjRtWHVZaFU
 
Stephan van Hulst
Saloon Keeper
Posts: 7987
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to check the guide out a bit later, but the first thing that I've noticed is that you immediately jump to using NetBeans. I really recommend teaching new-comers to Java to use the java and javac commands first. Learning a language is hard enough without running into the hidden complexities of an IDE. It will also instill your students with the understanding of how the machine handles the code they've written, rather than this "magic box" that just runs their program when they press play.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Likes 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

There is a lot to look at in 111 pages, so it is only possible to scratch the surface.

Most people here would recommend you don't start with NetBeans or another IDE. We would use the command line/terminal and for the first few months miss out package names.
Page 6f: there are also documentation comments. Some people would say that /*...*/ single line comments are different from /*...*/ multiple line comments. Have a look at the old Sun style guide, which has about 4 types of comment all on the same page.
System.out is not a method, but a field of the System class.
Page 10: Java® convention is not to use initial CapitalLetters nor _underscores in variable or method names. Similarly on subsequent pages.
Page 11: Consider a little section about the + operator for catenating Strings.
Page 12: Example 2 would usually be considered poor style.
Page 13: Example 6: suggest a link to the corresponding Java Tutorials section about the % tags.
Page 14: Suggest change import to single‑type import: import java.util.Scanner;
Page 15: Class dogs should probably be called Dog. Capital D and singular. A Dog object represents one dog.
Page 18: Suggest they change the example with catenating the space to use the % tags.
Page 22: Like the example which doesn't calculate floating‑point arithmetic precisely. Suggest make more of the imprecision.
Page 32: Teach them to avoid the == operator on reference types.
Page 33: Correct to use equals, but it is not called a property; it is called a method. Suggest pointing out that every object has an equals method.
Page 42: Nice explanation of the switch statement Suggest not using January = 0, if possible. Find out about the java.time.LocalDate class and use the new Java8 date time API throughout. More details in the Java™ Tutorials.
Page 46: The middle part of heading for for statement might better be called the continuation condition, despite what the Java Tutorials say.
Page 52: They will need more explanation about the extra () around the = in the while loop.
Page 55: Convention for constants is to use CAPITAL_LETTERS and _underscores throughout.
Page 56: Routine is not a standard Java word. Say things public are accessible to all code inside and outwith the class. Things private accessible to code inside the class. Tell them always to declare fields which are variables private.
Page 58: All Java arrays are one‑dimensional. Even those with multiple []. Those are not 2D arrays but arrays of arrays.
Page 61: Always use i < myArray.length in a for loop. Don't let them copy the number for the array size. Let them find out what happens if you write i + 1 in lines 14/22 rather than (i + 1)
Page 63: What happened to the 10th line in the printout? You entered 10 numbers and the box only shows 9 printed.
Page 63: Footnote. Never mind the hats and energy drinks. Coffee which dissolves the cup is much more likely, and have you seen the sort of drop‑dead gorgeous girlfriends the geekiest programmers seem to have? Yes, the variable is a box in memory. In arrays of arrays, the memory contains pointers to the inner arrays. It is not arranged like a chessboard. The Java runtime does actually create 8 rows and marshals them into an 8‑element array.
Page 67: There must be a spelling error. I think nave should read navel.
Page 74: Line 17 is unnecessary because you are (correctly) using try‑with‑resources. Suggest explaining why this was introduced to reduce the tedium of having to write close(). Also, if you don't close a writer, you may never flush it and the text may fail to appear in its destination.
Page 84: Java uses neither term: procedure nor function; they are always called methods.
Page 89: Class names should always start with CapitalLetters usually without _underscores. The height variable should be called height not iHeight. Similarly page 90: name of variable should not include its type.

I hope you don't think I have been too critical, and good luck with the course
 
Brian Barrick
Ranch Hand
Posts: 67
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So just as a suggestion from someone whose learning Java via notepad++ and command line. I'd go ahead and start with NetBeans just to show where they might end up as a developer someday. Use it to explain the basic then as you move into explaining things just as classes, methods and packages I'd start using notepad++ and command line. This way they get an understanding of what's under the hood and at the same time they can keep in mind what they saw in the IDE.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, thanks Stephan and Brian. I will deal with the IDE in a moment so please accept this instant thank you for now.

Now for the contribution from Campbell Ritchie, I cannot express my gratitude enough. I have passed this booklet on to several people within education but failed to gain anything of substance (which, unfortunately, does not surprise me). I want to ensure that I get this right and so decided to approach those in the field, with trepidation, to gain the kind of feedback I have just received.

My background is as a programmer but my Java programming is purely self-taught for a simple android app. Beyond this my programming is VB6, VB.NET, Assembler (6502, Z80, x86), C++, C and Pascal (yes, I am THAT old). You can see from my terminology that I am mixing concepts and terms; something I want to rectify when teaching and your comments have helped enormously. I will now do a re-write and post an update soon.

As regards the IDE side (welcome back, Stephan and Brian, who I am in agreement with) I should point out that my students are 16 and if they have done any programming it will be Python but most will have done nothing. The IDE gives us an instant coding experience rather than the complexity of writing the entire file/folder structure and comprehending compiling, etc. I have hopefully avoided using IDE-specific coding aspects and so they re learning general Java programming but within a simplified system. Remember that we have to assume our students know nothing, that we have to get them to understand everything in the book within 3 months with 2 hours per week. By March they have to take a complex program and be able to repair faults, improve performance and add new features under exam conditions with no knowledge of what they will be asked to do prior to the exam itself (though we make suggestions on what is most likely to be asked of them; we get these suggestions right and wrong in equal measures).

I fear that adding to this the complexity of using simply the command line approach would lose students instantly with no recovery.

I may be wrong and am open to a counter-arguement, especially since my history is IDE-driven so may be seeing complexity where none exists (noting Brian's statement that reflects my current thinking).
 
Brian Barrick
Ranch Hand
Posts: 67
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious what is their motivation for taking this class? Are they all motivated kids who voluntarily took the class and genuinely interested in learning or do you have a mix of that and a few who are there for the credit or some other arbitrary reason?
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your reply implies experience; most people assume that since students select their courses they have natural desire to achieve and learn. We will have those who will go off and work through the exercises and book within a few weeks, allowing us to explore the language to a far greater depth. Others will struggle and we will have additional support for them but they will struggle to conclude the guide by the end of year. Another group will remain at a very fundamental level (we had three this year who could not grasp the concept of variables despite lots of support by three different teachers and a wealth of resources).

So a mixed bag if ever there was one.
 
Brian Barrick
Ranch Hand
Posts: 67
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've developed a bit more interest on the subject of education over the past decade or so that has lead me to looking at it from a different perspective. I think some people, even in public education, have realized that students who are motivated to take a class do well but they do even better when all of the other students are on the same level. My son is a motivated learner and his teacher has requested that he be placed in a class of like minded children next year and he is just going to second grade. So I am impressed that they are attempting to improve the system in that manner. It definitely wasn't so in my youth.

Good luck with your class I think your guide looks pretty decent so far...coming from a beginner.


 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like it. With some work it could sit in that good middle ground between the how to pass your test books and the other ones that try to be philosophy books...

I think some of the complaints seem a little nit-picky, but one thing you should definitely do is change from underscores to camelCase. earth_weight in Java should be earthWeight for a var or method or EarthWeight for a class.

I don't mind the IDE stuff. I remember changing from Microsoft C to brand new Borland Turbo C back in the day. The Turbo IDE vs MSC command line caused me to be a lot more interested than I was before. So unless you're going to stand over them with a stick, the IDE might encourage them to be more interested.

You could have an appendix that covers the command line tools, and also -- the location of everything Java in a Linux system and a typical Windows system. This is something you have to pick up piecemeal now from searching forums. I'm getting a warning about updating the JRE on my Linux system but I'm too uninterested to go through the mess of figuring out how to do it.

You might also include an introductory chapter near the end about Swing which is for creating Java GUIs, and maybe something covering the most common uses of Java in the real world.

Best wishes!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with using an IDE from the beginning is that you have a steep “learning curve”. You want the learning curve on the Java® not on the IDE, otherwise some people will get bogged down with the compexities of the IDE. Brian Barrick's suggestion of Notepad++ and the command line is good; I think Notepad++ is a really good product, and I have some suggestions to make the most of it here. IDEs are for people who can already program and want to program faster, but I suspect they are good for people with very bad spelling because they support a spell-check. Once you have done a bit of programming with a text editor you can easily move onto an IDE, as you obviously have done.

Disagree with Guillermo Ishi about Swing. Either teach it or don't teach it, but scratching the surface is probably a waste of time. You haven't got enough pages to do Swing justice, I think, so I would suggest leaving it out altogether. The suggestion about uses for Java® however is good.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary Newport wrote: . . . complexity of writing the entire file/folder structure and comprehending compiling, etc. . . .
When you are only using one or two classes at a time you can get away with using a java folder as the unnamed package and you can dispense with the complexity of package names. Once your applications are big enough to merit named packages you will have enough experience to move onto an IDE.
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The learning curve isn't that steep if you use the defaults and mainly use it as an editor. Don't forget there is also a learning curve with command line - commands, switches, directories, paths, and so on! That can be very foreign. The syntax checking is nice too, but its suggestions for fixes are most often bad!

The intro to Swing would be basically to let the student know it is possible to have a GUI, like the programs they're used to. Doesn't need to try to be complete. It's an introductory book.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, thanks everyone. I am starting the re-write tomorrow and all this will feed in.

In terms of NetBeans, the reason for choosing this was that the install was incredibly simple and you can start programming within seconds of install. We use Notepad++ for HTML/CSS and PHP/SQL teaching (I do love Notepad++) but the command line/text editor route appears far more complex for non-programmers than the other way around. This may be a newbie viewpoint (actually, it IS a newbie viewpoint) but I am basing this on the fact that I wrote the book from install onwards and it really was simple.

I have to avoid GUI details completely; we are command line focussed for the first year, with GUI available for the second year for those with the right attitude and drive.

I need to go through the variable name convention; need to get my head around what everyone is saying here. Too much coding in other systems leading to me combining conventions and creating confusion. I still make errors in terms of String (programming) and Text (databases); which can cost marks!

Once again, thanks so much; incredibly grateful and impressed with the help from everyone.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mkdir java
cd java
javac MyProgram.java
java MyProgram
… and you don't have to write the first line again. It is quite easy to compile from the command line as long as you don't add .class to the last line.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have now updated this guide, taking in all the pointers given (especially the ones made by Campbell Ritchie).

Thanks so much for the help. Please click on the original link to see the updated document.

Oh, and the error with nave/navel is on a screenshot taken from Google so not something I can change; in fact I now feel its a quaint feature.

I will be adding some new sections, additional chapter challenges and I think I will remove the answers into a separate booklet.

Any and all comments gratefully received!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Offer a prize of a chocolate bar for the first person to find the misprint you copied from Google.
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gary,

I have few tinny comments:

1. Page 18 (1st screenshot), page 23 (code snippet in a comment). It seems you're placing closing "curly" brace to a wrong location. It is quite important in terms of code indentation where it is placed. It suppose to be like:
Not

2. Page 43. There is something you'll need to decide whether it is too advance or not to explain to your students. In Java these two conditional operators "&&" and "||" are considered as short-circuit. So, what I mean:

3. Page 48, 54, 55. Please think again, if it is a good idea to give students such a positive impression about omitting curly braces around "if", "else" if it contains single statement. Maybe would be enough to mention, that technically it is optional, but not recommended, as it is error-prone. And page 59 proves that. Very difficult to understand what is happening in that code snippet.

4. Page 75, 105. Once again just reminder, check variables, methods naming convention. Looks more like Python, C naming convention.

5. I miss a very important remark, that Java is a case sensitive language. Think about it if you want to add it somewhere.

Well, that's it for now. Did a quite massive job, well done.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much Liutauras Vilda, I have now modified the code (or made comments) in response to your feedback. In the case of the IF I felt it was often easier and more appropriate to keep the code I had generated but issue a warning along with the code. However in other cases I have rewritten the code and (hopefully) the text as well.

I have added a couple of lines in the Displaying Data section about case sensitivity since this is where they first encounter coding.

I fear the boolean logic is too much for this particular guide but we do cover boolean logic in the course so will think about how we could integrate this idea in their programming sessions. Nice idea.

I assume you mean for the students Campbell (since you have already highlighted the Google error). Nice thought!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to emphasise case‑sensitivity is to develop a class as they watch.When you get Kettle@0cd46a7b as output you go and look at the System class, then at out, then at its println(Object) method which refers to print(Object). That says it calls String#valueOf, so you look for String#valueOf(object) and it says it calls toString. So you look up Object#toString and it shows something similar to what you got and you realise you must override toString. You should be able to find all those methods by following links in the API dicumentation. So you do so, adding the following to the Kettle class, and it makes no difference:-Then when it doesn't work you find out about the @Override annotation and you write @Override before the tostring method and you find it won℉t compile. Then you ask them whether anybody can see the problem. Then you correct tostring to toString and it will work.

\u2103 look like this: ℃
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary,

I have to mention page 59. As there is a very solid mistake.
Code snippet:
Beside that you wrote single "=" instead of "==" in order to check equality, note to the students, that they should never be using "==" to check Strings equality, as Strings are objects, and it would be checked only if the reference variables refers to the same object.
To check if two Strings are equal, they should use >>> stringVariable.equals("stringLiteral") <<<.

I can still find quite few mistakes, but didn't mention it here as I'm not sure you have enough time to tune that. If you want - just let us know, we can go further.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The more mistakes we find now, before the guide is distributed, the better.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liutauras Vilda and thanks for pointing that out; I thought I had caught all those as I went through the code. Will change now.

As Campbell states, I want to rectify as many errors as possible. I have already re-written most of the code examples (ignoring the Answers section for now since I am going to be re-writing this once I have the main guide where I want it to be) and am happy to do so again if needs be. The most important thing is to ensure our students get the most accurate information as per Java programming that I can achieve. It needs to be as close to ready by September but can be a work in progress even after this date (though hard for me to find the time once the term begins).

I should point out that this guide and the answer booklet is to remain as an online resource and I will be sharing it with any and all educational establishments that would like it at no cost; I do not intend to make money from my abuse of your kindness.

I will now make those changes and upload the update. I have now separated out the Answers section but won't post that until nearer the conclusion.
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gary,

Here are couple of comments and suggestions:

Page 23: Code snippet "animal == "giraffe". Needs to be used equals method.

Page 25: Current * explanation at the bottom of page could be misleading.
An example somewhere above could help, what would happen with "System.out.print("Sum: " + 4 + 4);" and "System.out.print("Sum: " + (4 + 4));".

Page 29: In a table, methods are missing an examples. Could be for instance: calculateBonus, getSalary, setTemperature.

Page 31: "The first thing to note is the use of the comments; our code is getting more complex and so we need to begin to annotate our code as best as possible."
This is something to make clear and highlight from the beginning, that choosing meaningful variable, method, class names - often is more important than comments itself.
Quite often code is being overloaded with meaningless comments, which makes program even worse readable.

Bad example:
Better example, without even using comment

Page 43: One example in a table might provide with double NOT !! to give them better understanding about it.

Page 44: Might need to add an example with compound boolean expression by enclosing in parenthesis, in order to show different precedence of evaluation.

Page 46: Would expect to see it as a method, rather than a class "CanYouVote". Ideal case to start with methods.
Usual situation comes up every day, that many people put all code in a main method. And it leads to confusion and misunderstanding of program flow. And very difficult to debug.

Page 59: Not correct use of method "equals", should be "string.equals(argument)" << missing parenthesis.
Nested if using single "=" rather than "equals".

Page 71: In a table, char is initialised wrongly, should be used single quotes char fred = 'd'; not "d".

Page 79: Could give an exercise to rewrite "for" loop by using "while". Or give an example with placed "counter" increment above "print" statement, and let them sort out why printing different results than "for".
Would help better understand loops.

Page 114: Error when divide by 0, let them try to divide by 0.0 and discover "mystery of Java".
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay Liutaurus, thanks for the pointers and I have implemented most of these. I will explain my reasoning for the others and feel free to disagree.

Oh, and please check my 'fixes' to ensure you feel I have completed them adequately.

We deal with boolean logic and double NOTs (as well as De Morgan's and applying individual NOTs to a single operator). I didn't want to explore this too far in the guide since experience tells me this is best dealt with in the general theory than in programming.

I deal with using individual methods later. It is difficult to recognise when it is best to begin to get students to stop overloading the main method but we generally find that this is best dealt with once they are confident with the general structure and commands of a language. Introducing it now is likely to confuse the weaker students whilst not benefiting the more able by much. By the end most students should be going through all of their programs and creating a single program that contains all their solutions, each one as a separate method and with a menu to move between them.

I like your idea of the 'for' and 'while' question; I will place a question at the end of this chapter shortly.

Again, I will do the same with 0.0; I am unaware of the issue myself and so looking forward to finding out about the 'mystery of Java'.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The mystery is explained if you go through the Java® Language Specification=JLS about the / division operator. And if you can actually understand the JLS
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I reviewed again, here is some more comments and suggestions:

Page 31: I'm not sure about the necessity of Hungarian notation topic, I think this page could be used more valuable. I could be wrong.
For instance: .java vs .class files. Scopes of variables. Shortcuts for assignments (i++ vs i = i + 1), pre-increment vs post-increment.
Maybe show the technique how to track variables on a table by imitating pencil and piece of paper (I'd go for this, here are the powerful basics they need to learn). Example:
Pencil and piece of paper technique:

Page 46: Time ranges in a table example in my opinion are inaccurate.
I think should be:
00:00 until 12:00 Good Morning
12:00 until 17:00 Good Afternoon
...
So it would look like:
If follow the current example logic which in a table now, you'd loose 60 seconds which are not represented, but do not take this into consideration would be wrong also:
00:01 until 11:59 Good Morning
12:00 until 16:59 Good Afternoon
...
Page 55: Selective Switching example braces wrongly placed.

Page 77: Might for the better students show one of sorting algorithms.
Might even give them a chance to get highest mark from the course by rewriting in recursive way.

Page 107: I think overcomplicated (reading, writing binary files) explanation about introduction to methods. Should be something simpler, as: "canYouVote", "isLeapYears", "calculateArea".
Also, lack of information about different return types, parameters, methods overloading (explaining method signature), method calling itself (recursion, this is something they will really need in a near future).

P.S. I think Campbell Ritchie was right about showing them how to write and compile programs with plain text editor and command line. I know NetBeans is something who looks more professional in terms of guide, but probably it is not the best time to show them it as a general main tool to write programs at this stage, I'm afraid.

Maybe at least give them one session to work with command line, so they would know it exists.

I think I can't see anything else major. Hope your course will go well - best luck, Gary.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much once again, the guide is getting so much better (and bigger).

Okay, I'll deal with each one (I have made some of the changes recommended but have not yet uploaded an updated version since I have other parts I want to alter/add).

PAGE 31:
Difficult with Hungarian Notation since it has no real relevance to Java but does elsewhere and I am unsure if the exam board will use it in their example code in March for the exam in June. Since it does not have relevance to Java and given some of my next few points I think you are correct; I'll drop it altogether here.

I do make mention of i++ in a couple of places but feel I may extend the Performing Calculations section to include i++ and the differences between post- & pre- processing. Also may be sensible to include the first consideration of the order of calculations in a little more detail here.

I intend to deal with .java and .class but much further on; once they have a basic grasp of the differences between a text file and a binary file.

We deal with trace tables as a general theory lesson (along with pseudocode and flowcharts) and I would prefer to leave it there and not in this guide. I will, however, include some trace table questions so they can connect theory to practical.

Again, scope of variables is dealt with in a theory session but I may deal with this in a new section anyway. Pondering where in the guide right now.

PAGE 46:
I spent some time investigating the times of the day and didn't even see the flaw in my logic. I have also not dealt with this table once introduced; thinking I may either present a solution or set it as a question.

PAGE 55: Fixed

PAGE 77:
Again, sorting and searching is a theory session, as is recursion but MUCH further on (and I know there is quite a but if debate about the value of recursion?). There are no marks or any questions relating to recursion in the first year (actually is also true about the concept of classes but Java forces you to understand more than you would otherwise).

PAGE 107:
Will revisit this code and make something simpler. You are right, I could use the code from earlier to get this across in an easier fashion.

Worried about going in to too much at this point but I do agree that the other points (differing return types, methods overloading, etc.) are useful. I'll include them somehow!

I have begun to write a section near the end on programming without an IDE. I have already encountered an issue on my test system that I cannot resolve at the moment and need to find a simple solution since I can guarantee the students will encounter it as well; javac is not recognised. I have included the path in my Windows system variables path but still not working!

I do understand the issue as regards the use of the IDE but am also aware that our weaker students will simply fall at the first encounter of command line unless they have a baseline understanding of the code itself. In fact some will never move away from the IDE but I would not expect to see those in any JAVA programming department soon.

Thanks for all your help, it has been invaluable and I purchase you a virtual drink of your choice!

Once I have added and amended in the next couple of days I'll post up the updated version; need to take time on the questions and answers sections now.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote: . . . . . .
P.S. I think Campbell Ritchie was right . . .
Of course I was right I am right about everything. And if you believe that, you will believe anything.

What about this? That is the idea of else‑ifs, but you do need to get them in order.
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary Newport wrote:Difficult with Hungarian Notation since it has no real relevance to Java but does elsewhere
I could try to see usefulness in dynamic typing languages, but even there never seen it, because each language has own naming convention, and probably not intended to use "third parties" conventions, but I'm not that old as others here, having in mind the ones who likely are right about everything, so they could state their solid opinion about it I think if such a question about Hungarian Notation would come up in a programming exam, where Java language is used as a standard, I'd consider it as a poor style question.

Gary Newport wrote:and I know there is quite a but if debate about the value of recursion?
Valuable to understand divide and conquer algorithms, it is something that will come up in university course about data structures and algorithms, in job interviews, even though it is rarely used in industry. Quite many people struggling to get confident with recursion, so probably giving them some kind of easy exercise could keep them interested and busy for couple of days or weekends (of course, probably the ones, who are actually interested in programming).

Gary Newport wrote:I have already encountered an issue on my test system that I cannot resolve at the moment and need to find a simple solution since I can guarantee the students will encounter it as well; javac is not recognised.
Check our FAQ here (<- link), you might missed something.

Gary Newport wrote:I do understand the issue as regards the use of the IDE but am also aware that our weaker students will simply fall at the first encounter of command line unless they have a baseline understanding of the code itself.
And this is why it is not recommended They could stop concentrating on what are they doing, where their logic flaws, since IDE's gives a warnings, suggestions how to fix them, auto imports, even fixing syntax mistakes, adding curly braces, auto indenting and formatting code (in different words - helping to cut corners). But I think you answered your intention already, you're teacher, so you know better from your experience.
 
Gary Newport
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I believe I am now close to completion and it is suitable for despatch.

Thank you for all the help and advice. I believe I have incorporated everything I can without taking this way beyond where the students need to be, have recoded (again) to try to ensure that I have honoured conventions.

Any further pointers would be gratefully received but I now need to write the Scheme of Work for 4 courses and the Answer booklet for this guide, as well as add at least 2 more breakpoint sections with coding problems matching those set by the exam board as suitable for the course!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
You have put a lot of work into that guide.
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary Newport's Guide, p130 wrote:I Have A Problem I Cannot Solve!
One of the best resources you have available to you is the internet and, more importantly, the professional forums that exist. I cannot recall how many times I have resorted to a posting to help identify a solution to a problem that appeared insurmountable, only to have someone reply with a simple solution (or even arrive at a solution myself just after making the post).
Remember to introduce yourself, be honest about the purpose of your post, explain your problem clearly and make sure you are not asking them to do your homework for you (they will detect that quicker than you think).
Make sure you have checked beforehand using a search engine such as Google to ensure that the solution to your problem is not already easily available, or something similar that could help you solve the issue.
One such forum is http://www.coderanch.com/forums, which is focused on Java; though there are others out there.


I also think you did a great job and achieved a decent programming guide for your students. And I'm glad to see, that you promote JavaRanch community in such a professional and nice way.

Well done, Gary
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote: . . . or even arrive at a solution myself just after making the post . . .
I notice that is from Gary Newport's guide for students.

There is a name for that sort of problem‑solving technique. It is called rubber‑duck programming. Because you get in the bath and explain the problem to the rubber duck in nice simple terms the duck can understand. And all of a sudden, the solution appears.

There is also Campbell Ritchie programming. It is very similar, only you have to use simpler terms to him.
 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary,

I went through the guide once again, I really like it, you improved that a lot from the very beginning.
Can't wait the final version with a smell of fresh ink, I might download for myself one copy

Ah yes, well deserved cow.
 
Sachin Tripathi
Ranch Hand
Posts: 368
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Loved the case sensitivity example of toString()
Things like this were the most horrifying things for me ,one month before.One spend lot of time finding such errors.It made me remember the pain I had gone through in my starting days with java
 
Simon Roberts
Author
Ranch Hand
Posts: 182
9
Java Linux Netbeans IDE Scala Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:[...] the first thing that I've noticed is that you immediately jump to using NetBeans. I really recommend teaching new-comers to Java to use the java and javac commands first. Learning a language is hard enough without running into the hidden complexities of an IDE. It will also instill your students with the understanding of how the machine handles the code they've written, rather than this "magic box" that just runs their program when they press play.


From a teaching perspective, I must respectfully disagree. Nothing succeeds like success, and while they will surely need to learn all the "under the hood stuff" eventually, letting that, and the inevitably repetitive edit - compile - re-edit cycle slow them down at the outset is unlikely to have good consequences. The IDE will further enhance success by reminding them in a timely fashion of the methods they have at their disposal.

 
A Rex
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much for uploading the programming guide online, i am a beginner and it helped me out loads.

Many Thanks
Rexy~
 
A Rex
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just wondering when all the answers will be uploaded for the questions, i have got all the questions right so far i think, but i want to make sure its the most efficient way of doing it.

Thanks

Rexy~
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!