Skip to main content

astropy@GSoC Blog Post #4, Week 4 - Lessons in CodeStyle

Damn yaar! 
I didn't know this. Astropy can be a dangerous place. There are codestyle ninjas present. Hidden in plain sight. It's not just the PEP8 speaks from GitHub actions. There are real people in it too. And worse of all they don't allow merging the Pull Request (PR) until we do what they say. All in the name of adhering to modern standards that improve readability. What has open source come to! Really?

This and the past week, below listed is what the codestyle ninjas have made me do to my otherwise perfectly working code: (copied without permission from GitHub)
  • TABLE should not be used as a variable name
  • No camelCase anywhere. For example, tableDescription should be table_description.
  • Module level variables as SCREAMING_SNAKE_CASE. E.g. BYTE_BY_BYTE_TEMPLATE not ByteByByteTemplate.
  • Regular variables, functions, methods are lower_case_underscore_separated, never camelCase or CapsCase.
  • Private methods start with one underscore not two, e.g. def _split_float_format instead of def __splitFloatFormat.
  • No inline blocks like, if sign: col.meta.size += 1
  • Avoid one-line variable names, but especially l that looks like 1.
  • List values alignment, dictionary values alignment, function definition line alignment, alignment this and alignment that and so on...
  • And no white-spaces please, trailing or whatever!
Yeah! For some weird reason, the codestyle ninjas at Astropy seem to hate Camels and are extravagantly fond of Snakes! Dunno why? I for one reallyLikeCamelsAndTheirCase. Ha! Ha!


Disclaimer: The above post is in jest and should not be taken seriously. Sometimes Snakes are better than Camels. AND SCREAMING SNAKES ARE MORE BETTER. All hail PEP8!

Comments

Popular posts from this blog

An Algorithm to find who to invite to your Event!

The criterion for including people for an all-paid Dinner Party, for instance, should at the very minimum be the people whom I can call and I am sure who will pick up the phone. This then by definition includes almost all, nah, all of my male friends and excludes most of the, if not all, ex-girls I have dated before. Then there is the proximity of location constraint. Plus, inclusion of anyone who invited me to their past celebrations and I know who maybe able to join for this one. Or somebody with whom I was close either in proximity of location or friendship or both or with whom I spent a lot of time together. Now, on top of these, in order to reduce the list to the most closest of the close current friends, I can impose the following additional requirements: 1) Should have met them atleast once this year or in the past 6 months, whichever is longest. 2) We should have had atleast one 1-1 meeting, preferably outing for >1 hour, either for lunch, coffee or dinner or something else....

On making friends and How to keep them!

From a studious introvert during my school days to having dated over 50 girls in the past two years in Tokyo, I sure have come a long way in making myself more engaged socially. (If you are curious about the dating scene, have a look at that post here!) The progress hasn’t just been towards a higher affinity from the fairer sex, but has been much more wholesome and awarding. So, what did change or perhaps, I was the same likable even in school, just not in the right environment? Here are my key insights into what essential in keeping your friends long-term and how to make them in the first place. Also included is some general advice on how to meet new and interesting people wherever you go. - Keep your Promises: If you make a promise to someone, try your very best to keep it. If you are unsure, then say so outright, instead of agreeing to something just to save face and then not committing to what you say. This builds trust and gives weight and credibility to things you say.  - Bor...

Three demises and room for no more

In the past few months, three personalities I had grown looking up to over the year, have started their journey towards the heavenly abode, the latest departure happening just the last week. All the three occasions of the news had felt out of the blue. It is not that I had been exceedingly close to any of them, nonetheless, brief touches of their presence in my life had made in such sublime manner that it would hardly be possible otherwise now. It is especially the distant figures such as these that we are prone to assume a constant in our lives. We meet and come across a plethora of people in our life times, yet it is often the transient moments that leave a lasting impression, amplified more so when the impermanence of it all suddenly decides to make itself known. I am grateful that, in varying degree of acquaintance, I had the opportunity to know Mr. Emmanuel Robin, Dr. N Rathnasree and Prof. T Padmanabhan. These succinct lines here are an amateur effort to pay some tribute to them....