Talk:Resistance calculator: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Shunting Yard: new section)
Line 46: Line 46:
* Infix: 2 + 3
* Infix: 2 + 3
* RPN: 2 3 +
* RPN: 2 3 +

This proposal unfortunately has the implication that operator overloading is no longer needed.

Revision as of 16:08, 15 March 2019

--ChristerNilsson (talk) 11:02, 14 March 2019 (UTC) I need help with the picture. File Upload seems to be broken since 2016. I also would like to set tab size to two spaces, if possible

Headings

Hi, you also need to not use subheadings in the task description - they are reserved for Language examples exclusively.

You can get that kind of effect using:

Not a heading

;What is typed for the above type of bold subheading starts with a semicolon

All the best :-)
--Paddy3118 (talk) 13:45, 14 March 2019 (UTC)

Tab Size

Although I'd be delighted to be proved wrong, there doesn't appear to be a way to change the tab size on this site which is fixed at 8.

If you want to use anything else (personally I prefer 4), then use spaces rather than tabs. --PureFox (talk) 10:09, 15 March 2019 (UTC)

--ChristerNilsson (talk) 15:53, 15 March 2019 (UTC) In Github I just add a file .editorconfig where tab width is stated. I find tabs has a lot of advantages. Smaller files, fewer keystrokes, and each individual might use his/her own tab width. But, this is religion and not even Nim allows tabs. I must use the following directive as the first line in every .nim file: #? replace(sub = "\t", by = " ")

Task Name

Two things:

1 In general, Rosettacode task names should only have the first word in a title capitalized. (Excluding proper nouns) It isn't a hard rule, and has been broken before, but is the preferred style.
2 Is there any particular reason this is named Parallel resistor calculator? Seems like it is doing both parallel and series resistances. I would propose to rename it to "Resistance equivalence calculator" to frontload what the primary point is: "Resistance", more accurately describe what it does, and bring it in line with site naming conventions. (Or even just Resistance calculator ) --Thundergnat (talk) 12:23, 15 March 2019 (UTC)

--ChristerNilsson (talk) 15:44, 15 March 2019 (UTC) I agree, name changed to Resistance Calculator

Picture

--ChristerNilsson (talk) 15:46, 15 March 2019 (UTC) I would like the picture to be displayed directly, without being a link.

Shunting Yard

--ChristerNilsson (talk) 16:02, 15 March 2019 (UTC) I added a Nim solution for a better handling of infix input. Ideally, the source code should not have to be recompiled for every new input. Also, most of the code in Infix and RPN are identical. So, they might be merged.

Input change proposal:

  • Infix: 2 + 3
  • RPN: 2 3 +

This proposal unfortunately has the implication that operator overloading is no longer needed.