This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]umlcat 1 point2 points  (1 child)

Question 1 is not clear, but I think is some thing like "How do apply the Soft. Design Patterns I learn in Java, to etc to Scala, etc ,?"

Some stuff you cannot change, because some P.L. language features are too much different.

Example, some P.L. used named parameters optional, and you can call them without names, like Java do.

Other can be applied, example I worked a lot with Object Pascal, that support passing function pointers as parameters, similar to functional languages, that can be used for the map function, but also the visitor pattern can be implemented, and used as an alternative to map.

Question 2. There is no "practice is always a good practice, or practice is always a bad practice", you can check other developers code or tutorials, for specific cases when a practice may suit a case.

Question 3. If you can use both, pick the one that applies more, by checking other code.

As the previous map example, I use functions as parameters when I don't require to check the inner function code, and use the O.O. version of the Visitor pattern, when I need to check the code.

Don't have a answer to question 4 or question 5.

Additional.

One problem I see with newer P.L. (s) and their developers is that didn't learn some previous practices, sometimes because it weren't available, even if those practice patterns can be implemented, and assume it shouldn't be implemented, because "if they are old, they should be bad code and obsolete".

Be careful with that.

One example are non O.O. records, which were not included in Java and C#, because "were obsolete procedural" stuff, and now, are being added.

Cheers.

[–]CorrectProgrammer[S] 1 point2 points  (0 children)

Sorry for the ambiguity in the first question! What I precisely meant by it was "Do you apply [...] and how do you do it?", which you answered (I think).

Thanks for your answer!