|
Post by echnaret on Sept 23, 2011 2:49:30 GMT
What is the biggest project you've worked on, so far? What is something you learned from it? The project can be on you worked on by yourself, in a group, and/or for class. Specifically, I'm referring to coding-related projects. For one of my computer science classes in college, we worked in teams on a program that told users to create a method that completed a simple task, and then tested their code to verify its correctness. It was based on an existing website, though what it was escapes me at the moment. Anyways, the project happened in three phases. For the first phase, we worked on basic functionality. Different parts were divided up to different people. For the second phase, we had to work by ourselves take the code from phase one, and add support for a second language. For the third phase, the groups came back together, added one person's language support from phase two into the program from phase one, and added a few additional features. One of the difficult things for me was taking code that someone else worked on, and trying to understand it enough to modify it myself. Everyone has different styles and conventions they use, and it takes a little while to understand what they did and why they did it. That project also showed the importance of documenting everything. Documenting your code was also important for the third phase. The project spanned the whole semester, which gave you plenty of time to forget the reasoning behind undocumented features. How about you? What is the biggest coding project you've worked on so far, and what (if anything) have you taken away from it?
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Sept 23, 2011 3:27:06 GMT
I've made quite a few codes, though I have to say none of them are really complete! I am not the best at finishing them. I have learned a lot though. Most of the PHP I know is from trial and error working with projects. I am no longer scared by an error message (most of them anyways) I am learning Python, and I figured I'd be better off than making a simple calculator. I am making a game. It's called series, and you start with a number, and the program will ask you to do things with the number (in your head), and at the end of the 10 rounds, you are prompted to enter the correct number. The hardest part is making a good AI so you don't end up with ridiculous numbers But that's how I learn, even if I don't complete the project, but trial and error is the biggest thing I take away from coding.
|
|
xcessive
Epic Poster
.[M:5000]
Posts: 526
|
Post by xcessive on Sept 23, 2011 5:03:22 GMT
I've worked on large time critical server software with a small team. I have worked on large web apps with a team of 10+ people. I have worked on several projects in University with a few others, currently I am working on a small OS as a university project with another guy, and a game engine with 3 others.
Most of all I have realized that most people write really poorely optimized code and abuse OOP way too much.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Sept 23, 2011 10:09:38 GMT
Ive never worked on anything big, been brainstorming ideas though
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Sept 23, 2011 17:45:24 GMT
The biggest project that I've physically worked on was an enterprise web application that I worked on during my internship, but it was the last project I started on so I didn't get much done. I've also worked on modding the Source Engine which required hours of studying the code to make modifications and to get the server and client compiled.
The largest project I've coded from scratch would be my SDL C++ library which I use to create games. I'm also starting on a huge project with two friends which will be a website that will hopefully make us some cash.
"Most of all I have realized that most people write really poorely optimized code and abuse OOP way too much." This is very true, and, in fact, I have a hilarious story that relates to this.
One of my friends did an internship this summer at a smaller company that only had one programmer who had written a program which took 65 hours to run. Because of this, they had to have somebody be at the computer at all times when the program was running in case it started spitting out errors (it was a validation program), and so if you do the math it was costing the company over 35,000 dollars a year to pay someone to sit there while it ran. When my friend got hired on as an intern to help out, the programmer there had to tell him about this program since it was one of their main applications, and how it worked etc. My friend instantly realized that there was no reason why it should be taking 65 hours to execute, and so he rewrote the application when the other guy was away, and got it to execute in less than 0.5 seconds.
The CEO had both of them come to his office and explain how their programs worked. After my friend explained how his worked and why the other one was so slow, the CEO told the other guy right then and there to get his things and leave. So basically my friend became the IT department of this company during his first week as an intern. The company makes good money too even though they are small.
I don't know all the details of the application, but basically this program had to validate a set of numbers (I think account numbers) that were read from one group of files with another set of numbers that were read from another group of files. This "programmer" created an array that could hold a billion integers so he could insert the account numbers found in the first set of files into the array by indices (array[accountNumer] = accountNumber). LOL. So this program was instantly consuming 3.7 Gigabytes of memory, and most of this memory was being completely wasted since he was only using the end of the array since most or all of the account numbers were the same length.
It only gets worse.
He then sorted the entire array of a billion integers with bubble sort to get the account numbers at the beginning of the array in sorted order. LOL. When he read in the other set of account numbers from the other group of files to do comparisons, he would do a linear search O(n) on the array to search for the number. He should have just left the numbers where they were so he could check in O(1) time.
My friend simply used a hash table in Perl and made a few other optimizations to get it to execute in 0.5 seconds.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Sept 23, 2011 19:18:37 GMT
The biggest project that I've physically worked on was an enterprise web application that I worked on during my internship, but it was the last project I started on so I didn't get much done. I've also worked on modding the Source Engine which required hours of studying the code to make modifications and to get the server and client compiled. The largest project I've coded from scratch would be my SDL C++ library which I use to create games. I'm also starting on a huge project with two friends which will be a website that will hopefully make us some cash. "Most of all I have realized that most people write really poorely optimized code and abuse OOP way too much." This is very true, and, in fact, I have a hilarious story that relates to this. One of my friends did an internship this summer at a smaller company that only had one programmer who had written a program which took 65 hours to run. Because of this, they had to have somebody be at the computer at all times when the program was running in case it started spitting out errors (it was a validation program), and so if you do the math it was costing the company over 35,000 dollars a year to pay someone to sit there while it ran. When my friend got hired on as an intern to help out, the programmer there had to tell him about this program since it was one of their main applications, and how it worked etc. My friend instantly realized that there was no reason why it should be taking 65 hours to execute, and so he rewrote the application when the other guy was away, and got it to execute in less than 0.5 seconds. The CEO had both of them come to his office and explain how their programs worked. After my friend explained how his worked and why the other one was so slow, the CEO told the other guy right then and there to get his things and leave. So basically my friend became the IT department of this company during his first week as an intern. The company makes good money too even though they are small. I don't know all the details of the application, but basically this program had to validate a set of numbers (I think account numbers) that were read from one group of files with another set of numbers that were read from another group of files. This "programmer" created an array that could hold a billion integers so he could insert the account numbers found in the first set of files into the array by indices (array[accountNumer] = accountNumber). LOL. So this program was instantly consuming 3.7 Gigabytes of memory, and most of this memory was being completely wasted since he was only using the end of the array since most or all of the account numbers were the same length. It only gets worse. He then sorted the entire array of a billion integers with bubble sort to get the account numbers at the beginning of the array in sorted order. LOL. When he read in the other set of account numbers from the other group of files to do comparisons, he would do a linear search O(n) on the array to search for the number. He should have just left the numbers where they were so he could check in O(1) time. My friend simply used a hash table in Perl and made a few other optimizations to get it to execute in 0.5 seconds. Good on your friend! I bet that other guy was annoyed!
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Sept 23, 2011 19:48:14 GMT
Yeah, it was very good for my friend cause the CEO loves him now haha. This is why it's important to learn how to write efficient algorithms and to know about a wide variety of data structures so you can use the right tools for the job.
|
|
xcessive
Epic Poster
.[M:5000]
Posts: 526
|
Post by xcessive on Sept 24, 2011 0:43:09 GMT
Reading this:
I was thinking, "sigh, classic moron IT guy, but nothing too out of the ordinary".
Then I read this:
And literally laughed out load.
Then this:
What the hell was the point of the sort?! (I was starting to get angry now).
Man, that is perhaps the funniest and most shocking story I have heard in a while. The place I currently work I though had poor coding. Now I count myself lucky.
I'm not sure if i completely understand the problem/solution, but your friend might be able to cut that back in memory and time use even more by using a bitset for account numbers.
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Sept 24, 2011 3:11:26 GMT
Haha, yeah this guy didn't know what the hell he was doing. My friend said he was more of a hardware guy who somehow got a software job cause he knew a little bit of C and Perl. Since the company is rather small and doesn't have any other technical people around, they probably just thought he was really smart and knew what he was doing. I don't think he even knows what a hash table is, though. This is definitely one of the worst cases cause at my job there wasn't any terrible code like this. You'd get fired instantly.
And I honestly forgot a lot of details about the problem; my friend didn't really explain it too well. He was just laughing really hard at the horrible stuff like bubble sort which is fucking hilarious. And I'm sure it could be optimized even more, but there's no reason to since it executes so quickly now.
|
|
|
Post by echnaret on Sept 24, 2011 5:01:22 GMT
Code optimization is definitely something I have to work on. I vaguely remember learning a bit about O(1), O(n) in one of my comp sci classes, but I definitely could use a refresher. Time to dig out the old comp sci text books...
|
|
xcessive
Epic Poster
.[M:5000]
Posts: 526
|
Post by xcessive on Sept 24, 2011 5:28:27 GMT
Code optimization is definitely something I have to work on. I vaguely remember learning a bit about O(1), O(n) in one of my comp sci classes, but I definitely could use a refresher. Time to dig out the old comp sci text books... Its a way of expressing the growth time, and hence performance of an algorithm. Its called big O notation and it means that the given algorithm grows "of the order of" what is defined, usually in its worst case scenario (slowest possible running time). So for example say you have a search that goes through all the items in an array (linear or exhaustive search) this is O(n) since it grows the same way the equation n does. That is - the time take grows linearly with n where n is the number of items in the array. O(1) means constant time, since no matter what its growth rate is constant, ie. 1. Another typical example is bubble sort, which has a loop within a loop, each going through (more or less) the items in the array. Thus for each item in the array you are going through all the items in the array and hence it is O(N^2). Binary search is a good one, it is O(log n) since you halve the search space every recursive step, and thus it grows only when you double the search space, and thus it grows the same way log n does where n is the number of items in the array.
|
|