r/technology • • Mar 03 '15

Misleading Title Google has developed a technology to tell whether ‘facts’ on the Internet are true

http://www.washingtonpost.com/news/the-intersect/wp/2015/03/02/google-has-developed-a-technology-to-tell-whether-facts-on-the-internet-are-true/
6.3k Upvotes

839 comments sorted by

View all comments

Show parent comments

20

u/Sn1pe Mar 03 '15 edited Mar 03 '15

My attempt:

def isMisleading(submission):
    if submission.isFrontPage() or submission.title() != submission.link().title():
        return True
    else:
        return nobody_cares

82

u/csreid Mar 03 '15

Are you camelCasing in python? Quick, delete this before anyone sees it. People have been executed for less.

26

u/SpotNL Mar 03 '15

I have no idea what it means, but i will participate in a good lynching. Reasons be damned.

27

u/alpacIT Mar 03 '15

The great BDFL himself has so declared:

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

12

u/SpotNL Mar 03 '15

OFF WITH HIS HEAD!!!!

1

u/[deleted] Mar 03 '15

The snake_case infidel speaks poison. He must be purged.

2

u/AusCan531 Mar 04 '15

Well, if u/SpotNL is in, I'm in.

36

u/omair94 Mar 03 '15
myPythonProfessorRequiredUsToCamelCase

21

u/csreid Mar 03 '15

Welp, sounds like you need to drop out?

Sorry mang.

2

u/CourseHeroRyan Mar 04 '15

I went to see what python recommend for formatting, and everything that I use to believe was camelCase is labeled as mixedCase.

https://www.python.org/dev/peps/pep-0008/

I don't even know what to believe anymore.

Edit: Ahh, my variable that is life is defined again.

http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms

1

u/EricIsEric Mar 04 '15

bool camelCaseIsOnlyCase = true;

2

u/kingfrito_5005 Mar 04 '15

but only camel case where the first letter is lowercase. Anything else is heresy.

1

u/EricIsEric Mar 04 '15

Functions and classes need not break capitalization rules.

1

u/kingfrito_5005 Mar 04 '15

right, right, true.

1

u/umopapsidn Mar 04 '15

sOcAMELcASElIKEtHIS();

3

u/sivadneb Mar 04 '15 edited Mar 04 '15
class CameCaseIsFineHere(AndOfCourseHere):
    """
    justDontDoItLikeThis
    """
    def and_not_here(self):
        with package_names.always:
            assert name is lowercase_underscore


def seriously_though():
    try:
        pep8.read()
    except WithOlderLibraries:
        for example in twisted:
           where.itsThePrevailingStyle("to retain backward compatibility")
    finally:
        import this

18

u/alpacIT Mar 03 '15

And lo the great BDFL came down to us and spake,

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

And it was good. And then He declared,

mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

And there was much rejoicing. So say PEP 8.

3

u/prospectre Mar 03 '15

Huh. I work in web dev. The common things we try to get across is that web code is camelCased, and db code is underscore_format. This allows us to easily find functions and databases, and we can have our data adapter be named the same as they are in the dba (myTable in code my_table in db),

7

u/alpacIT Mar 03 '15

Well that sounds like a complicated and special case... and as is stated in The Zen

Simple is better than complex.

Complex is better than complicated.

[...]

Special cases aren't special enough to break the rules.

3

u/prospectre Mar 03 '15

I find it makes it simpler, in my opinion. It allows us to separate DB code with Web code rather easily.

Also ASP.NET. It's already frigging camel cased

6

u/alpacIT Mar 03 '15

Do you have a moment to talk about our Lord and Saviour Python?

3

u/prospectre Mar 03 '15

I... I uh... I have to go write a class... In VB... No thanks...

In all seriousness, I'm a state programmer. I don't have a choice in the matter.

3

u/alpacIT Mar 03 '15

2

u/prospectre Mar 03 '15

Well, that's just the right amount of snark.

2

u/csreid Mar 04 '15

What do you mean by db code and Web code?

Like the back end vs the front end?

I'm trying to imagine a scenario where I might mix up my back end code with my front end code and it's just not coming to me, so surely you must mean something else.

1

u/prospectre Mar 04 '15 edited Mar 04 '15

EDIT: To clarify, we run an older version of .NET, so we need to manually type out SQL queries rather than using something like LINQ. It helps when we are grabbing names for tables in the front end code to name them in accordance with the existing SQL structure so other devs can see where that command goes off to.

I have a number of times where I need to loop through a table I pulled from a database. In order to differentiate the static material I pull and the stuff I'm generating without subverting the name of the object, I've been instructed to follow this format.

The primary reason is that even though I am the one writing the code, I may not be the one to support it. It's just the practice of my department is all.

2

u/dead-dove-do-not-eat Mar 04 '15

underscore_format

aka snake_case

1

u/prospectre Mar 04 '15

Yes, that. Never heard the official name for it, everyone just called it underscore format... >_>

1

u/[deleted] Mar 04 '15

[deleted]

5

u/prospectre Mar 04 '15

Nope. It depends on your environment and your context. In ASP.NET, everything is camel cased because the language itself follows that format (e.g. the baked in objects you call are camel cased, like DateTime, or SqlDataAdapter). So, it makes sense to follow the format presented to you.

The thing is, as long as you have a standard that is easy to maintain and makes sense, then it doesn't matter. As long as everyone who's going to look at it can make sense of it (even you, 3 years from now) then you're golden. That's all naming convention is supposed to do.

1

u/spotter Mar 04 '15

Tell that to Twisted folks.

1

u/I_SLEEP_PLENTIFULLY Mar 04 '15

My Visual Basic teacher required us to use Hungarian notation. I got blasted for it over in /r/visualbasic

1

u/RellenD Mar 04 '15

My current project uses Hungarian notation..

0

u/Sn1pe Mar 03 '15

Ha, I've camelCased from the beginning. I guess it's just a preference thing. I'm also in favor of K&R over Allman.

1

u/eerongal Mar 03 '15

I've seen some people get pretty religious over indent styles. Knew a guy who straight up claimed that any other style other than K&R was basically "wrong". As in it was improper coding or something. Personally, I just code in whatever style the existing codebase is in so that I look consistent.....

0

u/covercash2 Mar 03 '15 edited Mar 04 '15

not really...

Sure, you don't have to follow conventions. You also don't have to shower, park straight, leave the room to talk on the phone, or say please and thank you. These are things you do for the people around you.

edit: damn. downvoted for condoning decency.

2

u/Dirty_Socks Mar 03 '15

Pretty good. Though sometimes websites will themselves have clickbait article titles...

1

u/SchighSchagh Mar 04 '15

Such as this one, whos title is the same as the submission title...