Page 1 of 2

Computer Scientists

Posted: Sat Jan 24, 2009 5:28 pm UTC
by fephisto
Computer scientists are amazing.

I remembered a story from back when I was in undergrad, and I thought I'd share.

I was a senior in mathematics and I didn't know much about programming or computing, all I really knew was enough to implement text games and do FORTRAN-esque programs on C++.

Either way, I had a class in chaos theory, and for the final project I decided to study "The effects of the Jovian orbit on O'Neil Cylinders in the L5 Earth-Sun point". So, I made this program to do the n-body solar system problem for me. I programmed it with no knowledge of algorithm efficiency, and did just what I thought would work, and it took a day for a computer I dedicated to the task in order to calculate one day with the minimal accuracy I desired. I wanted/needed at least a 100/1000 years in the simulation and would've preferred even more accuracy.

So, I had a really boring seminar, and I printed off my code to go through it during that class. I unknowingly sat down next to a computer scientist.

About halfway through the class he peers over to what I'm doing and whispers, "What's that?" And I explain to him the program I'm making, and how horribly inefficient it is. He grabs the papers away from me.

"...Notepad? You code in notepad, are you serious?"

He then starts taking out a pen and starts marking stuff, constantly shaking his head, and then he shows me his laptop, "See these? Those are comments, and those are indentations." He points at my code, "Scientist code," and then he points at his, "CS code."

He then proceeded to edit my code like an English professor grading a bad paper. The next day I was able to implement all of his suggestions.

The improvements were amazing, 10000 years became easy for the computer. You guys are awesome.

I repeat, you guys are amazing.

Re: Computer Scientists

Posted: Sat Jan 24, 2009 11:09 pm UTC
by Xanthir
For what it's worth, I program in Notepad in at least half my languages.

Re: Computer Scientists

Posted: Sun Jan 25, 2009 4:53 am UTC
by keeperofdakeys
great story

but as for notepad, I would not use it if I were on another computer without anything else; it has two MAGOR flaws:
1. It likes to buffer the ENTIRE file before opening
2. UNIX and mac line endings, what the hell are they?

wordpad would be better but still quite featureless

and now to contribute to the disscussion,

I love it when you have this horribly inefficient algorithm, you change a few things, it works much faster; but there is a lot of "WHAT AM I NOT GETTING! :x " in between time

Re: Computer Scientists

Posted: Sun Jan 25, 2009 3:15 pm UTC
by 0xBADFEED
Ah yes... "scientist code" and "engineer code" can be very bad. But it's almost expected. I mean, for the most part they don't care about "the code" they care about the problem.

When I was an undergrad I took over a code base that was written mainly by Mechanical Engineering grad students. That code filled me with murderous rage on a daily basis. Thinking back... it still makes me feel stabby.

On the flip-side though, I have seen CS code that is just as bad. And there are plenty of scientists and engineers that write solid code.

Re: Computer Scientists

Posted: Sun Jan 25, 2009 6:14 pm UTC
by You, sir, name?
Heh, as a physicist with actual programming skills, I've seen a lot of... "dubious" code. I think the main villain, at least with the current generation of scientists is matlab. Matlab is slower than molasses chilled down to 3 K at things that should in theory be fast (e.g. iteration), but positively relativistic at things that should be very slow (e.g. matrix manipulations.) Most scientists and engineers today primarily learn to program in Matlab (maybe they take some other languages as well, but they are forgotten at the moment the exam is handed in), and as such they get no feel for what is slow and what isn't.

Re: Computer Scientists

Posted: Tue Jan 27, 2009 3:51 am UTC
by Shriike
wow, this story is amazing. Not only does the CS seem like a complete jerk (just completely taking your code like that, though I'd do the same), but I'm absolutely amazed that you let your program run for a whole day. I have the patience of a gold fish, if I don't get an answer in one minute, then obviously I screwed something up so I try to improve my algorithm (that being said most of my stuff is quite inefficient still).

Re: Computer Scientists

Posted: Thu Feb 12, 2009 1:01 am UTC
by akashra
Those who code in notepad seriously need beating over the back of the head with a 2x4. It's not cool, it doesn't make you look cool, and seriously, you're just kidding yourself.

I could compare writing code with notepad to me walking to work (over taking the train). Yeah, I CAN do it if it's an absolute emergency, but if I actually want to make productive use of my time it'd be a laughable idea.

If you're going to write code, even if it's snippets, at the very least get yourself a lightweight editor.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 1:41 am UTC
by kmatzen
akashra wrote:Those who code in notepad seriously need beating over the back of the head with a 2x4. It's not cool, it doesn't make you look cool, and seriously, you're just kidding yourself.

I could compare writing code with notepad to me walking to work (over taking the train). Yeah, I CAN do it if it's an absolute emergency, but if I actually want to make productive use of my time it'd be a laughable idea.

If you're going to write code, even if it's snippets, at the very least get yourself a lightweight editor.


Hey, if you change some registry values, you can get it to display a pretty cool line number feature. :)

Re: Computer Scientists

