Junilu Lacar wrote:Big Red Flag: "need language/technology that inherently protects against SQL injection or similar threats"
IMO, that's the wrong thing to be looking for if you'e concerned about security. Application security is not free; it's something you have to carefully consider and deliberately build in to your application from the start and all throughout. All languages/technologies have security issues. Choose your language/technology platform first, then do a risk assessment. If SQL injection is a risk you want to address, then learn how to do that in the language/platform that you choose. Come up with a plan/strategy for developing your application with as much security as you are willing/able to build in and see to it that developers know and follow the plan/strategy. Most of all, test, test, test. Lastly, poor quality code is virtually guaranteed to be insecure code. Well-factored, readable, and maintainable code is easier to secure and verify than poorly written code.
Claude Moore wrote:Ok, but what are your currently skills ? Doesn't the language really matter at all ?
Campbell Ritchie wrote:There is a second loop in line 4 where you are seeking the index of a letter.
Campbell Ritchie wrote:What do you mean by more efficient?
If you mean readable, then your original option loses hands down.
If you mean in terms of memory use, then you are creating multiple String objects and rejecting them.
If you mean in terms of execution speed, then your suggestion runs in quadratic time whereas the other suggestions would run in linear time.
German Gonzalez-Morris wrote:use a Set, as a HashSet in Java.
Anayonkar Shivalkar wrote:There are various factors to keep in mind. However, I would go for multiplying factor of 1.5 to 2.