Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@isaacWeisberg
Actually on Swift that loop is:
for i in 0..10{
}
Looks better though than the plain old for loop. But I aint gonna marry my code so doesn't matter lol -
Celes6907yCould you please use i++ when you need it? There is no need here, use ++i at least.
Oh and I fucking forgot, you probably don't need i outside the loop, so int i = 0 will reduce the scope. -
That's a bullshit meme. While the number of iterations is the same in both loops, the variable i is not. And you usually need that variable.
-
@dontbeevil I'm so sick of that face I will find who it is and I will hurt him in such a way he won't stop screaming till he dies.
-
@dontbeevil it's just while (i-- > 0)
counts from n backwards and exits when i reaches 0 -
@dannydam So close to Swift, but ya Kotlin is amazing especially as a replacement to Java on Android ...
-
@dannydam I'm tempted to stop learning java and learn kotlin instead for android programming. Do you think it would be better to learn java and then kotlin? I'd like to skip java if possible but I do understand that it is a useful tool, especially for employment.
-
dannydam3217y@DVZ96 You should continue with Java first and only move to Kotlin when you feel like you understand Java well enough. Java is still the dominant language in Android development, that means that most tutorials use Java and most developers as well. What I'm saying is, Kotlin is great and I recommend learning and using it, but before you do you should have the ability to comfortably switch to Java if necessary.
-
Celes6907y@badsector c11 and c++ 11 removed the restriction, if I don't say bullshit. Clause 1 can now be a declaration too.
Edit : https://stackoverflow.com/questions...
So it was C99, I always mess up about the versions -
@dannydam Yeah it seems like a good idea to learn java first. I don't like it that much but it sure is useful to learn android programming.
-
@dontbeevil yeah, yeah, I am sorry, I first wrote a comment and only then saw that you've already seen it)
Ways of doing a for loop.
undefined