|
Member
(04-02-2011, 11:57 PM)
|
#152
Originally Posted by Zoe:
plus often in the places where i worked we released part of the software (ie the scrapping engine) as open source.
Quote:
i'm a senior, zend certified, php developer. studying objective-c right now too. i love js when it's well done, even if i don't get to use it too often (once one of my bosses made use js server-side... that was quite an experience, and let me tell you: it doesn't really make any sense to do something like that)
Quote:
Quote:
don't really like UMLs, i actually find them pretty useless... i prefer to plan the application while drawing the db er diagram. while we do that we conceptually divide the application into it's layers (what has to be taken care from models, what from controllers and what from views) split the whole thing into smaller task, estimate times for each one of them and then each programmmer choose a task and complete it. we also do daily meetings (about 10 minutes long) in which we recap how everything is going on.
Last edited by nickcv; 04-03-2011 at 12:11 AM.
|
|
ὁ αἴσχιστος παῖς εἶ
(04-03-2011, 12:05 AM)
|
#153
Originally Posted by nickcv:
|
|
(04-03-2011, 12:13 AM)
|
#154
Originally Posted by nickcv:
|
|
Member
(04-03-2011, 12:18 AM)
|
#155
Originally Posted by Zoe:
Quote:
my 2 cents of course.
Last edited by nickcv; 04-03-2011 at 12:27 AM.
|
|
Member
(04-03-2011, 12:47 AM)
|
#156
Originally Posted by BigNastyCurve:
|
|
ὁ αἴσχιστος παῖς εἶ
(04-03-2011, 12:53 AM)
|
#157
Originally Posted by nickcv:
JavaScript has been attempted on the server side a lot in the past but those attempts failed because they were trying to shoehorn existing conventions into the language... Node is brilliant because it's playing to JavaScript's strengths, that is, the brilliance of callbacks. And it uses this not to make a traditional server, but an entirely new kind of asynchronous server. Jeeze this sounds like marketing speak... :P I haven't messed with Node a ton but I do know I agree with its philosophy. |
|
Member
(04-03-2011, 01:25 AM)
|
#158
Originally Posted by roxya:
Question about the horror stories of long hours, etc: is this purely game industry stuff you guys are talking about, or are there other industries under the umbrella of software development I should also avoid? Comment about using javascript server side: Why would you do that? Why would anyone do that? |
|
(04-03-2011, 01:25 AM)
|
#159
Originally Posted by nickcv:
|
|
Banned
(04-03-2011, 01:32 AM)
|
#163
Here's a C++ compiler issue I encountered recently.
I was trying to speed up a member function I had written. One of the issues turned out to be a simple assignment operation. Let's say the class name is Foo, and the variables are var1 and var2.
Quote:
The device I'm on doesn't have store forwarding, so no short-cuts. Just a long stall waiting for memory to be written to and then read back in. Changing it to:
Quote:
Last edited by Half and half; 04-03-2011 at 01:36 AM.
|
|
Member
(04-03-2011, 01:47 AM)
|
#164
You need comments for things like explaining some careful optimization that was made, or explaining the role of a certain class in your program. They can also be quite good for explaining an API. For example, all the Qt class references were generated from their comments. Example: QString.
Generally speaking, though, the need for a comment implies that something about your code is confusing or unclear. If you can instead make the code more sensible, do that instead. Only if clear code is not possible, leave a comment. |
|
Member
(04-03-2011, 03:23 AM)
|
#165
Originally Posted by nickcv:
Originally Posted by Slavik81:
Originally Posted by Elfforkusu:
And for the comments stuff: - Not all programming languages out there are easy to read (Perl, old RPG for example), in-code documentation is mandatory! - Well commented code will tell anyone what it is doing but never WHY!. (Complex/broken business logic requires comments) - "Witty" solutions might be elegant and efficient, but they are usually confusing at first! (Comment and brag about it!)
Originally Posted by shadowcomplex:
Funny link: http://computersight.com/programming...ing-languages/ Specially funny (LOLCODE): Code:
HAI CAN HAS STDIO? I HAS A VAR GIMMEH VAR IZ VAR BIGGER THAN 10? YARLY BTW this is true VISIBLE "BIG NUMBER!" NOWAI BTW this is false VISIBLE "LITTLE NUMBER!" KTHX KTHXBYE |
|
Cudi Lame™
(04-03-2011, 03:29 AM)
|
#166
Originally Posted by tafer:
|
|
Member
(04-03-2011, 03:52 AM)
|
#167
Originally Posted by shadowcomplex:
|
|
Member
(04-03-2011, 05:07 AM)
|
#168
Code:
static int thingToMakeItDifferent = 77;
s.m_gear += thingToMakeItDifferent;
thingToMakeItDifferent += 12;
if( thingToMakeItDifferent > 9999 )
{
thingToMakeItDifferent = 31;
}
I always shudder in fear if I have to fix a bug in some of my old code, since most of it is... well... held together by magic. To be fair, this code was usually some kind of reverse engineered file format, so it's pure guesswork and "hey, this works. I dunno why, but I'll take it!" but yeah, a few months later on, I have no bloody idea what the hell it does or how it works and I spend a few hours (if I'm lucky) cursing myself. |
|
Member
(04-03-2011, 05:29 AM)
|
#170
Originally Posted by butzopower:
It's a little tricky getting used to at first. "Writing tests sucks," you think to yourself. "How can I possibly test this?" you wonder. But once you're in the right mindset, it's actually very reassuring when you're done to know that the thing you wrote does exactly what you wanted it to do. Also, usually the standards for unit tests are a little more lax, so you can indulge yourself in goofy class names/unnecessary overloads/etc that wouldn't fly in production code. Good times all around. |
|
got my tag in the OT
(04-03-2011, 05:31 AM)
|
#171
Depends on the project/program. I like it for smaller more restrictive projects but I find at times that really you can't account for every stupid thing a user might do so it's sorta like coding with blinders on. And that's sorta where TDD sorta falls apart when compared to XP and other methodologies.
|
|
Member
(04-03-2011, 05:35 AM)
|
#172
Originally Posted by ronito:
e: Actually, I guess what we do is also similar to the XP concept as well... I'm not sure how these approaches are particularly different.
Last edited by Elfforkusu; 04-03-2011 at 05:39 AM.
|
|
brain butz
(04-03-2011, 06:04 AM)
|
#175
Originally Posted by Elfforkusu:
I've actually become accustomed to it and can't see myself doing task like projects any other way. It just makes sense from a focused/iterative approach. Glad to see others dig it. Actually, I just moved to SF yesterday, and start a job in SOMA on Monday, any GAFers work down there? |
|
Member
(04-03-2011, 06:05 AM)
|
#176
Originally Posted by butzopower:
|
|
Member
(04-03-2011, 06:49 AM)
|
#177
Originally Posted by Kalnos:
I find this more useful than writing things down and trying to code it right first time. Its also quicker for me than UML or paper. Exceptions are things which are math heavy for that I hit the paper. |
|
I've done nothing with my life except eat and fap
(04-03-2011, 08:55 AM)
|
#178
Originally Posted by rhfb:
|
|
Member
(04-03-2011, 09:19 AM)
|
#179
Originally Posted by subversus:
my project manager loved it, but i never got to use it so i cannot give you a real opinion about it. the only thing i can tell you for sure is that if you want to use ror you better do it on your own server. few hosting companies support it (kinda like postgres).
Quote:
i'm getting really tired about working in italy... we are not even recognized as a profession by the government, at the chamber of commerce we usually figure out as factory workers
Last edited by nickcv; 04-03-2011 at 11:57 AM.
|
|
brain butz
(04-03-2011, 03:18 PM)
|
#180
Originally Posted by nickcv:
|
|
Member
(04-03-2011, 03:56 PM)
|
#181
Originally Posted by butzopower:
|
|
Member
(04-03-2011, 04:03 PM)
|
#182
Originally Posted by rodvik:
This is an area where TDD excels as you write tests to ensure your requirements are met while designing how users will interact with your code. You'll want to make your tests simple as possible which leads to your design being simple and straightforward. |
|
Corporate Apologist
(04-03-2011, 04:12 PM)
|
#183
Originally Posted by Lord Cuze:
atoi(OneCharacter) returned a 2 digit number. I had no clue why. I even dug down in debug and watch line the all the input going in, and it was a one character array with a proper null character. But it would return things like 89 instead of 8 and 71 instead of 7. And it kept doing it on the same line too. I eventually had to put in a line of 'if (number > 10) number %= 10;'which should of been totally unnecessary. I blame Dev C++ and being forced to use it in one class (Which I stopped due to the Debug features being useless, and just ran the code once in it to make sure it worked) |
|
Member
(04-03-2011, 05:06 PM)
|
#184
Wow, this many people work crazy overtime?
I've been at my current job for a little over 2 years and I have yet to work even an hour of overtime. Anyway, the current task I'm on is horrible. We do ERP software and the new version is being moved over to GWT (the google web toolkit) which compiles Java into javascript. They changed how the event model works in GWT 1.7 so I've had to go through our hundreds of source files and change all the events to the new model. We also have 50+ jobs outsourced in India so I'm sure I'll have lots of wtf code to share with you guys. |
|
Banned
(04-03-2011, 06:07 PM)
|
#185
Originally Posted by Drkirby:
Was the input always one character (and positive)? If so, you could skip the atoi call and do something like:
Quote:
|
|
Member
(04-03-2011, 10:21 PM)
|
#187
Originally Posted by Drkirby:
If it's not wetware, Dev C++ still wouldn't be the problem. It'd be your version of mingw32 or whatever compiler ships with it. FWIW, I always liked Dev C++, and used it when I was a student. But the Visual Studio debugger is the best thing ever. |
|
One day I realized that sadness is just another word for not enough coffee.
(04-04-2011, 12:55 PM)
|
#188
Project due in 15 hours. Sleep? Who needs it?
I could've taken the easy way out with some simple two player thing but nooooo, I wanted to make a Blackjack table that supports up to seven players (and I chose seven only because of layout issues and because I like the number seven). And these stupid SmartFox docs aren't getting me anywhere. |
|
(04-04-2011, 01:05 PM)
|
#189
Originally Posted by BigNastyCurve:
|
|
Fafracer forever
(04-04-2011, 01:25 PM)
|
#190
Originally Posted by BigNastyCurve:
Anyway speaking of comments, and good naming conventions - back when I was young and thought myself much smarter, I used to name all my work-in progress test-code along the lines of "popo" (or some variation of thereof, being easy to type and all). This worked fine until one day I wanted to look at some stuff I wrote months ago and my source code folder looked like this: popo.pas opop.pas popo1.pas popo3.pas popopop.pas poponew.pas popoold.pas popop.pas ... |
|
Scary Euro Man
(04-04-2011, 01:40 PM)
|
#191
Originally Posted by BigNastyCurve:
The only thing that code can self-document is what it's doing. In the real world, sometimes why it's doing it needs explaining as well. In addition, well-commented code can make it easier and quicker to see what it's doing. |
|
One day I realized that sadness is just another word for not enough coffee.
(04-04-2011, 01:45 PM)
|
#192
I like variable names to be as short as possible. But I also like variable names to be descriptive and unique. Sometimes I'd start with something simple like an int width, and then I realize I need to keep track of two widths. I change them to boxWidth or mbWidth. Afterwards I realize I need to name some parameters and local variables so I use newWidth, currentWidth, oldWidth, etc etc.
Eventually this starts getting out of hand and I kind of give up on trying to keep everything nice and neat. |
|
Banned
(04-04-2011, 01:58 PM)
|
#194
I agree that some optimized code (for speed or memory) needs comment.
Sometimes people need to lay out their data in peculiar ways to improve memory access. Comments are useful to tell other codes why they're doing it that way and don't try to change it for readability. I try to write self-documenting code, but sometimes I'll add a comment just because it's easier on my eyes. It's down to personal preference at that point. |
|
Fafracer forever
(04-04-2011, 02:14 PM)
|
#195
Originally Posted by iapetus:
Speaking of which - anyone ever tried programming drunk? :) I've had a case or two of great epiphanies realizing how "unnecessary" some code I wrote sober was and happily proceeded to delete it (making the next morning hangover all the more unpleasant). |
|
Member
(04-04-2011, 09:04 PM)
|
#198
Here's something I'm looking at right now.
Code:
final SwtSimpleBindableWidget widget = (SwtSimpleBindableWidget)evt.getSource();
final Binding binding = reverseBindings.get(widget);
final BindableDataProvider dataProvider = binding.getDataProvider();
final Object source = evt.getSource();
// Avoid endless loop where a datasource changes and then the
// widget notifies the datasource it has changed endlessly
if (source != null)
{
final Object sourceOfEvent = source;
if (sourceOfEvent.equals(dataProvider))
{
// the dataProvider to be notified initiated the change
// so consume this event
return;
}
}
Code:
sourceOfEvent.equals(dataProvider) The thing is, this must have worked at some point because we're not getting infinite loops. You can also have fun wondering why they made a new Object sourceOfEvent when they already had source right there. |
|
Member
(04-05-2011, 03:06 AM)
|
#199
Originally Posted by subversus:
Originally Posted by BigNastyCurve:
Originally Posted by Andrex:
- Boring data processing with hadoop, hive, solr, etc. - Some cloud based pdf digital signing stuff While not really fun, it's way better than just doing a boring WS on PHP or coding something in C++. On my free time I like to do some more interesting stuff, like: - Finishing an indoor positioning system for a M.Sc program - Trying to finish a game in pyglet - Toying with Android and some Lego NXT to make a nemesis for my cat And now my pesonal rant, a long, long time ago I was a JavaME programmer. Sometimes instead of developing our own games we had to reskin some indian developped games to the local market (I'm not indian so the comments meant nothing and the code was a nightmare) and we even had to port that code to the unsupported handsets. It was hell.
Last edited by BomberMouse; 04-05-2011 at 04:44 AM.
|
|
Banned
(04-05-2011, 03:38 AM)
|
#200
Originally Posted by nickcv:
Recursion and iteration are always good ones to test whether people have a lizard-brain or not, you would be surprised how many coders struggle with them. For recursion I have a method which divides, floors then adds to an integer until the integer is > 10 by calling itself, and the question is "if you pass a value of 4 what will be the return value?" Also, depending on whether you use them a lot in your industry, regular-expression tests can be great for sorting the wheat from the chaff. It doesn't have to be anything too complex, but something like will testing the pattern "/^[0-9a-z]+$/" against the string "l33tsp3@k" return true or false? |