Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Comment: Re:Check their work or check the summary? (Score 1) 486

by sanosuke001 (#49337249) Attached to: No, It's Not Always Quicker To Do Things In Memory
This is exactly why Java has a StringBuilder class.

final long startTimeBad = System.nanoTime()
String s = ""

for(int i = 0 i s += (char)Math.floor(Math.random() * 256)

final long endTimeBad = System.nanoTime()
System.out.println("bad: " + (endTimeBad - startTimeBad) + " ns")

final long startTime = System.nanoTime()
final StringBuilder sb = new StringBuilder()

for(int i = 0 i sb.append((char)Math.floor(Math.random() * 256))

final long endTime = System.nanoTime()
System.out.println("good: " + (endTime - startTime) + " ns")

System.out.println("diff: " + (endTimeBad - startTimeBad) / (double)(endTime - startTime))

bad: 399644443512 ns
good: 76023788 ns
diff: 5256.834130811792

Note: semicolons removed because yay slashdot comments

Comment: Graphics Card - Software Support (Score 1) 307

Out of all hardware I've used, I've had the most trouble with graphics cards; not with installing them or having them fail but with them being properly supported by their manufacturers in the OS I'm using and by the OS I'm using not adversely interacting with their drivers. All other pieces of hardware have very specific software interfaces and most use a generic driver or a very stable driver comes with the OS. Graphics Cards are the biggest pain in the ass out of all pieces of hardware.

Comment: Re:Java dynamically typed languages (Score 1) 648

by sanosuke001 (#48865489) Attached to: Justified: Visual Basic Over Python For an Intro To Programming
I completely disagree. Dynamic typing makes keeping track of what you're doing more difficult; at least for a beginner. If they don't understand the difference between a string, an "object", and a numerical value (which is confusing itself) then they cannot be an effective programmer. Also, writing more code and being demanding aren't what I would define as being a additional bonus you get for using a dynamically typed language. You write more code because it doesn't work well and you need to fight with the language more than use it. Also, the dynamically typed aspect makes it more demanding the same way driving with your eyes closed makes driving more demanding; it is not helping you in any way shape or form.

Java's "syntactic clutter" I call "helpful verbosity" and most scripting-turned-application languages are sorely lacking in readability; something Java has been getting better at in recent years. Java forces readability and corectness more than most scripting languages I've ever used, at least. Structure is more beneficial to a beginner than freedom.

Comment: Java dynamically typed languages (Score 1) 648

by sanosuke001 (#48856427) Attached to: Justified: Visual Basic Over Python For an Intro To Programming
Stop using dynamically typed languages altogether. Java is much more C-like than python or VB and can be used to teach most of what C can do in a relatively painless fashion. Kids aren't stupid; stop trying to dumb things down for them. Java handles memory allocation and other object-creation issues that might hamper someone learning a programming language while still containing classes, abstraction, inheritance, and a typed object/primitive hierarchy that will do a lot more to teach students about programming than confusing them with "hey this can be a number or a string or a pig object." Java also has many IDE's (Eclipse and NetBeans mainly) that help with the memorization issue in most API's and are very useful when learning. Compiling is much easier than in C as well but still retains the items necessary for understanding how compiling should work.

Comment: Re:Why..... (Score 1) 259

by sanosuke001 (#48158367) Attached to: "Double Irish" Tax Loophole Used By US Companies To Be Closed
I completely agree. I wasn't trying to say how it should be, just how law defined how they decided what you owed. If you have no profits locally you owe nothing. The "see-no-profits" game is a completely different bullshit loophole. They should get rid of income tax and increase sales/property tax to compensate or use something like the APT tax.

Comment: Dislike != Distrust (Score 2) 238

I would say that they distrust it, not dislike. It is also expensive to implement over something that has been used for decades and since they see things more short term than long term, the savings aren't seen so upgrading is deemed not worth the cost and training.

If you suspect a man, don't employ him.