Ever wanted to provide your arguments to a function as a comment?
https://gist.github.com/RikudouSage/18defbf1746322a289ae78b2980d0115
Ever wanted to provide your arguments to a function as a comment?
https://gist.github.com/RikudouSage/18defbf1746322a289ae78b2980d0115
12 Comments
BatmanAoD@programming.dev · 30 pts · 1y
How marvelously creative. What an abomination.
shnizmuffin@lemmy.inbutts.lol · 21 pts · 1y
No, my eyes! Forever unclean!
HowManyNimons@lemmy.world · 17 pts · 1y
Do you really want an answer for that?
dan@upvote.au · 16 pts · 1y
What a terrible day to have eyes
TomasEkeli@programming.dev · 12 pts · 1y
no. never wanted that.
zygo_histo_morpheus@programming.dev · 8 pts · 1y
This reminds me of a trick to get multiline strings in javascript before they where formally introduced. If you coerce a function in to a string you get the source code for that function, comments and all. This meant that you could write a function with multiline comments and then pick out the middle part. Haven't tested it so it's probably sligthly wrong but it was something like:
python@programming.dev · 4 pts · 1y
huh, that does look kinda clean though
chrastecky@phpc.social · 5 pts · 1y
@python I mean, it's already an abomination, I can at least write a clean code.
michael@mstdn.thms.uk · 4 pts · 1y
@chrastecky @php
Thcdenton@lemmy.world · 2 pts · 1y
CubbyTustard@reddthat.com · 2 pts · 1y
xChaos@f.cz · 1 pts · 1y
@chrastecky @php eh, cože? proč?
chrastecky@phpc.social · 1 pts · 1y
@xChaos @php Někde jsem to viděl, že to někdo dělal pro Python a pobavilo mě to.