Posted: Thu Feb 12, 2009 2:36 pm UTC
by Xanthir
akashra wrote:Those who code in notepad seriously need beating over the back of the head with a 2x4. It's not cool, it doesn't make you look cool, and seriously, you're just kidding yourself.

I could compare writing code with notepad to me walking to work (over taking the train). Yeah, I CAN do it if it's an absolute emergency, but if I actually want to make productive use of my time it'd be a laughable idea.

If you're going to write code, even if it's snippets, at the very least get yourself a lightweight editor.

I write Lisp in an IDE. There's no way in hell I'm matching parens myself.

I write my html/css/js in notepad (well, in editpad, but it's just a slightly more advanced editor, not even to notepad++ levels). However, my browser itself counts as an IDE in this case, as the Firebug extension, and a few others, do everything I would ever need.

The only thing that I genuinely hack at without an IDE is PHP, and I've never had to do anything complex enough to *want* an IDE for it.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 3:46 pm UTC
by Emu*
Substitute something like kwrite, gedit or winsyntax for notepad, and you've got a more up-to-date story... Even the most lightweight of editors can do line numbers, code folding, code colouring, indent handling and parens-matching (highlighting the other half of the bracket-pair). More features than this and you've got a Luxury Editor :wink:

Re: Computer Scientists

Posted: Thu Feb 12, 2009 4:47 pm UTC
by quintopia
Annnnd now this thread belongs in Religious Wars.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 6:24 pm UTC
by ash.gti
o m g giaz notepad pwns NE ting cuz u n33d skillz to skript kitty w/o an IDE

oh, an I don't own a copy of windows... so... If I only use a Terminal does that make me more sauce leet than the notepad fellows?

Re: Computer Scientists

Posted: Thu Feb 12, 2009 6:37 pm UTC
by joeframbach
kmatzen wrote:Hey, if you change some registry values, you can get it to display a pretty cool line number feature. :)
No need to muck with the registry. "Status Bar" is under the View menu.

ash.gti wrote:o m g giaz notepad pwns NE ting cuz u n33d skillz to skript kitty w/o an IDE

oh, an I don't own a copy of windows... so... If I only use a Terminal does that make me more sauce leet than the notepad fellows?
Only if you echo the entirety of your code and > it to a file. Then you can be more sauce leet.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 7:47 pm UTC
by Berengal
Notepad doesn't hold a candle to ed.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 8:33 pm UTC
by Yakk
Berengal wrote:Notepad doesn't hold a candle to ed.

ITYM edlin

;)

Real programmers edit text documents by using control sequences to echo a binary program to a file manually that does the required transformation of the text.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 10:44 pm UTC
by kaitou
Try being a CS adviser: you need to tell the students what's wrong with their code without telling them how to do it; they're in school to learn how to do this stuff, not to have you do it for them.

One extra talent I have that was helpful is the ability to read upside-down. This meant that they didn't have to turn the printout sideways and both of us sit funny and crane our necks to read it. Also, first year CS code looks better upside-down than right-side-up.

Re: Computer Scientists

Posted: Thu Feb 12, 2009 10:51 pm UTC
by Yakk
...so long as you aren't trying to debug a regex!

Re: Computer Scientists

Posted: Fri Feb 13, 2009 2:20 am UTC
by phlip
quintopia wrote:Annnnd now this thread belongs in Religious Wars.

It already is...

Re: Computer Scientists

Posted: Fri Feb 13, 2009 4:18 am UTC
by quintopia
case and point

Re: Computer Scientists

Posted: Fri Feb 13, 2009 10:06 pm UTC
by Emu*
quintopia wrote:case in point


fix'd.

Re: Computer Scientists

Posted: Mon Feb 16, 2009 9:18 pm UTC
by quintopia
i said what i meant, but go ahead and fix things that aren't broken if it makes you happy.

Re: Computer Scientists

Posted: Fri Feb 27, 2009 3:14 pm UTC
by Logan
To be that good you really need a head for it. i could never be that good at programming. It takes me time to develop even a simple program

Logan

Re: Computer Scientists

Posted: Fri Feb 27, 2009 4:18 pm UTC
by Mach1ne
I wouldn't use notepad if you're planning to bring it into something like vim or emacs at some point, you get some weird symbols, slashes and just general awkward formatting.

Re: Computer Scientists

Posted: Fri Feb 27, 2009 4:23 pm UTC
by Berengal
s/\r\n/\n/g should fix that.

Re: Computer Scientists

Posted: Fri Feb 27, 2009 5:18 pm UTC
by Qoppa
After editing a file, with gedit and then vim, I had to run :%s/^M//g on the file. ^M as in, C-v C-m. Is that \r?

Re: Computer Scientists

Posted: Fri Feb 27, 2009 6:06 pm UTC
by Berengal
'\r'|0x40 = 'M', so I'd guess so.

Re: Computer Scientists

Posted: Mon Mar 02, 2009 1:32 am UTC
by Dani
I'm not a computer scientist, but that is what I am heading to university to be. I've only taken some on-line course through my highschool. Which taught me some basic... um... BASIC. Right now I'm doing a java course where they force you to use notepad (obviously not really, it's a distance ed class, they can't control what you do). I think using notepad is good for learning. Although tedious, it's better than using an IDE as a crutch.

