Timeline for C++ calculator supporting five operators
Current License: CC BY-SA 4.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Jan 2, 2022 at 7:48 | vote | accept | xxnoflz | ||
S Jan 2, 2022 at 7:48 | vote | accept | xxnoflz | ||
S Jan 2, 2022 at 7:48 | |||||
S Jan 2, 2022 at 7:48 | vote | accept | xxnoflz | ||
S Jan 2, 2022 at 7:48 | |||||
Dec 31, 2021 at 20:39 | answer | added | Davislor | timeline score: 3 | |
Dec 31, 2021 at 18:00 | history | tweeted | twitter.com/StackCodeReview/status/1476976462955745287 | ||
Dec 31, 2021 at 6:30 | vote | accept | xxnoflz | ||
S Jan 2, 2022 at 7:48 | |||||
Dec 30, 2021 at 22:42 | history | edited | 200_success | CC BY-SA 4.0 |
deleted 1 character in body; edited tags; edited title; edited tags
|
Dec 30, 2021 at 17:30 | answer | added | JDługosz | timeline score: 5 | |
Dec 30, 2021 at 17:23 | comment | added | JDługosz |
A conference presentation made when C++11 was new points out that using { } is universal and better, but he still likes to use = for simple types with simple values because he's used to it. A while back I made a post (I don't remember where I'm afraid) where I showed his slide and asked if we're ready to re-evaluate that style yet and use { } more. I would not fault him for using it consistently, and this is indeed taught to newcomers who don't have that old inertia. (The spacing is weird and hurts readability, though.)
|
|
Dec 30, 2021 at 13:10 | comment | added | Edward | The current question title, which states your concerns about the code, applies to too many questions on this site to be useful. The site standard is for the title to simply state the task accomplished by the code. Please see How to Ask for examples, and revise the title accordingly. | |
Dec 30, 2021 at 12:55 | comment | added | AKX | Also, it's worth thinking about the data types – 32-bit integers to hold values from 0 to 20 (addition overflow included) seems overkill. | |
Dec 30, 2021 at 12:55 | comment | added | AKX | Well, something that comes to mind is I'd refactor things to smaller functions. E.g. your input reading could be a separate function, and printing the result another. | |
Dec 30, 2021 at 11:58 | comment | added | xxnoflz | Is there anything else that you can suggest? | |
Dec 30, 2021 at 11:55 | comment | added | AKX | Okay. stackoverflow.com/q/18222926 seems to be related to that. | |
Dec 30, 2021 at 11:53 | comment | added | xxnoflz | My use of { } is from learncpp.com, it was stated there that it is better | |
Dec 30, 2021 at 11:52 | comment | added | AKX |
Also, your use of { } to initialize variables seems a little unconventional...
|
|
Dec 30, 2021 at 11:52 | comment | added | AKX |
For one, it would be useful for a reader if you had explained that the operations work on vectors of digits, least significant digit first, without having to delve down to main() to figure that out :)
|
|
S Dec 30, 2021 at 11:02 | review | First questions | |||
Dec 30, 2021 at 12:35 | |||||
S Dec 30, 2021 at 11:02 | history | asked | xxnoflz | CC BY-SA 4.0 |