That misses the point of the exercise, though. Almost all languages have some kind of toLower method built-in. The exercise is to see if we can write our own code to do the same thing that the built-in methods do, to help us understand the process behind-the-scenes.
I mean, Javascript and Java have s.toLowerCase() and Python has s.lower(), all of which directly provide the solution.
Also, for C++, you can omit the explicit lambda from your example and just directly apply the standard function:
Indeed, now that you've pointed it out, with the purpose of understanding how tolower functions of programming languages works, your solutions are clearly more appropriate ! 👍
Nice point on the C++ example ! I always forget that we can pass functions like that, without the explicit lambda! 😄 👌
Maybe, it would have been interesting to mention the tolower of the language you used, directly in your article, for people to learn about them if they didn't.
In my little experience as a software engineer, people tends to re-write that kind of function each time they need it, even if they already exists and are available in their language, only because they don't know about them. I would be very interested to know if you had some similar experiences about that ? 😃
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That misses the point of the exercise, though. Almost all languages have some kind of toLower method built-in. The exercise is to see if we can write our own code to do the same thing that the built-in methods do, to help us understand the process behind-the-scenes.
I mean, Javascript and Java have s.toLowerCase() and Python has s.lower(), all of which directly provide the solution.
Also, for C++, you can omit the explicit lambda from your example and just directly apply the standard function:
And there's also the simple iteration:
Indeed, now that you've pointed it out, with the purpose of understanding how
tolower
functions of programming languages works, your solutions are clearly more appropriate ! 👍Nice point on the C++ example ! I always forget that we can pass functions like that, without the explicit lambda! 😄 👌
Maybe, it would have been interesting to mention the
tolower
of the language you used, directly in your article, for people to learn about them if they didn't.In my little experience as a software engineer, people tends to re-write that kind of function each time they need it, even if they already exists and are available in their language, only because they don't know about them. I would be very interested to know if you had some similar experiences about that ? 😃