Giter Site home page Giter Site logo

neemspees / tragic-methods Goto Github PK

View Code? Open in Web Editor NEW
625.0 11.0 24.0 264 KB

A collection of script depicting the strange quirks of programming languages.

PHP 18.98% JavaScript 26.83% Go 10.64% Python 21.75% C 2.84% Java 12.55% TypeScript 3.69% C++ 2.73%
quirks strange

tragic-methods's People

Contributors

adieyal avatar aleksamcode avatar amodex avatar chofnar avatar emmaexe avatar erik4github avatar kellenmace avatar kennylibaro avatar kevinrousseau avatar leviaviv28 avatar liorsl avatar lordubuntu avatar neemspees avatar neilfraser avatar philosoft avatar rec avatar rosiersrobin avatar specificprotagonist avatar struffel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tragic-methods's Issues

"Fixes"

Would it be all-right to also add brief comments on workaround to language quirks for the curious in the directories of problems. For instance, this python quirk can be worked around by changing the function from a default like:

class Demo:
	"""A class representing a demo object with an ID"""
	def __init__(self,id = generate_id(6)):
		"""Instantiate the demo object with the ID from the 'id' parameter."""
		self.id = id

to instead take a function as an argument:

class Demo:
	"""A class representing a demo object with an ID"""
	def __init__(self, id_func = generate_id, id_arg = 6):
		"""Instantiate the demo object with the ID from the 'id' parameter."""
		self.id = id_func(id_arg)

Maybe require a proper readme.md for every submission

I think it would be a good idea to require a readme.md for every subfolder. That makes it easier to find interesting examples without needing to dive into the full code to learn what it's about from the comments.

GitHub renders readme.md files on its website for every folder, not just the root folder, so that would be an easy way to make the examples more accessible.

Poor readability on Python example

funcs = [lambda: i for i in range(10)]

The line with the code that "does not work as intended" in the example is:

funcs = [lambda: i for i in range(10)]

IMHO it is hard to get what is intended there, even for someone with a lot
of Python experience (at which point they will immediately figure out
the problem, due to have falling for this a couple of times already :-) )

Just adding a pair parentheses fore readability there might make things better:

funcs = [(lambda: i) for i in range(10)]

Reduce nesting

According to the contribution guidelines, each script should be placed in a separate sub-folder. This means the folder will be empty except for a single file, defeating the purpose of folders. Can we get rid of this layer of nesting and place the scripts directly in the language folder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.