Julian West

Ranch Hand
+ Follow
since Jul 31, 2016
Julian likes ...
Chrome Java Windows
Cows and Likes
Cows
Total received
3
In last 30 days
0
Total given
0
Likes
Total received
19
Received in last 30 days
0
Total given
49
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julian West

Today, my Netcraft extension is flagging this site as vulnerable to Hearbleed. (Certificate is changed but doesn't have a new public key)

cf. http://toolbar.netcraft.com/help/faq/index.html#heartbleed
4 years ago
This issue isn't limited to this book; it's Wiley's whole setup.

In deciding whether to spend the extra $100 for the online component to her college book, my wife looked at reviews and asked around about it and decided against it because of usability issues like these.
Click the link in the first post.

(I already had a voucher paid corporately...just fell into the T-shirt thing)
The second video in this free course addresses your situation:

https://www.udemy.com/java-design-patterns-tutorial/learn/v4/content

(I just watched it and remembered this thread)
I pretty much agree with everyone on the OOP thing.  That was never my point.

What I take IllegalArgumentException with is unconstructively criticising someone's code because of their instructor's approach and without helping them to learn to code at all, let alone properly.

Frequently I see a direct question on a for loop or some specific basic thing and the question may or may not eventually get answered amidst the noise about procedural programming crimes against humanity.

Newbie asks how to properly use capital letters and they get dissed for split infinitives.  (see what I did there)
5 years ago

Campbell Ritchie wrote:

Julian West wrote:. . . ...and nobody is taught composition in grammar school; we are taught grammar first. . . .

That only applies to “dead” languages like ancient Latin and ancient Greek. Which is why the translations all sounded so wooden. I had the good fortune to be the first year to be taught French from audiotapes and film strips (now that takes you back) and not to try learning French from a book.

We experience the difficulty people have in making the leap from procedural programming to objects, and see that so many people never make it. Those of us who had the good fortune to be taught by somebody who understands OO appreciate the difference.



Chastening the teacher whilst ignoring the pupil helps the student make that leap how?  It doesn't.

I didn't say anything about foreign/second languages; I said "grammar school".  

My analogy was to correlate a specific point; trying to "refute" the analogy doesn't prove anything: nobody learns how to compose theses before learning parts of speech and sentence structure.

Priorities: take care of the immediate need (Help with solving the current assignment) first, then get into the latent needs (OOP, proper approach/instruction, etc.).  
5 years ago

Junilu Lacar wrote:NOTE: This thread was split off from here: https://coderanch.com/t/670933/java/java/Highest-card

Campbell Ritchie wrote:There is something very non‑object‑oriented about your code. Java® is supposed to be an object‑oriented language an so many people appear here who appear to be bein gtaught procedural programming.


Julian West wrote:Campbell: One doesn't start programming learning classes and OOP principals first; one begins with the basics: variables, conditional statements, and flow-control.  "Parts of speech" precedes "composition".


Asking someone to write a program is more like asking them to write an essay though, isn't it? To write a good essay, one needs to include composition. I see objects as being somewhat analogous to paragraphs. They sit on the fence between "parts of speech" and "composition" because they are about both "form and structure" and "organization of ideas".



...and nobody is taught composition in grammar school; we are taught grammar first.

...and trumping someone's attempt to learn Java with philosophical points about approach to it teaches nothing.
5 years ago

Campbell Ritchie wrote:

Julian West wrote:. . . Campbell: One doesn't start programming learning classes and OOP principals first; one begins with the basics: variables, conditional statements, and flow-control.  "Parts of speech" precedes "composition". . . .

That is what lots of people think, but it is not how I was taught Java®. It is really easy to get into a procedural style because procedural programming looks like school algebra. And many people find it very difficult to get out of a procedural style.



Right, wrong, or indifferent, this doesn't help the person asking for it.

Saying, "that's wrong" and offering nothing else helps nobody.
5 years ago
It may be a little hard to help since I don't know what tools are in your toolbox--meaning, what parts of Java they taught you already.

enums would be useful for cards but since they're using a String for that, I'm inferring that they haven't mentioned enums.

Campbell: One doesn't start programming learning classes and OOP principals first; one begins with the basics: variables, conditional statements, and flow-control.  "Parts of speech" precedes "composition".


Mimi: I'm not sure what your question is; does your program work?

To address the repetition, did they cover "for loops"?  You could loop through that string rather than dealing with each pair individually.
5 years ago
The link in step 3 says, "This voucher is valid only through December 31, 2016."

I got my T-shirt in the mail today (OCA), took a couple of weeks.

Anticipatory answer to that: "Offer is limited to one recognition t-shirt per Java certification earned."

So, 31 Dec is my OCP deadline...should be enough time to earn another T-shirt.

Campbell Ritchie wrote:

Julian West wrote: . . .
...and IDEs know this and warn "Accessing static method OfWeeks"

It is not that it “knows” anything specific about Period, but that dangerous confusion can arise from calling static methods on instance names.


I didn't say that specifically.  I only quoted the book that said that you cannot chain Period because you cannot chain static methods and Period is static.

I pointed out that IDEs know this (chaining static methods and that Period is static) and provide a specific warning about the wayward static method (this is exactly what NetBeans does, anyway).  The book makes no mention of IDEs and doesn't take a position on it.  It does, however, say that you can compile this but it won't work.  When you add it all up, the IDE gives a context-sensitive warning about it.  I'm not seeing any confusion, danger, or imprecision here.
5 years ago

Gheyath Nasani wrote:

Julian West wrote:

Campbell Ritchie wrote:
The quote from the Sybex book explains that if you chain method calls with Period, you get the wrong result.


...and IDEs know this and warn "Accessing static method OfWeeks"



I am well aware that IDE know this and warn "Accessing static method OfWeeks". But my question about "What is problematic when accessing static method ofWeeks ??  



The Sybex book explains why.  What is still unanswered?
5 years ago

Campbell Ritchie wrote:
The quote from the Sybex book explains that if you chain method calls with Period, you get the wrong result.


...and IDEs know this and warn "Accessing static method OfWeeks"

5 years ago
This reminded me of:

Vroomfondel wrote:“We demand rigidly defined areas of doubt and uncertainty!”




I've had all those issues Junilu described just with myself as the architect and programmer.  You start with a plan and inevitably have new questions and discover new capabilities as you implement and refine (or even scrap and replace) the plan.

And, yes, taking pictures of whiteboards is a thing, as is, "DO NOT ERASE!"


Fundamentally, you may be trying to fit a traditional project management peg into an agile project's hole.
...or using "static" everywhere in your OOP...
Alright!  I didn't dump everything after taking the OCA: I remembered this:

Sybex OCA8, pp.146-147 wrote:There are fve ways to create a Period class:
Period annually = Period.ofYears(1); // every 1 year
Period quarterly = Period.ofMonths(3); // every 3 monthsWorking with Dates and Times 147
Period everyThreeWeeks = Period.ofWeeks(3); // every 3 weeks
Period everyOtherDay = Period.ofDays(2); // every 2 days
Period everyYearAndAWeek = Period.of(1, 0, 7); // every year and 7 days

There’s one catch. You cannot chain methods when creating a Period. The following
code looks like it is equivalent to the everyYearAndAWeek example, but it’s not. Only the
last method is used because the Period.ofXXX methods are static methods.

Period wrong = Period.ofYears(1).ofWeeks(1); // every week
This tricky code is really like writing the following:

Period wrong = Period.ofYears(1);
wrong = Period.ofWeeks(7);

5 years ago