Page 1 of 2

My calculator [feedback & testing wanted]

PostPosted:Wed Sep 10, 2014 3:59 pm
by Akimoto
So... I am learning a new programming language (C#), and I was wondering if any windows users (C# is made for Windows) could help me test my mathelatur... mathelator... (name undecided)... calculator!

Download link (.zip): http://www.dropbox.com/s/87b0jvz9ffpugl ... r.zip?dl=1
Size: ~40 kb

I have already had a few of my friends test it, only to find a bug that crashed it - which is now FIXED (wohoo)

There are a few "visual" bugs (low priority) that I intend to fix. For one, the comma looks screwed up while typing. Another one is when you enter negative numbers, the "-" is behind the number, not in front!

Screenshot of the calculator:
http://prntscr.com/4lim4f

Re: My calculator [feedback & testing wanted]

PostPosted:Wed Sep 10, 2014 6:11 pm
by Key
Akimoto wrote:... C# is made by Windows ...
Image

Where Windows is code-word for Microsoft


anyways, I'd be more interested in looking at your source files if you want coding related critique

Re: My calculator [feedback & testing wanted]

PostPosted:Wed Sep 10, 2014 6:34 pm
by Akimoto
For. For windows!

Re: My calculator [feedback & testing wanted]

PostPosted:Wed Sep 10, 2014 10:07 pm
by jawfin
Its so cute. If you want to make it a powerful calculator you need only give it the option to accept "Reverse Polish notation".

Re: My calculator [feedback & testing wanted]

PostPosted:Wed Sep 10, 2014 10:17 pm
by Zabuza
Akimoto wrote:

For one, the comma looks screwed up while typing.
You mean the decimal point, correct? If not, when I select a number and then the decimal point, the decimal point appears before the number which is incorrect.

Anyway, you need to set a maximum length on your textbox. If you want your maximum length to be greater than the width of your textbox's width, then you'll need to wrap your text.

Also, being picky as a double math major, when x / 0 we usually refer to it as undefined, not infinity.

If you need help, I'm a C# developer "by trade".

Edit: Just found that if you do 0 / 0 it will display NaN which is fine, should be like that for the case i gave above.

Re: My calculator [feedback & testing wanted]

PostPosted:Thu Sep 11, 2014 1:41 am
by jawfin
As Key said, if you want real feedback, hand over the source!! Trust me, I *will* find things to be improved upon, ask any fledgling programmer here ;)

Re: My calculator [feedback & testing wanted]

PostPosted:Thu Sep 11, 2014 9:34 am
by Akimoto
I am going to read up some more about GIT. I really want to use it, however I am really poor at... uhh... keeping it sync'd! I would like to learn how to use the simple "git" thing (console commands only) and manually pull push and commit that stuff. I still have trouble differentiating between the pull push commit stuff.

Once I find out how ... I will put it on github, then anyone can fork it and help :D (The most important part is that I learn!!! Don't do all the work for me :) )


Edited by Jawfin: Removed swear word. And may I add Image

Re: My calculator [feedback & testing wanted]

PostPosted:Thu Sep 11, 2014 8:29 pm
by jawfin
It's not like this is some massive open-source project, it's a tutorial 101 - just to put it in perspective. Just because you painted a picture with finger painting doesn't mean you immediately go looking for a gallery to display it in. If you want honest feedback just zip the source and host it somewhere.

Re: My calculator [feedback & testing wanted]

PostPosted:Thu Sep 11, 2014 11:51 pm
by Key
Jawfin wrote:ask any fledgling programmer here ;)
I remember when I showed Jaw one of my first shaders... I got a lashing for incorrect indentation, and that was before the real lesson even started

the more I think about it the worse I feel, so I apologize Jaw for all the horrible bowls of code spaghetti I threw at you. But look where I am today! I can still barely make a working linked list in C++! :D

Re: My calculator [feedback & testing wanted]

PostPosted:Fri Sep 12, 2014 2:16 pm
by Akimoto
Can Jawfin PM me the swear word I used? As far as I know, I did not swear...

Jawfin wrote:It's not like this is some massive open-source project, it's a tutorial 101 - just to put it in perspective. Just because you painted a picture with finger painting doesn't mean you immediately go looking for a gallery to display it in. If you want honest feedback just zip the source and host it somewhere.
I agree, the calculator itself is a "tutorial" (at least that's where I started to get familiar with C#), however the tool I am making requires a calculator, so the calculator itself is the easy part. (I promised myself when I completed my tool, I will buy Oculus Rift DK2)

Re: My calculator [feedback & testing wanted]

PostPosted:Fri Sep 12, 2014 8:48 pm
by Akimoto
Okay, managed to get the Calculator on Github:
https://github.com/Tyboroth/Calculator

Feedback appreciated!

Re: My calculator [feedback & testing wanted]

PostPosted:Sat Sep 13, 2014 1:41 am
by jawfin
I haven't fully dissected it, but I must say you write good code, well structured, useful comments, meaningful variable names. The long-winded "if then else"s are hard to read - you could remove all the bracketing around the single statements, just so it flows (assuming C# supports that) - but that's not a criticism, just a personal preference.

Re: My calculator [feedback & testing wanted]

PostPosted:Sun Sep 14, 2014 3:42 pm
by Akimoto
Okeey!

I think I have fixed the serious bugs, since I am no longer able to reproduce the crashes. If I am wrong, please let me know asap so I can start working on it! :)
I also have to find a way to put the minus infront of numbers, instead of behind them - no idea where to start , probably at Google (among other "features" I want to implement).

