Why am i studying there!?!

Can you fire your java-lecturer for this?? I mean … on the next slide he talked about naming conventions. :joy:

public interface isAlcohol extends canBeBought
{
    public int getPercentage();
}
2 Likes

Are his naming conventions at least correct…

Mostly yes, the only thing i am not sure of, is that he wants all final's to be written in UPPERCASE and not only the static final's …

Edit: ok i just found aisreadyinstead ofisReadyin his convention-table “example” column … sooo… ^^

Percentages should not be integers. Fire him.

3 Likes

Yes. - But can you really blame them for it? We got for our advanced course final exams official classes from the government as well and they aren’t as bad as that but still not realy good. This is why the most students in my course have a realy bad code quality and if I try them to show off how to do better they call it stupid, because it has some more lines but it’s OOP and not just some spaghetti-really-hard-to-expand-code.

The “public” key word in front of the method is also not necessary because interface can’t provide private or protected methods.

If thats uni i hope those students never get a degree in computer science. If its a highschool/elementary school its understandable.

It’s a highschool. :slight_smile:

Ahh… I can see your point then. I started programming long before, but I took a high school course last year. It was not exactly focused on convention, and was based on Java 5, rather than 8. The students weren’t particularly good either. As in, the forgot ‘new’ and implemented EVERYTHING in terms of Strings.

Sounds painful but I think that’s how everybody started… it’s just the pain that you feel when somebody is judging code by its length.

Personally, my high school computer science class was pretty neat.

My teacher actually respected the fact that I knew far more about java than he did, and if he ever did something wrong or out of convention, I could actually interject and correct him.

I was just lucky though.

I mean, my comp sci teacher wasn’t bad, it was just the curriculum she had to use. She was actually incredibly versed in comp sci principles and Java.

Our teacher uses College Board AP Comp Sci A course description, but makes his own curriculum. That, and AP teaches java 7 but allows students to use any code from any java version.

That’s odd, because I took AP comp sci, but the test was Java 5… I thought it was A too. Meh, it was fun either way.

Well the test may only use concepts and features from an older Java version, as I’m fairly sure no multiple choice surpassed Java 5 language features, but for solving the free response you could use features from any Java version, as long as you followed their specified directions. I also believe you were not supposed to use methods like Collections.sort().

AP doesn’t have a feature blacklist. You’re just only allowed to use standard java libraries. Collections.sort() was totally allowed. They just don’t write problems that let you use it.

Although, my favorite question was as follows:

“Write a method for finding the number of times a specific character occurs in a given string.”

My answer was as follows:

return string.split(character, -1).length - 1;
3 Likes

Wonderful! I just did a counting for-loop :frowning:

the hack here, is that character is always some lowercase alphabetic character. By that contract, String#split() will never receive an invalid regex. So this method works without error. It’s not always the case though.

And thats wrong? School is supposed to teach you how to think while writing code, not a language itself.

I started in turbo pascal and c, never used those languages ever again but im actually happy i did not start with java/CLI language…

Yes, school should teach you how to code and the concept of OOP.
But i think if they do this with some specific Language, they should not use some outdated versions an practices of that Language.
That’s like teaching the concept of building dynamic Websites and using HTML 4, center-tags, and table-layouting… ^^

1 Like

I was not aware that there wasn’t a feature blacklist for the CB AP CompSci A test ._.