User talk:AnatolV: Difference between revisions

(added many comments.)
 
(4 intermediate revisions by 3 users not shown)
Line 1:
==Aphorisms (good to follow or just keep in mind)==
From my OEIS Wiki user page.<br>
'''Socrates''' (470 BC - 399 BC)<br>
"As for me, all I know is that I know nothing."<br>
"Question everything."<br>
'''Terence''' (195 BC - 159 BC)<br>
"There are as many opinions as there are people: each has his own correct way."<br>
"Nothing is so difficult but that it may be found out by seeking."<br>
'''Edgar Rice Burroughs''' (1875 - 1950)<br>
"We are, all of us, creatures of habit."<br>
[Find more on my OEIS Wiki user page and much more on Wikiquote.]
==About Clean Code and Internet Graffiti==
The following is a short list of bad practices in programming industry (related to the code only):
* Very long historical and/or technical '''preludes'''.
* Multiple '''comments''' (almost on each line).
* '''Decorating code''', e.g., using tricky frames for comments, also, unnecessary multiple pound and other signs,
* Obsession with tabbing (code is shifted too far to the right side). And opposite: totally avoiding '''identification'''.
* '''Splitting''' one statement (fitting one line) into 5 lines. And opposite: putting 10 and more statements on 1 line..
* '''Code leftovers''': not used definitions, variables, code fragments for testing, etc.
* '''Typos''' in the code.
All of these bad practices you can find here on Rosetta Code.<br>
Doesn't matter what contributing author, or somebody else thinks about it, - it is still a bad practice known and avoiding for decades.<br>
If you have/had a job as a programmer/developer for a solid company or university producing software (including Web pages) it is well known fact for you that your supervisor will not
allow/tolerate any of these bad practices.<br>
'''Main reason is always - money.''' Such "dirty", not structured code is difficult to read and maintain.<br>
I'm not gonna write an article here. Just google please: "bad programming practice", and you will find hundreds of pages devoted to it.
But be reasonable in selecting some advises. For example, you can find advises about '''comments''' ranging from "too many is bad" to
"not enough is bad", but also: "Do not write code that needs comments."<br>
The good '''rule of thumb''' in this case is following: If function (method, etc.) is 5-10 lines of code or less then describe briefly function purpose and calling parameters only (if any).<br>
Here is another contradictory advise popular in many documents, books, etc.: "use '''white spaces''' to make code more readable". But, contrary, it is not a bad practice/habit to use minimal number of white spaces.<br>
If you are using languages that would be interpreted, e.g., Java, JavaScript, PHP, ASP/ASPX, etc., then all comments are usually deleted and code is shrunk as much as possible
to speed up processing time. So, keep well documented version of code in archive.<br>
'''Decorating code''' and using not related images are considered an "Internet graffiti"
by some authors/bloggers. But more often it is called just trash and spam.<br>
Regarding "preludes" here on RC I would say they are OK, but better place would be on related language page, e.g., with titles like "Interesting historical notes",
"Useful XXX language tips", etc.<br>
The main reason: task pages becoming too big and looking through them sometimes is really difficult.<br>
Here is another sample. My VoeLib.gp page (pure text file) on OEIS Wiki became too big, and I've got automatic Wiki message: "Your page is bigger than 32K. Please reduce its size. Some browsers can't
handle big pages". This forced me to split my page into 2 pages. Soon we will have the same problem here on RC.
See another even more appropriate suggestion below.
==How to handle huge code and comments==
Here is a very good sample how to handle big chunk of code and, additionally, how to deal with huge comments.<br>
Task page [[AVL_tree| AVL tree]] has [[AVL_tree#C.2B.2B| C++]] 3 versions.<br>
Note that first version has a realy huge chunk of code. But "More elaborate version" has no code,- just a link: "See AVL_tree/C++".<br>
It links to: "AVL tree/C++" page with huge code, and this page has a typical "Discussion" link that leads to:<br>
[[Talk:AVL_tree/C%2B%2B| Talk page]] titled "Talk:AVL tree/C++". So, put all notes you want here.
[[User:AnatolV|AnatolV]] ([[User talk:AnatolV|talk]])
==Obsessed??==
'''<<This is copied from Dragon curve Discussion page. Just added 1 related reply.>>'''<br>
Some contributors are obsessed with:
* Very long historical and technical preludes;
* Multiple comments (almost on each line);
* Unnecessary multiple pound and other signs.
All this makes code "dirty", hard to read and maintain. I'm just curious: who will read such preludes, comments?<br>
An obvious sample is the first version of dragon curve in R. I thought that contributor is for sure obsessed with pounds...<br>
Or trying to camouflage original code... Although original code has a lot of pounds too,
but RC contributor added even more! LOL See for yourself:
rstudio-pubs-static.s3.amazonaws o com/185483_0f31b11d2def43aea33658b5b7908cf3.html<br>
Team MEOW: Eric Lewis, Ricky Hardiyanto, Yanna Chen - CityTech. May 29, 2016<br>
BTW, it’s impossible to find who is the contributor of the first version of R.--[[User:AnatolV|AnatolV]]
: Probably not a great idea to make disparaging remarks about other peoples code. That being said, it's a public wiki. If there is code that is unidiomatic or messy, clean it up. Just be aware that some users are very protective of their contributions and coding styles.
: As far as who contributed the first R example, looks like it was [http://rosettacode.org/wiki/Special:Contributions/Werewolff519 Werewolff519]; see [http://rosettacode.org/mw/index.php?title=Dragon_curve&type=revision&diff=196234&oldid=195807 this revision] --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 12:58, 4 March 2017 (UTC)
::TYVM Thundergnat! Now I can see: he attached solution to Perl with no comments. I did the same when I started here. LOL But later I've found it is useful to leave a short comment. I was hoping the contributor is one of the authors of the cited article. But, in general, it doesn't matter for me.
::I will continue discussion on my Talk page. (not today, I have too many logins) -- [[User:AnatolV|AnatolV]] ([[User talk:AnatolV|talk]])
::'''@Thundergnat:''' I have 2 issues with your suggestion to "clean it up": 1st, I prefer author or at least admin do it; 2nd, it is "eating" my logins. I did edited a few typos, wrong tag using, etc. But soon I've found: my (actually everybody but admins) logins are restricted. See my post on talk:Short Circuit page "Problems and a few suggestions".
:::I try to pick my battles. Coding style is usually not one of them. I made that suggestion solely to point out that if it bothers you, you have the power to do something about it.
:::I am not aware of there being any restrictions on the number of logins anyone (who hasn't been completely blocked) can make, admin or not. I get the "You have cookies disabled" notice about 1 out of 5 times I try to log in. Usually if I wait 30 seconds or so and retry it goes through the second time. Not always, but usually. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 22:59, 6 March 2017 (UTC)
::::Thundergnat: I know for sure how busy you are doing editing job. RC should have a dozen of active editors (not 2-3 like now).
::::Regarding restricting logins with fake messages: It was proven by me in discussion with other admin. Please find it here on this page below.
::::[In Chrome: 1st click on page; then type [Ctrl+f]; then type in popped-up find bar: FAKE. That's it.]
 
==PARI/GP and gnuplot implementations [Polyspiral].==
See [[Talk:Polyspiral| Talk:Polyspiral]]
 
==Hailstone sequence version 2 (& not ONLY)==
'''@Gerard Schildberger:'''
Line 15 ⟶ 89:
 
: Yes, there're a '''lot''' of output(s) that is/are incorrect and/or wrong, and also missing completely, &nbsp; and some that don't even address some &nbsp; (or all) &nbsp; of the output requirements, and still others that show something completely different. &nbsp; I'm not a Rosetta Code administrator, so I try to tread pretty lightly, especially after I got into a tiff (well, tiffs) &nbsp; with a particular user (who eventually became the only user to be banned for life from Rosetta Code) --- and this was after he was warned and banned twice (as I recall). &nbsp; Ever since then, I felt like I was tarnished (with a pretty wide brush after that cyber bullying) and I've been pretty hesitant when flagging programming examples (or their output) with an &nbsp; ''incorrect flag''. &nbsp; Your replies have made me realize that flagging others would be a costly endeavor and incur too much wrath (or flame wars?) &nbsp; for correcting such a simple error. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:22, 22 April 2016 (UTC)
 
<br>
-----
<br>
 
'''Last''', I’ve discovered that RosettaCode Wiki using '''FAKE''' messages to limit login of certain users to pages. This is not nice and not correct.
Line 49 ⟶ 119:
As I said,- it’s not correct actions somebody set within RosettaCode Wiki! Do you know why?? Because it could mean that RosettaCode Wiki site was hacked, or I was redirected to imposter’s site, etc.
 
: No, you weren't hacked. &nbsp; You should contact Michael Mol &nbsp; (username '''Short Circuit''') &nbsp; the inventor/founder of the Rosetta Code website), or one of Rosetta Code administers. &nbsp; He (or they) would be able to answer (and maybe even address/fix) your concerns &nbsp; (and my concerns as well). &nbsp; This may be part of their solution to try to limit (or fix) the "spamming" thingy that is happening on Rosetta Code (where users are putting person non-Rosetta Code stuff) &nbsp; in their user pages to gain link counts to their personal websites to gain Google favored status (the more links, the further up the Google presentation of websites ya go when searches are done for particular keywords --- at least, that is how I understand it). &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:22, 22 April 2016 (UTC)
 
Even to post this note I need to log in. '''Waiting when I would be allowed to LOG IN!??''' You see?? '''This is a real problem!''' LOL
Line 100 ⟶ 170:
 
Best regards, AnatolV
 
 
==Hailstone sequence, version 2==
Anonymous user