Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Not very hard (Score 1) 179

/Users/morten/Project/Sudoku> time sudoku worlds_hardest.sudoku
|8 1 2|7 5 3|6 4 9|
|9 4 3|6 8 2|1 7 5|
|6 7 5|4 9 1|2 8 3|
|1 5 4|2 3 7|8 9 6|
|3 6 9|8 4 5|7 2 1|
|2 8 7|1 6 9|5 3 4|
|5 2 1|9 7 4|3 6 8|
|4 3 8|5 2 6|9 1 7|
|7 9 6|3 1 8|4 5 2|

real 0m0.083s
user 0m0.073s
sys 0m0.003s

Comment Re:Avoid UML, unit testing, instant messaging, Git (Score 1) 239

You're almost right, but the main problem is when a team gets obsessed with other issues than actually writing code. You want as little time as possible to be spent on debugging and rewriting. In order to achieve that you need some tools. To avoid rewriting you need some way of specifying what the software is supposed to do before actually making it. UML can be used for that, but it's not a goal in itself. To avoid endless debugging session you need tests, unit tests can be used, but I've found it far more productive to write code that has a lot of debugging code in it. Since I'm mainly writing C/C++, this will be in the form of asserts and #if DEBUG ... #endif, but the main idea is to catch errors as early as possible during program execution. In my experience it's far more productive to get dedicated testers to test end-user functionality and file bugs than to make the programmers who wrote the code write code that checks if the code they wrote did what they thought it should do. The reason is that most bugs occur because the programmers who wrote the code failed to consider some particular corner case when they wrote the code, and they will likewise fail to write a test to test it...

In conclusion, the primary goal is to develop a product, not to write tests, not to make specifications and not to make clean revision histories. However, when used right, specifications, testing and version control enables you to develop the product faster and with higher quality.

Comment Re:007087 (Score 1) 510

Yeah, C++ and Java is probably equivalent in the time it takes to solve the actual problem -- but then you spend 4 times as long debugging your C++ code because you have some weird write-past-the-end of an array or use-after-free bug that somehow works most of the time and when it goes wrong it only affects some completely unrelated piece of code from where the bug is that got it's data structures ruined. These classes of bugs can bring down novice programmers who can spend weeks trying to figure out where it's going wrong, and they just don't happen with Java or C# or Python.

Comment Re:007087 (Score 1) 510

That's just bullshit - compilers often get it wrong because of things like alias analysis and register spilling/rematerialization. Not to mention the really crappy autovectorization they do. If you really care about performance you use vector intrinsics and check the assembly output of the compiler for any obvious cockups.
There are also many programmers writing code for embedded procesors and DSPs that don't have compilers as mature as those for x86 and doesn't have any cycles to waste.

Comment Works for me: (Score 1) 753

hello.c:

#include
#include

int main(int argc, char *argv[])
{
    printf("Hello world!\n");
    return EXIT_SUCCESS;
}

hello.bat:

@ECHO OFF
SETLOCAL
CALL "%VS80COMNTOOLS%..\..\vc\vcvarsall.bat" x86
cl /MT /c hello.c
ENDLOCAL
SETLOCAL
CALL "%VS80COMNTOOLS%..\..\vc\vcvarsall.bat" amd64
link /MACHINE:x86 /LIBPATH:"%VCINSTALLDIR%\lib" libcmt.lib hello.obj
ENDLOCAL

output:

C:\Project>hello.bat
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86

Copyright (C) Microsoft Corporation. All rights reserved.

hello.c
Setting environment for using Microsoft Visual Studio 2005 x64 tools.
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Project>hello.exe
Hello world!

Slashdot Top Deals

"Protozoa are small, and bacteria are small, but viruses are smaller than the both put together."

Working...