Help coderanch get a
new server
by contributing to the fundraiser

Anand Athinarayanan

Ranch Hand
+ Follow
since May 20, 2011
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anand Athinarayanan


I was listed as one of the winners of the book Promotion " Developer Career Masterplan: Build your path to senior level and beyond with practical insights from industry experts" held in the month of September. I emailed my details to and also received acknowledgement. But I never heard back from the publisher or anyone after that.

Any assistance is appreciated. Thanks !
7 months ago
Thank you. I hope to gain from this book as well. Appreciate taking time to respond to the question.
10 months ago
I'm pleased to say that I purchased the Developer Skills mastery course couple of years ago and enjoyed it. Though I couldn't follow all of the advice, I became a better developer over the years. I also read the "Best Developer Job Ever" book by the author Bruno Souza. When I look at the table of contents of the new book, it does seem like a lot of parallels with the course and the other book. Does the new book offer more to what has been shared already in the course? Thanks  
10 months ago

Campbell Ritchie wrote:

vishnu priyag wrote:. . . Character is a class . . .

It already exists in the java.lang package, so you should think of a different name for it. Maybe Warrior.
Call your implementations Sword and Shield rather than XXXWeapon.

In runtime, with the help of constructor, we can pass any weapon impl to the Weapon instance variable of the Character class.

Are you deciding the weapon at runtime, or at compile time or before? If you can make a Warrior change between a Sword and a Shield at runtime, that would be something different. This Wikipedia page says the Strategy Pattern should permit changes of the algorithm at runtime. You have a plain simple field there, and I don't see any code to change it.

Hello, Sorry to bump up an old thread but this was featured on the code ranch journal and was an interesting read. So when you say deciding the weapon what do you mean by "before" ? I have only heard of Run vs Compile time. Thanks !
Understood. Makes sense to make it easy to test. Thank you for your help. Much appreciated.
Thank you so much. These are very helpful. The separate JARs are something new to me. so would the build scripts have to be tweaked to have the correct jars on the classpath ?
My co-worker and I have been having some conversations about an implementation and could use some help.
I have a class called RulesEvaluator which has some business logic. This class needs some reference data which is available in another class called ReferenceDataHelp. (The ReferenceDataHelp gets the data from a database if it matters).

So now I have the caller code which instantiates the RulesEvaluator and calls a method called runRules on it. All good so far ! Now my question is how should ReferenceDataHelp class be thought of ? I'm thinking it as an implementation detail that only the RulesEvaluator class needs to know and hence the object of ReferenceDataHelp should be instantiated from within the class or the method.
However my co-worker thinks, the ReferenceDataHelp should be instantiated by the caller code and dependency injected into RulesEvaluator to allow for unit testing.
I'm learning Spring Boot and ReactJS and thought of building a simple web application to practice. The idea is to allow users to add Coupon Information and then get alerted (not decided how, but Email is a thought) when the coupon nears it's "To be Used by Date". This is just a hobby app for me to learn both the technologies. Most of the websites I have checked have the React App served from a NodeJS server and then for the backend it interacts with Spring Boot mostly through an API. The one tutorial I had with just Spring Boot and React (using Thymeleaf) here seems overly complicated as it references something called web-pack which I have no idea about.

So my question is how common is to have a NodeJS with React and a Spring Boot and is this even a good architecture for web applications? If not then is the architecture in the tutorial (link above) more common?
I have only worked with one front end and one back end server/service so far in my career.
Yes I think ZG was right. In my mind I think of this like a utility type of method which can stand alone and can operate on the given input. I also think this is like some of the Apache IO Utils library most of which are static.
Would love to hear your opinion.
3 years ago

Zachary Griggs wrote:Lots of good solutions here!

Personally I made the method static because if I had to use this in my project, I would create some sort of StringHelper or StringUtility class that does not get instantiated. The method itself doesn't need any sort of state to operate correctly. Though this is very much open for debate; I don't think there's a "correct" answer here so I'd be interested in hearing other perspectives.

I believe you could also do a toSet() call, rather than the .distinct().toList(). Though that works completely fine as well.

I found this thread from the code ranch October journal and I came here to respond the exact same thing. I saw some one ask the OP an opinion on why Zachary Griggs made the method static.
3 years ago
This is great Ken. Definitely much more robust and testable. I will give it a spin and get in touch if anything is not working. I'm beginning to like Python already
3 years ago
I appreciate the offer Ken. So here is what I have so far. Won't be able to post the actual code but it's close to it. I'm using python 3.7.1

Initial tests show it is working fine but just seems very slow. I think it might be because the orderDetailsData file is on a network storage and I need to access it each time which Unfortunately I cannot copy to my machine because of "restrictions" . But what do you think and is there a better or Python way of doing it.

Have to say this, coming from a Java background I find the python libraries very useful but at the same time I couldn't think in Python yet. Keep going back to OO and SOLID principles.
3 years ago
Thanks Ken. I might have misquoted my problem. It is not a specific pattern. It's a list of unique text running into one thousand atleast . The text is a combination of alphabet and numbers example would be - XY18736272. This is the source file.
And then I have few hundred files, each file running into thousand or more lines. In some of these lines the text XY18736272 would be embedded. If I find it I need to extract the full line containing it and write to another file.
One advantage is the hundred odd files are comma separated files so I know exactly which position to look for.
At this time I have been able to just start with file reading part.
I will look at your examples also. I see there is a free preview of your book in the site. Thanks
3 years ago
Thank you for your responses. I have always wanted to learn a different language other than Java but never just got around to do it. Python seems different but interesting. At my work recently I had to read a bunch of files and look for specific patterns from a different file and extract the entire line matching the pattern . I'm thinking of trying it out in Python. I was able to get my request for the software approved. This is not part of my project work but just a side work that we normally use excel for. Let's see how this goes.
I'm a bit on the slower side of learning but persistent learner.
3 years ago
I'm a Java/Gosu developer mostly working in enterprise wide web application. Recently I have seen more traction in the world of python and a lot of it revolves around machine learning. I have no background in Data science . I don't even have a CS degree from college for the matter. So I'm wondering is python a good language to learn for improving job prospects and career for someone with a Java web background and not wanting to move to data science world now.

3 years ago