Re: Computer Scientists

Posted: Mon Mar 02, 2009 7:56 pm UTC
by achan1058
Dani wrote:Right now I'm doing a java course where they force you to use notepad (obviously not really, it's a distance ed class, they can't control what you do). I think using notepad is good for learning. Although tedious, it's better than using an IDE as a crutch.
I disagree. Notepad is seriously about the worst thing you can use for programming. Even if it is a 20 line program I would not use notepad, since it lacks even syntax highlighting. Anything over a couple hundred of lines and an IDE is pretty much necessary, unless you are some sort of programming genius. Try managing 20 files and 100 functions and you will see what I mean.

Re: Computer Scientists

Posted: Mon Mar 02, 2009 8:08 pm UTC
by Yakk
Bah, you don't need syntax highlighting. It is useful, but it doesn't generate that much of a productivity boost.

And finding functions works reasonably well with grep. :)

Re: Computer Scientists

Posted: Mon Mar 02, 2009 8:11 pm UTC
by Dani
achan1058 wrote:
Dani wrote:Right now I'm doing a java course where they force you to use notepad (obviously not really, it's a distance ed class, they can't control what you do). I think using notepad is good for learning. Although tedious, it's better than using an IDE as a crutch.
I disagree. Notepad is seriously about the worst thing you can use for programming. Even if it is a 20 line program I would not use notepad, since it lacks even syntax highlighting. Anything over a couple hundred of lines and an IDE is pretty much necessary, unless you are some sort of programming genius. Try managing 20 files and 100 functions and you will see what I mean.


Ah, tell that to my comp sci teacher... It certainly is a pain to use notepad, but I just feel when an error happens and I have to go look for it and I find and fix it, I've learned a little more than if the mistake was made obvious. I think it's good to start learning with, but if I was making a long program I would tear my eyeballs out using it. Luckily, the course isn't particularly difficult so it isn't much of a problem.

Re: Computer Scientists

Posted: Mon Mar 02, 2009 8:11 pm UTC
by Brooklynxman
For 2 years in my hs course we used something called textpad. It was like notepad, on steroids, times a thousand.

Its what made java bearable. That, and it was the only thing I could program and I didnt have experience to realize exactly how shitty it really was.

Re: Computer Scientists

Posted: Mon Mar 09, 2009 2:36 am UTC
by Quizatzhaderac
I like to use notepad++ when I doing small amounts of coding. It has a lot of lightwieght features (highlighting, folding, regex replacement), supports the 40 most common languages, and loads qucikly. I find it to actually be quicker to download, install, and open notepad++ then to open eclipse/ netbeans/ VisualStudio.

Re: Computer Scientists

Posted: Tue Mar 10, 2009 8:45 pm UTC
by Indon
akashra wrote:I could compare writing code with notepad to me walking to work (over taking the train). Yeah, I CAN do it if it's an absolute emergency, but if I actually want to make productive use of my time it'd be a laughable idea.


To continue the analogy, walking is healthy for you. Of course, it really depends on how long the walk is.

My dad's written some perl and VBA scripts in the course of his work (civil engineer). I should take a look at some of the stuff he's done and we can compare notes.

Re: Computer Scientists

Posted: Tue Mar 10, 2009 11:17 pm UTC
by diotimajsh
Notepad 2 is a pretty nice lightweight text editor too. I understand it's a lot like Notepad++, don't really know how they compare in the specifics though.

Re: Computer Scientists

Posted: Wed Mar 11, 2009 7:46 am UTC
by keeperofdakeys
diotimajsh wrote:Notepad 2 is a pretty nice lightweight text editor too. I understand it's a lot like Notepad++, don't really know how they compare in the specifics though.

This covers the basics

Re: Computer Scientists

Posted: Wed Mar 11, 2009 1:47 pm UTC
by Tac-Tics
Notepad is pretty crappy. But a *good* plain text editor is the swiss army knife of programmers. As long as you have your compiler and debugger separate, all you need to be able to do is enter text.

Re: Computer Scientists

Posted: Wed Mar 11, 2009 3:11 pm UTC
by Will
Real programmers use ed.

Re: Computer Scientists

Posted: Wed Mar 11, 2009 3:53 pm UTC
by Shriike
Will wrote:Real programmers use ed.

Real programmers use butterflies.

Re: Computer Scientists

Posted: Fri Mar 13, 2009 5:25 am UTC
by aleflamedyud
Shriike wrote:
Will wrote:Real programmers use ed.

Real programmers use butterflies.

Real programmers need not use such primitive devices. A real programmer speaks, thinks, and so the code is. Everyone knows the first words of the first Real Programmer: Let there be light!

Re: Computer Scientists

Posted: Fri Mar 13, 2009 6:09 am UTC
by Shriike
aleflamedyud wrote:Everyone knows the first words of the first Real Programmer: Let there be light!

you know it occurs to me, is it blasphemous to compare God to a programmer or just a really good analogy?