You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Proposal] New Top Language Detection Algorithm #1600
Hi @kitswas thanks for the proposal, quite interesting.
What do you think of the downsides of this approach? Can you mention any examples?
And also how exactly this method is better than just counting bytes? Will be better to have a comparison.
What do you think are the downsides of this approach?
The size of a program (sourcecode) to perform the same task varies when written in different languages. This metric does not take it into consideration.
The alternatives (counting bytes and number of repositories with the language) are no better though.
And also how exactly this method is better than just counting bytes?
When a language appears in multiple repositories, it means that the developer has some degree of reliance on it. This is an attempt to factor it into the calculation.
The square root in the new metric is used to tone down the percentage differences between languages.
A general form of the index would be
k = x^p * y^q
where p and q are constants which control the influence of x and y on the metric, respectively.
Will be better to have a comparison.
Here's a theoretical comparison. Comparsion.pdf
This developer has three repositories containing source-code for three websites. He used HTML for all his websites but JavaScript for only one.
Yet, due to the massive size of the JS code, his most used language (according to the old metric) is JavaScript. While there's no doubt he has written a lot of code using JS, HTML is what he relied the most upon.
For a real world comparison, I need data.
Reacted by Kieran W, Ricardo Fernández Serrata, Snehasish Barman, BobSaidHi, Jefferson Firmino Mendes, Ragib Al Asad, Filip and Federico D'Eredità
Here's how it would affect my current card.
I admit, I am quite unhappy with Python hogging everything. I cannot use the exclude_repo option as it removes Python entirely.
Note: Since I did not have the number of bytes, I used the percentages for calculation. The result will remain unaffected since we are finding a ratio.Also note that the final percentages are slightly higher than they should be as the orginal percentages for the selected languages add up to 99.36% only.
Activity
anuraghazra commentedon Feb 19, 2022
Hi @kitswas thanks for the proposal, quite interesting.
What do you think of the downsides of this approach? Can you mention any examples?
And also how exactly this method is better than just counting bytes? Will be better to have a comparison.
kitswas commentedon Feb 19, 2022
The size of a program (sourcecode) to perform the same task varies when written in different languages. This metric does not take it into consideration.
The alternatives (counting bytes and number of repositories with the language) are no better though.
When a language appears in multiple repositories, it means that the developer has some degree of reliance on it. This is an attempt to factor it into the calculation.
The square root in the new metric is used to tone down the percentage differences between languages.
A general form of the index would be
where
pandqare constants which control the influence ofxandyon the metric, respectively.Here's a theoretical comparison.

Comparsion.pdf
This developer has three repositories containing source-code for three websites. He used HTML for all his websites but JavaScript for only one.
Yet, due to the massive size of the JS code, his most used language (according to the old metric) is JavaScript. While there's no doubt he has written a lot of code using JS, HTML is what he relied the most upon.
For a real world comparison, I need data.
kitswas commentedon May 3, 2022
Here's how it would affect my current card.

I admit, I am quite unhappy with Python hogging everything. I cannot use the
exclude_repooption as it removes Python entirely.Note: Since I did not have the number of bytes, I used the percentages for calculation. The result will remain unaffected since we are finding a ratio. Also note that the final percentages are slightly higher than they should be as the orginal percentages for the selected languages add up to
99.36%only.rickstaa commentedon May 7, 2022
Just for reference, in case people want to chip. Part of the discussion relating to this issue can be found in #1732.
[-]New Top Language Detection Algorithm [/-][+][Proposal] New Top Language Detection Algorithm [/+]rickstaa commentedon Sep 11, 2023
This was implemented in #1732.
Update README.md