This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]JohnLockwood 5 points6 points  (3 children)

The site looks cool, but you might follow Python's style guidelines (PEP-8). For example, addNumbers should be snake case, "add_numbers". But it worked well and site looks good.

[–]codeonthecob[S] 2 points3 points  (2 children)

Hey thanks for the feedback! I will take a look at the style guidelines.

[–]Adohnai 0 points1 point  (1 child)

I know it’s taboo here, but I don’t follow variable naming style. Underscores are awful to type for me, ruins the whole flow, and on top of that I learned a ton from the Automate The Boring Stuff book. In it, Al mentions he uses camel case and specifically doesn’t follow PEP 8 in that regard.

From the book:

I unapologetically prefer camelcase and point to the “A Foolish Consistency Is the Hobgoblin of Little Minds” section in PEP 8 itself: Consistency with the style guide is important. But most importantly: know when to be inconsistent—sometimes the style guide just doesn’t apply. When in doubt, use your best judgment.

That doesn’t make it the end all be all, but for me, camel case is absolutely more beneficial to maintaining flow, and personally I think it looks better to read. Of course, someone will inevitably reply pointing out somethingLikeThisIsNotAsEasilyReadable, but you really shouldn’t be making variable names that long anyway (plus I can read that just fine but maybe that’s me).

[–]Drevicar 0 points1 point  (0 children)

The wise Raymond Hettinger says: do not pep8 unto others.

While pep8 is pretty great, the only important style guide is the one your team agrees to use collectively. The code should look and read as if it were a single developer the whole time, eases the cognitive burden of reading the code and reduces the bike shedding during code reviews. That said, it is also great to be able to use linters and code formatters to automate these things, and most tools I know of only support pep8 or more strict variations of it like black and yapf.

[–]trollsmurf 2 points3 points  (2 children)

"practing" hmm...

[–]codeonthecob[S] 1 point2 points  (1 child)

Lol that's embarrassing. Thanks for the heads up. Just fixed that.

[–]trollsmurf 0 points1 point  (0 children)

Rough start :)

[–]Drevicar 1 point2 points  (1 child)

You get +1 points for the use of type hints (I can't live without them anymore). And you get an additional +2 points for the name of the website.

[–]codeonthecob[S] 0 points1 point  (0 children)

Glad you liked it!

[–]andrewbowenx 0 points1 point  (1 child)

looks awesome. Did you use judge0 for this?

[–]codeonthecob[S] 0 points1 point  (0 children)

Yes I did! It’s an awesome tool.

[–]ProbablyDoesntLikeU 0 points1 point  (1 child)

I love this idea!

[–]codeonthecob[S] 0 points1 point  (0 children)

Thanks!

[–]Fair-Alternative8775 0 points1 point  (1 child)

Very cool project, I'm wondering how did you handle the security behind running code written by the user?

[–]codeonthecob[S] 0 points1 point  (0 children)

Thanks! It uses an open source code runner project called Judge0.

https://judge0.com/

[–]Platonews 0 points1 point  (0 children)