Results
|
Choice
|
Votes
|
|
Percent
|
0 hours
|
34
|
11.6%
|
|
1 hour
|
44
|
15.0%
|
|
2 hours
|
28
|
9.6%
|
|
3 hours
|
25
|
8.5%
|
|
4 hours
|
18
|
6.1%
|
|
5 hours
|
21
|
7.2%
|
|
6 hours
|
11
|
3.8%
|
|
7 hours
|
9
|
3.1%
|
|
8 hours
|
6
|
2.0%
|
|
9 hours
|
1
|
0.3%
|
|
10 or more hours
|
96
|
32.8%
|
|
|
Re: How much time per week do you spend programming?
|
Bill_pike
|
1 hour, in AP Computer Science class
Any one else take AP Computer Science.
because I do as a sophmore (in highschool)
|
Reply to this comment
|
16 May 2003, 22:45 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
How to make a function is C++ (and mybe C)
|
CajunLuke
|
Do you want a #define macro or a normal function? Here's both: (normal first)
<return type> <func. name>(<parameters>);
//main goes here
<return type> <func. name>(<parameters>)
{
//function implementation
}
Return type can be void (no return), or int, double, bool, apstring, myclass, etc. (any variable type)
Call as you would a normal built-in function.
Parameters can be reference (a copy is made for the function, and the function can't change main's value of the variable) or <I forgot the other word> (changes main's value of the function). Use an & before the variable name (as in: int &varname ).
The other kind is a #define macro. These actually copy/paste the code into the spot, instead of calling a function.
Syntax:
#define <text (no spaces) to be replaced> <stuff to replace it with>
The stuff to replace it with MUST be on ONE line, unless you use a slash (/) to end each line.
Post another comment with more questions!!
|
Reply to this comment
|
26 May 2003, 19:45 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to make a function is C++ (and mybe C)
|
Chivo
|
Here are some corrections:
Values are passed to functions "by value" (only the value is passed) or "by reference" (a reference to the variable is passed). There are two ways to pass a variable by reference. One is the way you described (using "&", or the alias operator, before the variable name in the function declaration/definition), and the other is to take a pointer as an argument. The two are really the same; it just affects the way programmers write and call the function (C++ uses pointers probably a bit more than in C because of its inherent support of objects, so I guess the designer of C++ thought the alias operator would simplify passing objects by reference -- and it does, too).
Another correction is with the slash (/). To continue a line, you need to use a backslash (\), not a forward slash. There are really only two meanings of a backslash in C or its preprocessor: (0) the next character is literal (e.g., \" means a literal double quote), or (1) the next character represents another (nonprintable) character (e.g., \n means newline, or ASCII character 10).
Correct me too if I'm wrong. I've been using C/C++ for quite a long time now, though, so I believe this is all correct.
|
Reply to this comment
|
27 May 2003, 21:06 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: How much time per week do you spend programming?
|
Chivo
|
Z80 is NOT a RISC processor. It is CISC, just as 80x86 microprocessors are. Alpha, Sparc, etc. are RISC processors.
Whatever the case, programmer errors per 10,000 lines holds the same regardless of language, and assembly programs most typically have many more lines than the equivalent C program (I would say about 3-5 times as many, depending on the architecture).
There are many other advantages to using C over ASM, so good advice is to use C except in places that need bleeding-edge performance (even C can sometimes provide that) AFTER doing performance tuning. As we should all know, premature optimization is the root of all evil. Writing in assembly for computer performance is premature optimization (of course, if you're writing for some 8-bit processor of many years ago, writing in ASM is just common sense and is sometimes the only option).
|
Reply to this comment
|
27 May 2003, 21:38 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: How much time per week do you spend programming?
|
Chivo
|
You'll be having a party with a tortoise?! When and where will it be? :-)
HLL compilers are good at medium-level optimizing, whereas assembly programmers are, I would argue, better at low-level optimizing. By focusing on the a program at a low level, a programmer might overlook a more global (higher-level) optimization that would give the program better overall performance. In addition, compilers usually make low-level sacrifices (overhead) in order to get higher-level gains in performance.
That is my "proof" that assembly programmers do not always produce faster code than a compiler. (I just re-read what you wrote: "...programmed correctly asm is always faster than C." Of course asm that is programmed correctly is always faster than C, but assembly programmers are not always able to program 'correctly', meaning in the best way possible, for reasons I've pointed out already)
Now I will partly agree with you, I do believe that assembly programmers can usually (if not always) produce low-level code that is faster/smaller than a C compiler's output, but I maintain that a compiler can produce overall better code for an entire project than hand-written assembly.
|
Reply to this comment
|
28 May 2003, 22:47 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: People that shouldn't be programming (j/k)
|
Merthsoft
(Web Page)
|
What a novel idea, but what about us cheap-os who can't afford that heavy dudy calcs (no offence to those with a TI-83+, its realy the only good once under the 89 (no offence to those with under 83+)), I know it wouldn't be as easy to port Linux to those, but hey, someone could do it :), or a brand new Linux calc, or a Gui run off of Unix, like a Unix-windows, oooh....
|
Reply to this comment
|
29 May 2003, 01:57 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: People that shouldn't be programming (j/k)
|
Chivo
|
Well, for technical reasons *nix would be darn near impossible to run on 8-bit computers without being incredibly crippled (e.g., no multitasking).
OTOH, it is very feasible to run *nix on 16-bit computers (like the TI-89) because, for one thing, *nix ran on a 16-bit computer originally (UNICS (very first spelling of it) was much more restricted, though). Also, I believe the TI-89 has more memory and is faster than the PDP-7 (the original Unix computer).
I think it's amusing to know that Unix was originally written for a machine (PDP-7) that was considered underpowered to run "real" operating systems. The PDP-7 was intended to be only a terminal for a mainframe. So now I think history will repeat itself somewhat if we put Linux on *mere* calculators. :-)
Imagine being able to network your calculators (well, yours and all of your friends' calcs) transparently and transferring files while playing games or making calculations or drawing a graph. That's multitasking, baby!
|
Reply to this comment
|
30 May 2003, 01:15 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: How much time per week do you spend programming?
|
Chivo
|
I'm even writing this in Konqueror in KDE on a Slackware GNU/Linux system. I'm getting fed up with Win98 and the rest of my family's groundless fascination with it. I mean, it crashes a LOT, and it even grinds to a halt after it's been on for a few hours (if it manages to stay up that long).
I've been watching the processor usage on there, and it just gradually increases the longer it's on, even when supposedly nothing is happening (i.e., not even moving the mouse). It's usually around 100% when it grinds to a halt.
On the other hand, I run Linux and it's almost bliss. My cable modem Internet connection is about 4 times as fast, and the rest of the system is just faster overall. I can even run several Windows programs using Wine: Solitaire, Notepad, Paint, WordPad, Word (almost), Freecell, File Manager, Program Manager, and Minesweeper.
|
Reply to this comment
|
27 May 2003, 21:54 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: How much time per week do you spend programming?
|
rmohr02
(Web Page)
|
I'm going to assume you're referring to KDE. KDE does look similar to the Windows GUI at first, but then you realize you can have multiple desktops among many other things. Also, KDE is slow. I use Enlightenment.
However, look through all of the settings fpr KDE (or GNOME or whatever desktop environment you want to try) before comparing it to the Windows GUI.
Parent of parent:
> I can even run several Windows programs using Wine: Solitaire, Notepad, Paint,
> WordPad, Word (almost), Freecell, File Manager, Program Manager, and Minesweeper.
There are native linux equivalents for all of those programs (except "File Manager" and "Program Manager", to which I don't know what you are referring).
|
Reply to this comment
|
27 May 2003, 23:32 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: How much time per week do you spend programming?
|
no_one_2000_
(Web Page)
|
I thought it looked like Windows...
And still, why do people say that Windows crashes so much? Mine never crashes (Win98) and people say that it's very unstable. Of course, 98SE is more stable than the other 98 versions. And it's not because I don't use it--heck, I'm on it every free chance I get. It doesn't even lag (unless I use CalcEm, but I'm blaming that on the program, not the OS). And beyond that, the GUI isn't ugly, all the Linux users don't like the GUI and say it's ugly, but I think it looks nice... well anyway, I'm done with this comment....
*cry* don't bash my pretty 98 *cry*
|
Reply to this comment
|
29 May 2003, 14:55 GMT
|
|
1 2 3 4
You can change the number of comments per page in Account Preferences.
|