So my gf is a linguist coder

So my gf is a linguist coder.
She coded this
Fucking rate it
pastebin.com/6ghHYJJz

Attached: opengraph-icon-200x200.png (200x200, 8K)

Other urls found in this thread:

wiki.c2.com/?OnceAndOnlyOnce
docs.python.org/3/faq/design.html#why-isn-t-there-a-switch-or-case-statement-in-python
github.com/SteamDatabase/SalienCheat/pull/243
twitter.com/NSFWRedditGif

>("C:\\Users\\mello\\Desktop\\testing\\Annotations\\type-

Forgot to remove username from line 46.

nah, that shit is okay
there were two different users, this one didnt compromise her

bump

Holy shit. This is garbage from a programming perspective. I don't about linguistics to analyze that aspect.

"coder"
"coded"

The fuck is a linguist coder
its shit though

doesn't know much about python that would make the code less verbose by an order of magnitude. But literally nobody cares.

nice

>tfw no coder gf :(

Attached: 1528826461398.jpg (997x1413, 979K)

1.4/10

would toss resume into the trash

She sounds nice, user.

Why is it garbage?

Yeah, she’s 34 and started learning coding when she was 30.

Also why

And she’s a computational linguist
She works in natural language processing and data analysis related to it

wiki.c2.com/?OnceAndOnlyOnce

At least she knows it’s very inelegant but as she says at least it works

Sure, it's an eyesore, but if it is going only be used once and tossed, who cares?

Attached: 1384648822209.jpg (572x507, 172K)

it must be nice to have a career that runs on fairy farts

5/10. Clearly this person isn't a strong coder in any language but it's a good attempt.

There are a few ways to assign variables. You can use a K-V lookup and a loop to avoid the elif blocks. globals()['x'] = 300 is the equivalent of x = 300.

My last job was doing NLP

That is some shit-tier code, jesus fucking christ does she not understand what a function is?

Holy fucking shit so many nested loops, so many fucking if statements, fuck it's bad.

I mean seriously, this looks like the code of someone who started learning programming 2 months ago, not 4 years ago.

count the number of things you have to change if, for instance, she gets another supervisor (L109 onward - I count at least 5 places)

pajeet will unironically improve that code if she opens bob

-Uses elif chain instead of a switch/case format.
-"ZZ" is not assigned as a constant.
-#print("YES")
-uses the fucking strings "true" and "false" instead of the boolean true and false

I didn't even follow the logic of the code and there's alot of big no-no's that make the code harder to read and understand. To add to this everything is one big if-else chain and nothing is seperated as separate functions. Very hard to read, alot of redundancy, and many poor practices.

python doesn't have switch.

What?

Also good critique guys, I’ll send her the screens and check her reaction

no you retard don't do it, be gentle with her and help her learn computer more better. if you show her Jow Forums's reaction you'll just beat her down again

If only someone could bump this in some 6-10 hours or so
I need sleep now and we already told each other goodnight

Based

It's garbage if she's been programming for years.
If she just learned then she should do research about software architecture because it's very poor.

Either way needs improvements:

* Don't us magic strings everywhere
* Stop hardcoding paths (it can be ok if its just a personal script but still not a best practice)
* Split your code into separate classes / functions, learn oop software design if you're going to use python
* Don't print to stdout directly from a function, return an object / tuple that you log later
* Explain things with function names, not long ass comments unless it's absolutely necessary
* unittest this shit its complicated


There is plenty more wrong but this is everything I see with 1pass.

>there is a 50% chance that this post is not a troll

Kinda sad what happened to Jow Forums, desu.

Attached: 1526815179980.jpg (750x680, 95K)

LMAO

oh shit hes serious, damn python really is a kid toy language.

You just use a dictionary you tard.

a switch does it better, and works exactly how the computer wants to work.

>linguist coder
lmfao, i probably fucked her at NAACL a couple weeks ago

describe her.

Prepare to laugh even more:
docs.python.org/3/faq/design.html#why-isn-t-there-a-switch-or-case-statement-in-python

Also note Guido von Python tried to remove fucking lambdas from the language.

jews ;-)

It reads like the author never actually cared about programming beyond getting some simple shit done. It might work, but it's unmaintainable and inextensible. Too much magic going on.

Also I'd be surprised if you can do meaningful NLP with just 'os' and 're'

Python is a toy language for students and sysadmins

OP is a fag

cuz the bitch keeps redefining the same shit.

op is mad that i fucked his big-nosed, short-haired gf at a linguistics conference a few weeks ago lmfao

Seems it's a bunch of if conditions staked together. She could probably do something much better than rule-based by using some supervised machine learning. She'd have to label a good number of instances by hand, quite tedious though.

Refer her to Jurafsky for a reference on NLP

she didn't "code" anything in python. it's impossible.
however, she's mediocre at SCRIPTING.

op not responding because he's on the phone with his gf accusing her of infidelity while she fervently denies

op doesn't realize how incredibly small the compling community is

op doesn't realize that i recognized the author of this code within 10 lines

op slowly realizing that i never fucked his gf and that i'm just fucking with him

op learned a valuable lesson about posting other people's code on Jow Forums

say hi to B. from Chris lmfao

this thread is getting good

Attached: img_6087[1].jpg (540x568, 65K)

>op slowly realizing that i never fucked his gf and that i'm just fucking with him
why wouldn't you wait until he replies baka

i'm not a monster, i don't want to destroy their relationship. hopefully i've given it all away quickly enough that he can salvage his accusations lmfao

how do you even know that he read it in the first place is my point.
You 'compling' people aren't very smart are you

huh well if you're uhh worried about whether or not op has read the message at the point in time when op is reading the message then well huh i dunno what to tell you, you fucking retard.

This is what happens when people learn how to write code without learning how to program.

go write an interupt routine

you know what the difference between me and you is you fucking bioluminescent african american, real men like me write our own fucking compilers, our own fucking lexers, our own fucking stemmers

i bet you're such a fucking mentally challenged african american that you use the penn treebank and stanford parser like some kind of idiotic little peon and cry yourself to sleep while the real men like me are writing fucking unsupervised methods to generate grammars for natural fucking language while the little tiny brain cia african like you struggles to tokenize a fucking well-defined programming language to write a shitty little african compiler

Not that I doubt you user, but is there a way you could prove any of this without compromising your identity or OP's.

I could post the resulting paper, but that just compromises her identity, and she doesn't deserve that.

>it's impossible to "code" in python
>according to anonymous #66577342 on a consumer electronics board
I have seen the light.

>34 yr old gf
I seriously hope you guys don't do this

Should have used a lookup table instead of a billion if/else. The file path stuff is really nasty, at least put some of it in a variable or create a function to "build" the paths.

just post it, without her name

The script itself doesn't do any NLP.

doesnt follow pep8 conventions. Python does not use camel case. All function and variables should be lower followed with an underscore if its more than 1 word. Did not look at the rest of the code, I have no idea what it does.
But make sure you follow pep8

Attached: 1464809980420.png (825x473, 275K)

>Docstrings
Props for this, I never bother with these

>follow pep8
Sheep

Pep8 can suck my dick

Attached: linus-eff-you-640x363.png (640x359, 213K)

It's Python so if it works then it's good enough. Any design or style faux pas don't matter unless she has to change the code later or if someone else needs to change it later.

I dont like pep8 either. I prefer camel case, but im not a retard. I follow the standard for whatever language I use.

Attached: 1510351060237.jpg (957x621, 90K)

>#print("YES")
Not a problem
>switch case
Yeah you're obviously not qualified to discuss anyone's code.
There's in essence replacements for switch cases in python. I don't see them being much better here.
>boolean strings
Yeah that's kinda bad.
>separate into functions they shouldn't be more than 2 characters each.
The code is actually neatly organized into functions. It expresses a sequential step of operations. It should follow sequentially. Breaking up into functions gives the illusion of understanding because you get to assume implementation of the functions. And introduces risk of breaking calls due to improper state at call sites.
Carmack has this right.

this right here means something...I think there is more than just programming going on.
Also OP if your "girlfriend" refers to programming as "coding" I have bad news for you.

>standard for LANGUAGE
Yeah maybe someone who's only used python might see it this way.
Meanwhile code style guidelines (enforced or not) is group dependent as tools like clang-format neatly expresses.
OP does. Dummy.

I pick different typing conventions every time I start a new project for my client (on the same codebase)

I'm currently on _variableName Function_name

Attached: devilish.gif (425x481, 1.51M)

thanks for being extra retarded user.

python/10

Attached: absolutely disgusting joffrey.jpg (300x260, 29K)

Of course if you have guidelines you should follow whatever your team decides. But the default should be the standard of the language, not whatever you choose.

better than me :(

>hard-coded path

off to a great start

whats the approach around hardcoding a path?
Is it to ask for input to declare the path? Serious question, I want to learn

Attached: 1518399582101.png (514x438, 20K)

>What?
what are you confused by? Clearly your gf is gainfully employed with utterly unimpressive non-skills.

launch parameter, ask for input, read a config file. use your imagination dood

'hard/parts/%s/of/%s/your_path/' % (variable_part1, variable_part2)

>I don't see them being much better here.
This must be done with a map/dictionary. It will be multiple times shorter and easier to read.
# Assign column letters for each survivor
pinchasLetter = "ZZ"
samLetter = "ZZ"
fritzieLetter = "ZZ"
aaronLetter = "ZZ"
izzyLetter = "ZZ"
adinaLetter = "ZZ"
janineLetter = "ZZ"
matusLetter = "ZZ"
evaKLetter = "ZZ"
evaSLetter = "ZZ"
anitaLetter = "ZZ"
reneeLetter = "ZZ"

for col in thisSheet.iter_cols(min_row = 1, max_col = thisSheet.max_column, max_row = 1):
for cell in col:
if cell.value:
cellValueLow = (cell.value).lower()
cellValueStripped = cellValueLow.strip()
if cellValueStripped == "pinchas":
pinchasLetter = cell.column
elif cellValueStripped == "sam":
samLetter = cell.column
elif cellValueStripped == "fritzie":
fritzieLetter = cell.column
elif cellValueStripped == "aaron":
aaronLetter = cell.column
elif cellValueStripped == "izzy":
izzyLetter = cell.column
elif cellValueStripped == "adina":
adinaLetter = cell.column
elif cellValueStripped == "janine":
janineLetter = cell.column
elif cellValueStripped == "matus":
matusLetter = cell.column
elif cellValueStripped == "eva k":
evaKLetter = cell.column
elif cellValueStripped == "eva s":
evaSLetter = cell.column
elif cellValueStripped == "anita":
anitaLetter = cell.column
elif cellValueStripped == "renee":
reneeLetter = cell.column

print("Pinchas: "+pinchasLetter)

Nothing wrong with hard coding paths for a run-once script. No benefit from putting it in a config.

The team usually has an implicit standard or it's implicitly free for all.
Language standard is an organizational suggestion, not a rule or an agreed upon standard even.
You're of course free to use pep8 as your own style if you wish. But to pretend it's a good idea for general populace is just stupid. That's basically you agreeing with people who decided that extreme minutia in style guide without any respect for semantic meaning (as pep8). They're obviously bad at this shit. Googles tools team know their shit and they included a variety of popular style guides in their automated formatting tool. And it's got an interface to actually respect semantic meaning. Even for the preprocessor (and in the context of C). Far harder problem than any python formatting would ever face. And you listen to idiots who wrote the pep.
>retarded
Right. Because if op takes her professional title and makes it into 'linguist coder' that somehow implies anything about her other than that she's with some idiot who can barely complete a sentence.

It's obviously OP sourcing the coder angle.

This part is nigger tier

Attached: WymensProgramming.png (631x1176, 75K)

yikes someone is seriously on the defense here, maybe you are seriously retarded and I offended you. I guess for that I'm sorry

I said much better. Perhaps my standards are high. I didn't say it wasn't better. It is.

Yadere dev found

I would just find the local path where it got executed from and write to same directory, maybe add a param if you want it write somewhere specific.

>defense
No I'm arguing. You responding that being defensive' is wrong in an argument is you practically conceding that you have nothing to say since you were wrong and don't want to admit it.

We don't know what she calls herself and linguist coder isn't a job title.
Sorry, repeating myself for the back of the class, you listening?

>Also OP if your "girlfriend" refers to programming as "coding" I have bad news for you.
Explain?

Of course it is much better. Readability is almost the most important thing for those kinds of programs (does a highly specific task, and run time is no issue). You could get rid of every one of those variables and refer to column names by actual column names in code below.

Autists on the internet, that's who. C'mon, this is Jow Forums, get with the program.

Use whatever the fuck you feel comfortable with
github.com/SteamDatabase/SalienCheat/pull/243

Lambdas are implemented really badly in python so I'm not surprised.

Good feedback can help you improve your code. The problem is not how it looks, it's that it's written in a way that makes it more difficult to maintain. There's no need to maintain this particular file, but killing bad habits is a good thing for a programmer.

Shouldn't you be somewhere in a smartphone general right now?

>standard of the language
If a language has standards for how to name variables, then that language is hot fucking garbage.

>much better
Did you hear what I said about standards? It means that a word like 'much' might mean something very different between us.
I'm not saying readability isn't important I'm just saying that this piece of imperative code is not likely to please me.
Why make a dish good this one time if it's just gonna be digested?
Programming is a craft you hone.

>Shouldn't you be somewhere in a smartphone general right now?
That's an oddly specific insult. Why would I enjoy bourgeois toys?

No one's trying to impress you; we're evaluating which changes would improve overall quality of the code and by how much. A gigantic chunk of code and a bunch of variables can be removed by using a dictionary. It doesn't get any better than that.

That's what I assumed considering you see discussion about code quality to be a domain of autists.

>it doesn't get better than that
In python perhaps.

It's a fucking python snippet of code we are discussing, dumbass.

i'm not going to study the code you posted because this is obviously a bait thread, but why the hell would you not just control the spreadsheet in excel

>That's what I assumed considering you see discussion about code quality to be a domain of autists.
Hit a nerve, more like it. It's a discussion about the code quality of someone for whom programming is just a means to an end. It's well known such people (physicists, mathematicians, staticians, linguists etc) are terrible coders in the sense of best practices. They just want the result.

It has standards for how you whitespace your expressions (x=1+2 is 'wrong' in all context, should be x = 1 + 2).
It has a horrific standard for the tabs vs spaces discussion. Spaces should be preferred unless someone used a tab. So we've now implicitly accepted foreign guidelines. And it actually makes a lot of sense to standardize that in python. But they didn't really do it.
It's method/function/variable naming convention is THE SAME.
It enforces a newline at the end of file (whatever i guess, but seriously weird).
The public vs private for OOP encapsulation is dealt by you agreeing with every other programmer that _name means private.

And the pep isn't written in an objective manner. It praises Guido for some godforsaken reason. When he's the moron who made the language in the first place.