Page 2 of 2 [ 28 posts ]  Go to page Previous  1, 2

Smartalex
Toucan
Toucan

User avatar

Joined: 11 Apr 2012
Age: 39
Gender: Male
Posts: 260

14 Oct 2012, 11:45 pm

Oodain, I reviewed Arduino’s website and there is just so much great material. I beats just going through the booklet. I want to send my students there to show them a wealth of projects with pretty darn good explanations. I want them to take an interest in the project.

sliqua-jcooter, I don’t think I could build a calculator. I’m not a technology teacher, I’m just a student teacher assigned to a home room of kids that are having a difficult time in school. I got the technology lab, I thought it could be a fun project for the students. They did pretty good with the Arduinos Friday making all sorts of modifications on them like adding LED’s, making a flip flop flashing setup.

Besides going through various projects on Arduinos site, I do hope to give them an important lesson. “The language C, to retrieving stored information and do mathematics. As a programmer, you can make the program do what you choose but you have to let it know if you don’t need it to give you an answer for a math problem… Right now, you’re probably not going to need it to solve math for you, that’s why you right VOID.” I don’t want to mess them up if they choose to pursue this.

I also want to show the kids the push button, tomorrow. At the end of the week, I hope the students can partner up and create a mini project. There isn’t a grade for this. Most of the students really have a hard time with school so I hope that this can give them some inspiration and ownership.

By the way, I didn’t actually, put C ‘on notice’ one of my students did. The student had me laughing to death.

If anyone has any suggestion as for the next direction I should move the class to, I'd love to hear it, because I don't really know.
Thank you guys, you actually did help me quite a lot! :)



sliqua-jcooter
Veteran
Veteran

User avatar

Joined: 25 Jan 2010
Age: 36
Gender: Male
Posts: 1,488
Location: Burke, Virginia, USA

14 Oct 2012, 11:52 pm

Smartalex wrote:
Besides going through various projects on Arduinos site, I do hope to give them an important lesson. “The language C, to retrieving stored information and do mathematics. As a programmer, you can make the program do what you choose but you have to let it know if you don’t need it to give you an answer for a math problem… Right now, you’re probably not going to need it to solve math for you, that’s why you right VOID.” I don’t want to mess them up if they choose to pursue this.


This is closer to true - but in actuality, you can do a lot more than simple math in a method that returns something. For instance, you could have a method that takes arbitrary text and strips out any text that is a URL, and just return that string. So the distinction isn't that it's giving you an answer to a math problem necessarily, it's that it's passing *something* back. Again - it's not something easy to verbally explain, but once you actually start using methods that return values it becomes pretty apparent.

Smartalex wrote:
sliqua-jcooter, I don’t think I could build a calculator. I’m not a technology teacher, I’m just a student teacher assigned to a home room of kids that are having a difficult time in school. I got the technology lab, I thought it could be a fun project for the students. They did pretty good with the Arduinos Friday making all sorts of modifications on them like adding LED’s, making a flip flop flashing setup.


It shouldn't be particularly difficult - I've got an electronics bench in my office that I use far too sparingly - I'll see if I can grab some time this week and come up with a sketch. The nice thing is it can be made very simply, and then expanded on to become extremely complex (you can start with outputting information to the PC, then add a 7-segment display later, and then add a matrix keypad after that - and from there you can get into shift registers and all kinds of crazy stuff).

If you're in a major city, you could also look into seeing if there are any hacker spaces in your area that would be willing to help, either with space/equipment or lesson development/etc.


_________________
Nothing posted here should be construed as the opinion or position of my company, or an official position of WrongPlanet in any way, unless specifically mentioned.


2fefd8
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 25 Jul 2012
Age: 36
Gender: Male
Posts: 44

15 Oct 2012, 9:49 pm

MyFutureSelfnMe wrote:
You could do that in C (I don't know if it's still legal in C11) but not in C++. I believe that's a relic of the B language?


It appears so. Hopefully it will be removed eventually.

Smartalex wrote:
Besides going through various projects on Arduinos site, I do hope to give them an important lesson. “The language C, to retrieving stored information and do mathematics. As a programmer, you can make the program do what you choose but you have to let it know if you don’t need it to give you an answer for a math problem… Right now, you’re probably not going to need it to solve math for you, that’s why you right VOID.” I don’t want to mess them up if they choose to pursue this.


There's no deep reason why you should to specify the return type void when the function doesn't return a value. It's just that a funcion has the form

[return type] [name of function]([arguments]) {
[code]
}

so if you were allowed to write

f()

for a function that doesn't return anything it would be inconsistent with the syntax used for functions that return a value which makes things messier. C actually defaults the return type to int when it isn't specified which is arguably even worse.



Evinceo
Deinonychus
Deinonychus

User avatar

Joined: 13 Apr 2012
Age: 31
Gender: Male
Posts: 392

17 Oct 2012, 12:33 am

If you don't want to do math, C/C++ aren't for you, nor are any of the FORTRAN/Algol derived languages such as Pascal, Python, Java, etc. You might want to try Smalltalk, COBOL, or BASIC.



2fefd8
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 25 Jul 2012
Age: 36
Gender: Male
Posts: 44

17 Oct 2012, 3:25 am

Here's a more accurate statement:

Evinceo wrote:
If you don't want to do math, programming isn't for you.


Being a proficient programmer requires a basic knowledge of mathematics no matter what language you use. It might be slightly less in some languages but often basic math is inherent to the problem you are trying to solve. In these cases, you can't avoid it by using a different language.

Also, if you have trouble with math, you'll probably also have problems with logic (which is even more important for programming).



