PDA

View Full Version : Any skilled programmers (or people who use R)?



champagne supernova
07-15-2011, 04:56 PM
Okay, so I'm working on my Masters. Basically I am using a statistical program called R (well, it's technically a programming language based on S, I think). Anyway, it is perfect for my task because I don't need an UI and I need it to do a lot of iterations of things. But, because of the number of iterations, the code is very slow (there's basically one aspect that is slowing it down). If anybody uses this program or has some coding knowledge, could they maybe help me with the design of the loop (R has some of the worst syntax ever, so if you aren't using it, probably pointless to post the code).

On an unrelated note, I might be doing the back-end of a web application for a company. The front-end will be programmed by someone who knows web design (phew), but he might want it be coded in a language besides VB or R (which are the two I know at the moment). How hard are languages like C# and Java to learn? Would anyone like to teach me (I want to learn them anyway).

Flying Mullet
07-15-2011, 05:06 PM
Post some pseudo-code of your program you're trying to optimize.

champagne supernova
07-15-2011, 05:21 PM
Can I maybe explain what I'm trying to do rather than write up pseudo-code (it's like 155 lines at the moment)? So pseudo English code

Flying Mullet
07-15-2011, 05:46 PM
Go for it.

champagne supernova
07-15-2011, 06:40 PM
Go for it.

Think I found a way around it. Before I was recalculating an entire correlation table for an entire period, bit by bit (so I'd do it with 120 points, then 121 etc etc), but I realised I only actually need the last set of data for the model to select itself. As that loop was within another loop, that's where it was slowing down, so removing it will speed everything up.

On the other note, do you have experience in Java or C# or one of the more modern languages? Think it wouldn't harm me to learn, but obviously it needs to know what the reward is like compared to the effort.

Flying Mullet
07-15-2011, 10:24 PM
I'm a Java programmer, but my college education was in C++. Both languages have their pros and cons. C++ is a much more robust language but you can shoot yourself in the foot a lot easier with pointers and memory management. Java, on the other hand, doesn't offer quite as much flexibility but it does "protect" the developer more. Honestly, I would say learn C++ and then Java. This way you will understand more of what's happening under the hood that Java sometimes shields you from.

Either way, you can't go wrong learning one or the other, unless you're interested in a company of field that favors one, in which case go with that one.