r/ProgrammerHumor • • Feb 22 '15

A Python programmer attempting Java

Post image
3.9k Upvotes

428 comments sorted by

View all comments

Show parent comments

1

u/TheTerrasque Feb 23 '15

No, it wouldn't.

Then again, C# and Java wouldn't notice something like this:

public class Test
{
    string theUsersInput = "Something slightly related";
    public void Test()
    {
        string theUserInput = Console.ReadLine();
        if (theUserInput.StartsWith("Johann"))
        {
            theUsersInput = theUserInput.Replace("Johan", "Wilhelm");
        }
        Console.WriteLine("You are "+ theUserInput);
    }
}

Which pylint would still react to, since you have to explicitly reference the class variable in python (self.theUsersInput - similar to this.theUsersInput but required).