CranialRectosis
Raven
Raven

User avatar

Joined: 5 Dec 2010
Age: 54
Gender: Male
Posts: 111

17 Oct 2012, 8:58 pm

Geez, if you like C names, check out SQL Server. There is nothing quite so much fun as trying to convert a C int to a SQL Server tinyint or bigint. SQL also has lovlies like the smalldatetime and the datetime. The difference between the two being what, thousanths of a second?

Oracle is great too. Varchar2. What was so tough about a Varchar that they had to make a Varchar2?

I know the difference and I use Varchar2 all the time. I just wish at least MS would standardize. Converting an int16 to a tinyint or the reverse in SSIS is a PITA.



Ancalagon
Veteran
Veteran

User avatar

Joined: 25 Dec 2007
Age: 45
Gender: Male
Posts: 2,302

18 Oct 2012, 10:16 am

CranialRectosis wrote:
SQL also has lovlies like the smalldatetime and the datetime. The difference between the two being what, thousanths of a second?

datetime rounds to the nearest thousandth of a second, smalldatetime rounds to the nearest minute. The smaller one is 4 bytes, the larger one is 8. If you need precision, the choice is obvious. If you need to store years worth of logs with timestamps that only need to be accurate to the nearest hour, the choice is also obvious.

Quote:
There is nothing quite so much fun as trying to convert a C int to a SQL Server tinyint or bigint.

Maybe I'm missing something, since I've never actually done that, but what's so hard about it? Can't you just cast to uint8_t or int64_t?


_________________
"A dead thing can go with the stream, but only a living thing can go against it." --G. K. Chesterton


Cynic
Blue Jay
Blue Jay

User avatar

Joined: 22 Mar 2008
Age: 50
Gender: Male
Posts: 92

18 Oct 2012, 2:56 pm

2fefd8 wrote:
Being a proficient programmer requires a basic knowledge of mathematics no matter what language you use. It might be slightly less in some languages but often basic math is inherent to the problem you are trying to solve. In these cases, you can't avoid it by using a different language.

Also, if you have trouble with math, you'll probably also have problems with logic (which is even more important for programming).

Whicj areas of maths are you referring to? Do you really need an in-depth knowledge of algebra, trig etc.? Or just binary and hex? :-?



2fefd8
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 25 Jul 2012
Age: 36
Gender: Male
Posts: 44

18 Oct 2012, 9:06 pm

Cynic wrote:
2fefd8 wrote:
Being a proficient programmer requires a basic knowledge of mathematics no matter what language you use. It might be slightly less in some languages but often basic math is inherent to the problem you are trying to solve. In these cases, you can't avoid it by using a different language.

Also, if you have trouble with math, you'll probably also have problems with logic (which is even more important for programming).

Whicj areas of maths are you referring to? Do you really need an in-depth knowledge of algebra, trig etc.? Or just binary and hex? :-?


I just meant basic properties of integers for the most part. For some programming tasks, more advanced knowledge is needed; however, this is sufficient in many cases. Of course more math is always better...



ruveyn
Veteran
Veteran

User avatar

Joined: 21 Sep 2008
Age: 87
Gender: Male
Posts: 31,502
Location: New Jersey

19 Oct 2012, 9:13 pm

2fefd8 wrote:
Here's a more accurate statement:

Evinceo wrote:
If you don't want to do math, programming isn't for you.


Being a proficient programmer requires a basic knowledge of mathematics no matter what language you use. It might be slightly less in some languages but often basic math is inherent to the problem you are trying to solve. In these cases, you can't avoid it by using a different language.



With particular emphasis on numerical methods. In the last analysis, all a computer can crank out are approximations. (Yes, I am aware that a limited amount of symbolic math can be done with computer).

ruveyn



CranialRectosis
Raven
Raven

User avatar

Joined: 5 Dec 2010
Age: 54
Gender: Male
Posts: 111

22 Oct 2012, 8:24 am

Ancalagon wrote:
CranialRectosis wrote:
SQL also has lovlies like the smalldatetime and the datetime. The difference between the two being what, thousanths of a second?

datetime rounds to the nearest thousandth of a second, smalldatetime rounds to the nearest minute. The smaller one is 4 bytes, the larger one is 8. If you need precision, the choice is obvious. If you need to store years worth of logs with timestamps that only need to be accurate to the nearest hour, the choice is also obvious.

Quote:
There is nothing quite so much fun as trying to convert a C int to a SQL Server tinyint or bigint.

Maybe I'm missing something, since I've never actually done that, but what's so hard about it? Can't you just cast to uint8_t or int64_t?


My observation about smalldatetime and datetime is that with any MS Date, you have a timestamp. Creating a simple date is anything but as it requires a mask. Oracle splits these out into date and time stamps. You only use what you need. SQL server does not permit a date without a time.

In most of my processes I read from SQL Server in C# and reply back to SQL server from C#.

C# does not have bigint and tinyint. SQL Server does not have int16 or int32. You have to cast to and from the SQLDbTypes in the C#. This suks if you are using multiple recordsets prior to SQL Server 2005 and so are using the OLEDB connections instead of the SQL Server ones.



Ancalagon
Veteran
Veteran

User avatar

Joined: 25 Dec 2007
Age: 45
Gender: Male
Posts: 2,302

22 Oct 2012, 9:43 am

CranialRectosis wrote:
SQL server does not permit a date without a time.

That's a reasonable criticism.

Quote:
C# does not have bigint and tinyint.

OK. Personally, I'd lean towards blaming C# for this one.


_________________
"A dead thing can go with the stream, but only a living thing can go against it." --G. K. Chesterton