The REASON we want good clean code is so that _we CAN_ maintain it.
I agree wholeheartedly. When I went on my first co-op (my first real-world computer-related job), I was very surprised by the amount of terrible code. At the time I was working on creating data-driven intranets. There is nothing harder than trying to expand a database application that has a terrible database design. I am a strong believer that each extra minute spent writing more legible, better-written code, is ten minutes saved down the road.
It's not a philosohpical issue, it's one of practicality.
While it is practical to perform such good code writing techniques, is there also not some philosophical reason as well? For example, if you had to write a program that you were 100% guaranteed would not be worked on in the future, would not need to be updated or maintained, would you write crappy code? Maybe it's a little too late, and I'm a little too tired, but it seems to me that writing good code is something we should strive for not just for practicality, but for higher reasons too. I hate to make it sound like good code is more moral...
Hmmm, if you think of a program as a creation of yours, as something you made, then it behooves you to take the time to make it great. Ugh. Sorry, I am sure this is making no sense. Too late. Good night.:)
Huh, that brings up an interesting point. What is better, to write crappy code or to take the time to make it nice and neat? From the programmer's perspective, it makes sense to write crappy code: bosses are demanding you finish projects before you even begin them, and good takes time to write; also, like you mentioned, job security is nice indeed.
However, don't we, as programmers, have some sort of obligation to try our best to create nice, maintainable code? I may be getting a little too philosophical here, but we expect artists to paint to their best abilities, poets to write to their best ability. It seems like if someone in one of these professions purposefully wrote sloppy poetry, or half-assed a painting, that we would look down on them. Perhaps it is a pride thing, but you think you'd intrinsically want to write good code.
I am not trying to sound preachy, CFN, for I don't know if you wrote sloppy code because you wanted to, or, more likely, because you were rushed and your superiors favored quantity of quality.
The funniest one, by far, I thought, was: Make sure that every method does a little bit more (or less) than its name suggests. As a simple example, a method named isValid(x) should as a side effect convert x to binary and store the result in a database.
That had be laughing outloud! Being a web developer, I have often had to work with code that tried to do many, many thing. One web page would try to accomplish thirty different things, based solely upon the querystring parameters passed in. Ugh. Now there's job security!:)
I think it was ignorant of Infoseek/Disney to choose the name Go, especially since there was already Goto.com, who got the stock name GOTO, while the GO network still uses Infoseek's symbol, SEEK.
First off, it's not that big of a deal. I'm sure the US government has its own intricate Internet warefare plan. Regardless, we shouldn't act so surprised. We have been giving China various technologies for a while now, so if we really have anything to worry about, we can only blame ourselves.
What's really neat is that it shows the importance of the Internet- not that anyone who reads Slashdot questions the role of the Internet in business, government, and personal use- but it's neat to see that controlling the Internet and an enemies computer networks as viewed as important as controlling an enemies land, sea, and airspace.
One thing the article pointed out was that Microsoft was in the wrong for selling two nearly identical versions of NT. One being the Server version, and the other being the Workstation version. The Server version costs considerably more, even with the Workstation version being identical, less a few registry settings to impare its functionality. The author makes a big point of this, saying that Microsoft really has no right to do this. My question: isn't this identical to a chip maker producing chips that all run the same speed, then limiting some to run slower, and selling them for less? Where's the difference, and why is the author making such an outcry against Microsoft doing this?
Of course, this is only true if you have a big enough file with digits of pi. If you only have 1M digits of Pi, well, then you have at most 1M passwords.
Uh, no. First off all, I have an infinite number of digits from pi to choose from. Furthermore, say I choose to have my password be 10 characters, then there are 10^10 possible passwords, since each character can contain one to ten digits...
Don't think the above will work, exactly. At least not create a fork bomb. fork() returns two different values - the parent receives the process ID of the child, the child receives 0. So, what will happen here? The parent will call fork(), a child process will be created. The child will have fork() return 0, so the while loop will terminate. The parent will infinitely keep creating children, but the chirldren will keep killing themselves. Fraid you got an infinite loop there, not a fork bomb.
Also am wondering about the first one: main(){fork();fork();}
In fact, enter that, compile it, run it, and your program will terminate.:) A total of three children processes will be created, but only one of the three will create another child process, and it will only create one child process at that, which will not create its own child process.
I wonder how you land a job coming up with those algorithms. That's freakin' insane, weeks to run on super computers. Wow.
They should build a super computer and have it run all the time calculating pi, just to see if eventually it terminates or starts repeating...:)
Re:so what is the right pronunciation?
on
Linux on Jeopardy
·
· Score: 1
Who cares about correct pronunciation. Language is malleable and based upon the whims of society as a whole. New worlds enter and leave the vernacular daily. If enough people pronounce it line-ux, then that is how it will be pronounced. Personally, I call it line-ux. I think lynn-ux just sounds funny.
Isn't the Tower of Babel a Biblical story, where the tower allowed everyone to understand each others' languages? I thought this was bad, leading to mass wars and such. Hmmm, hope this device isn't a tool of Satan. What OS did you say it ran?:)
I wonder what the software to test nuclear explosions does, exactly. Shows a picture of a nice suburban area, then a bright flash, followed by a picture of desert? ASCII stick figures running around on the screen on fire? A counter labeled FOLKS DEAD: that is just set as while(1) FolksDead++;:)
Seriously, though, it would be intersting to see the code for those sims. What kind of calculations they are performing that require such super computers.
The cool thing about Y2K is that we really don't know what will happen. We assume there will be minor problems and such, nothing too servere- perhaps a few systems halting around the world. Nothing too severe, at least we hope not. I can't wait to see what happens. I doubt computers will ever bring civilization to its end, but the religious zealots, those who freak out over Y2K, and others, could make new years eve very interesting!
It only takes a small group of people to start wiggin' out before the whole nation will be going crazy. How many folks have to run to the bank to get all of their money before we have a run on the banks which requires governmental intervention? Interesting, it should be fun!
I tell you, the neatest place to be would be Times Square, especially if something went wrong. Imagine if the power went out across the country when Y2K hit (not likely, I know). Anyway, could you imagine being there in Times Square along with tens of millions of others? 5-4-3-2-1... total darkness. Tee hee!
I know of many colleges really dont care what thier students do but is this an invasion of the students privacy/rights?
Uh... no. Read the article... it says the university only looked at files that were publically shared out in the students' computers. Also, files that were placed on the Web from CMUs servers were checked.
If you don't want to get busted, don't publically share out illegal material. And for God's sake, don't put it on the Net.
The real humor, though, is that for these students to get their accounts back, they have "to attend a 90-minute class on copyright rules." Hehe, that is funny.:)
It only works with gcc, since there is a dynamic array. Could fix that by using #define a 256, but I was trying to munch it down to as few characters as possible.
I agree wholeheartedly. When I went on my first co-op (my first real-world computer-related job), I was very surprised by the amount of terrible code. At the time I was working on creating data-driven intranets. There is nothing harder than trying to expand a database application that has a terrible database design. I am a strong believer that each extra minute spent writing more legible, better-written code, is ten minutes saved down the road.
It's not a philosohpical issue, it's one of practicality.
While it is practical to perform such good code writing techniques, is there also not some philosophical reason as well? For example, if you had to write a program that you were 100% guaranteed would not be worked on in the future, would not need to be updated or maintained, would you write crappy code? Maybe it's a little too late, and I'm a little too tired, but it seems to me that writing good code is something we should strive for not just for practicality, but for higher reasons too. I hate to make it sound like good code is more moral...
Hmmm, if you think of a program as a creation of yours, as something you made, then it behooves you to take the time to make it great. Ugh. Sorry, I am sure this is making no sense. Too late. Good night. :)
However, don't we, as programmers, have some sort of obligation to try our best to create nice, maintainable code? I may be getting a little too philosophical here, but we expect artists to paint to their best abilities, poets to write to their best ability. It seems like if someone in one of these professions purposefully wrote sloppy poetry, or half-assed a painting, that we would look down on them. Perhaps it is a pride thing, but you think you'd intrinsically want to write good code.
I am not trying to sound preachy, CFN, for I don't know if you wrote sloppy code because you wanted to, or, more likely, because you were rushed and your superiors favored quantity of quality.
That had be laughing outloud! Being a web developer, I have often had to work with code that tried to do many, many thing. One web page would try to accomplish thirty different things, based solely upon the querystring parameters passed in. Ugh. Now there's job security! :)
I think it was ignorant of Infoseek/Disney to choose the name Go, especially since there was already Goto.com, who got the stock name GOTO, while the GO network still uses Infoseek's symbol, SEEK.
What's really neat is that it shows the importance of the Internet- not that anyone who reads Slashdot questions the role of the Internet in business, government, and personal use- but it's neat to see that controlling the Internet and an enemies computer networks as viewed as important as controlling an enemies land, sea, and airspace.
That's kind of what I had thought, how I had interpretted it. Have a great day.
Thank you for your analysis and explanation.
One thing the article pointed out was that Microsoft was in the wrong for selling two nearly identical versions of NT. One being the Server version, and the other being the Workstation version. The Server version costs considerably more, even with the Workstation version being identical, less a few registry settings to impare its functionality. The author makes a big point of this, saying that Microsoft really has no right to do this. My question: isn't this identical to a chip maker producing chips that all run the same speed, then limiting some to run slower, and selling them for less? Where's the difference, and why is the author making such an outcry against Microsoft doing this?
Uh, no. First off all, I have an infinite number of digits from pi to choose from. Furthermore, say I choose to have my password be 10 characters, then there are 10^10 possible passwords, since each character can contain one to ten digits...
And what happens when China takes back Taiwan? Will Microsoft still be allowed to run the Internet there, now with Linux as the official Chinese OS? :)
Have a great day...
Choose some random number of consecutive PI digits starting at some random place in PI. At the end of every week, repeat process.
Don't think the above will work, exactly. At least not create a fork bomb. fork() returns two different values - the parent receives the process ID of the child, the child receives 0. So, what will happen here? The parent will call fork(), a child process will be created. The child will have fork() return 0, so the while loop will terminate. The parent will infinitely keep creating children, but the chirldren will keep killing themselves. Fraid you got an infinite loop there, not a fork bomb.
Also am wondering about the first one:
main(){fork();fork();}
In fact, enter that, compile it, run it, and your program will terminate. :) A total of three children processes will be created, but only one of the three will create another child process, and it will only create one child process at that, which will not create its own child process.
Your other, two, however, look valid.
Happy Programming! :)
They should build a super computer and have it run all the time calculating pi, just to see if eventually it terminates or starts repeating... :)
Who cares about correct pronunciation. Language is malleable and based upon the whims of society as a whole. New worlds enter and leave the vernacular daily. If enough people pronounce it line-ux, then that is how it will be pronounced. Personally, I call it line-ux. I think lynn-ux just sounds funny.
Isn't the Tower of Babel a Biblical story, where the tower allowed everyone to understand each others' languages? I thought this was bad, leading to mass wars and such. Hmmm, hope this device isn't a tool of Satan. What OS did you say it ran? :)
Seriously, though, it would be intersting to see the code for those sims. What kind of calculations they are performing that require such super computers.
I wish they'd list what the Top 500 supercomputer machines were doing, what kind of mathematical computations they had them working on.
That's the fewest number of characters I could find to run a fork bomb. Can anyone out there beat that? :)
Is he taking his money out of the bank? I've contemplated the idea... figure worst case is I loose a month or two's interest...
It only takes a small group of people to start wiggin' out before the whole nation will be going crazy. How many folks have to run to the bank to get all of their money before we have a run on the banks which requires governmental intervention? Interesting, it should be fun!
I tell you, the neatest place to be would be Times Square, especially if something went wrong. Imagine if the power went out across the country when Y2K hit (not likely, I know). Anyway, could you imagine being there in Times Square along with tens of millions of others? 5-4-3-2-1... total darkness. Tee hee!
I wonder how many /.'ers use Windows or Linux or some other OS. I would assume this has been a past poll?
Uh... no. Read the article... it says the university only looked at files that were publically shared out in the students' computers. Also, files that were placed on the Web from CMUs servers were checked.
If you don't want to get busted, don't publically share out illegal material. And for God's sake, don't put it on the Net.
The real humor, though, is that for these students to get their accounts back, they have "to attend a 90-minute class on copyright rules." Hehe, that is funny. :)
I think it is near the character limit too, I'll work on reducing it. All the sig does, basically, is output all of the primes = a - 1.
It only works with gcc, since there is a dynamic array. Could fix that by using #define a 256, but I was trying to munch it down to as few characters as possible.