Download @ https://www.dropbox.com/s/87b0jvz9ffpug ... r.zip?dl=1
Source (latest) @ https://github.com/Tyboroth/Calculator

Appreciated!
Jawfin wrote:I haven't fully dissected it, but I must say you write good code, well structured, useful comments, meaningful variable names. The long-winded "if then else"s are hard to read - you could remove all the bracketing around the single statements, just so it flows (assuming C# supports that) - but that's not a criticism, just a personal preference.

Yes, I agree; I want to clean up all the if else statements. I basically added them wherever I needed them to prevent bugs and/or add "features".

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 16, 2014 2:24 pm
by Akimoto
Cleaned up a bunch of code and added more informative comment (should be able to follow the programming flow without having to think "too" much, hehe). I cannot find a single bug that can crash the calculator!! bwaha.. hrh..

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 16, 2014 3:23 pm
by Zabuza
A C# convention is to name methods with the first letter uppercase. Overall, your code is well designed.

Edit::

Another suggestion I have is to declare your operator characters, +, -, etc, as class level constants. Also, on the line above a function header, you can type /// to make method comments.

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 16, 2014 3:51 pm
by Akimoto
Zabuza wrote:A C# convention is to name methods with the first letter uppercase. Overall, your code is well designed.

Edit::

Another suggestion I have is to declare your operator characters, +, -, etc, as class level constants. Also, on the line above a function header, you can type /// to make method comments.
Thanks - I'll fix it. I always aim to follow the convention of each language (although it can sometimes be difficult to differ between then).

Not sure how the constants work in C# (syntax). I'll keep that in mind next time I am working on the code.

Re: My calculator [feedback & testing wanted]

PostPosted:Thu Sep 18, 2014 9:01 am
by Lothar
You know you don't belong in this conversation when the first thing you think upon reading " Calculators " is ...... " What numbers can I make look like words? "

Re: My calculator [feedback & testing wanted]

PostPosted:Fri Sep 19, 2014 11:24 am
by Akimoto
All bugs are fixed. Only visual "annoyances" left. I want minus infront of the "%¤%&#¤ numbers and comma to display correctly when pressing "2 . " (it displays as .2 )

Re: My calculator [feedback & testing wanted]

PostPosted:Sat Sep 20, 2014 7:56 pm
by Zabuza
Lothar wrote:You know you don't belong in this conversation

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 23, 2014 12:12 pm
by Akimoto
Unless someone know how I can get the minus infront of the result textbox (instead of currently behind on the right) and/or how to fix the weird display of comma - I will not be working on this for a while. Currently focusing on working on the RCG Tool (also on github) :)

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 23, 2014 3:47 pm
by Mandalorian
RCG? Ronald Craig's Ghetto?
Renting Colored Garages?
Rescuing Cold Groceries?

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 23, 2014 4:46 pm
by Akimoto
Mandalorian wrote:RCG? Ronald Craig's Ghetto?
Renting Colored Garages?
Rescuing Cold Groceries?
Yes.

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 23, 2014 4:51 pm
by Zabuza
Manda, please stay on topic..

Re: My calculator [feedback & testing wanted]

PostPosted:Tue Sep 23, 2014 9:20 pm
by jawfin
Even still, Aki didn't answer the question.
Google + "RCG Tool github" = https://github.com/laurion/RoboSoccer/b ... ol/rcg.xsd

Google + "RCG Tool wikipedia" = http://en.wikipedia.org/wiki/RCG
Radio Crne Gore, a radio station in Montenegro
Republic of Montenegro, state preceding independent Montenegro
The Radio Church of God, now the Worldwide Church of God
Range Concatenation Grammar, a type of formal grammar
Revolutionary Communist Group (disambiguation), several political parties
Royal Cambodian Government
Reed Canary Grass, a type of biomass.

Of all those I would guess Range Concatenation Grammar, but that seems too complex to follow a basic calculator.

When using unknown terms, it wouldn't hurt to actually explain them.
Or as urban dictionary puts it "rollercoaster girl" - big help that was!

How to vague?

Re: My calculator [feedback & testing wanted]

PostPosted:Wed Sep 24, 2014 2:01 am
by Zabuza
I'm guessing Random Character Generator based on the content in Github.