Computer Scientists

A place to discuss the science of computers and programs, from algorithms to computability.

Formal proofs preferred.

Moderators: phlip, Moderators General, Prelates

fephisto
Posts: 30
Joined: Fri Sep 14, 2007 5:11 pm UTC
Location: INDIANA....(whoo!)
Contact:

Computer Scientists

Postby fephisto » Sat Jan 24, 2009 5:28 pm UTC

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.
Delanda est Carthago.

Keynsianomics is a ponzi scheme.

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Computer Scientists

Postby Xanthir » Sat Jan 24, 2009 11:09 pm UTC

For what it's worth, I program in Notepad in at least half my languages.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

keeperofdakeys
Posts: 658
Joined: Wed Oct 01, 2008 6:04 am UTC

Re: Computer Scientists

Postby keeperofdakeys » Sun Jan 25, 2009 4:53 am UTC

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

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Computer Scientists

Postby 0xBADFEED » Sun Jan 25, 2009 3:15 pm UTC

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.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Computer Scientists

Postby You, sir, name? » Sun Jan 25, 2009 6:14 pm UTC

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.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

Shriike
Posts: 127
Joined: Mon Jan 26, 2009 3:27 am UTC
Location: Ohio

Re: Computer Scientists

Postby Shriike » Tue Jan 27, 2009 3:51 am UTC

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).
Image

akashra
Posts: 503
Joined: Tue Jan 01, 2008 6:54 am UTC
Location: Melbourne, AU
Contact:

Re: Computer Scientists

Postby akashra » Thu Feb 12, 2009 1:01 am UTC

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.
( find / -name \*base\* -exec chown us : us { } \ ; )

kmatzen
Posts: 214
Joined: Thu Nov 15, 2007 2:55 pm UTC
Location: Ithaca, NY

Re: Computer Scientists

Postby kmatzen » Thu Feb 12, 2009 1:41 am UTC

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. :)

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Computer Scientists

Postby Xanthir » Thu Feb 12, 2009 2:36 pm UTC

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.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Emu*
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK
Contact:

Re: Computer Scientists

Postby Emu* » Thu Feb 12, 2009 3:46 pm UTC

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:
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!

User avatar
quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Computer Scientists

Postby quintopia » Thu Feb 12, 2009 4:47 pm UTC

Annnnd now this thread belongs in Religious Wars.

User avatar
ash.gti
Posts: 404
Joined: Thu Feb 07, 2008 1:18 am UTC
Location: Probably a coffee shop.

Re: Computer Scientists

Postby ash.gti » Thu Feb 12, 2009 6:24 pm UTC

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?
# drinks WAY to much espresso

joeframbach
Posts: 1478
Joined: Sun Nov 05, 2006 12:49 am UTC

Re: Computer Scientists

Postby joeframbach » Thu Feb 12, 2009 6:37 pm UTC

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.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Computer Scientists

Postby Berengal » Thu Feb 12, 2009 7:47 pm UTC

Notepad doesn't hold a candle to ed.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Yakk
Poster with most posts but no title.
Posts: 11129
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Computer Scientists

Postby Yakk » Thu Feb 12, 2009 8:33 pm UTC

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.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

User avatar
kaitou
Posts: 118
Joined: Fri Oct 31, 2008 4:56 pm UTC
Location: In the dark, digital recesses of your mind.
Contact:

Re: Computer Scientists

Postby kaitou » Thu Feb 12, 2009 10:44 pm UTC

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.

User avatar
Yakk
Poster with most posts but no title.
Posts: 11129
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Computer Scientists

Postby Yakk » Thu Feb 12, 2009 10:51 pm UTC

...so long as you aren't trying to debug a regex!
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

User avatar
phlip
Restorer of Worlds
Posts: 7573
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Computer Scientists

Postby phlip » Fri Feb 13, 2009 2:20 am UTC

quintopia wrote:Annnnd now this thread belongs in Religious Wars.

It already is...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Computer Scientists

Postby quintopia » Fri Feb 13, 2009 4:18 am UTC

case and point

User avatar
Emu*
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK
Contact:

Re: Computer Scientists

Postby Emu* » Fri Feb 13, 2009 10:06 pm UTC

quintopia wrote:case in point


fix'd.
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!

User avatar
quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Computer Scientists

Postby quintopia » Mon Feb 16, 2009 9:18 pm UTC

i said what i meant, but go ahead and fix things that aren't broken if it makes you happy.

User avatar
Logan
Posts: 37
Joined: Sat Feb 21, 2009 1:45 am UTC

Re: Computer Scientists

Postby Logan » Fri Feb 27, 2009 3:14 pm UTC

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

User avatar
Mach1ne
Posts: 35
Joined: Tue Feb 24, 2009 5:20 pm UTC
Location: This exact location but 3 minutes from now

Re: Computer Scientists

Postby Mach1ne » Fri Feb 27, 2009 4:18 pm UTC

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.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Computer Scientists

Postby Berengal » Fri Feb 27, 2009 4:23 pm UTC

s/\r\n/\n/g should fix that.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Qoppa
Posts: 694
Joined: Sat Nov 24, 2007 9:32 pm UTC
Location: Yes.

Re: Computer Scientists

Postby Qoppa » Fri Feb 27, 2009 5:18 pm UTC

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?

Code: Select all

_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Computer Scientists

Postby Berengal » Fri Feb 27, 2009 6:06 pm UTC

'\r'|0x40 = 'M', so I'd guess so.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

Dani
Posts: 24
Joined: Sun Mar 01, 2009 5:00 pm UTC

Re: Computer Scientists

Postby Dani » Mon Mar 02, 2009 1:32 am UTC

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.

achan1058
Posts: 1783
Joined: Sun Nov 30, 2008 9:50 pm UTC

Re: Computer Scientists

Postby achan1058 » Mon Mar 02, 2009 7:56 pm UTC

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.

User avatar
Yakk
Poster with most posts but no title.
Posts: 11129
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Computer Scientists

Postby Yakk » Mon Mar 02, 2009 8:08 pm UTC

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. :)
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Dani
Posts: 24
Joined: Sun Mar 01, 2009 5:00 pm UTC

Re: Computer Scientists

Postby Dani » Mon Mar 02, 2009 8:11 pm UTC

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.

User avatar
Brooklynxman
Because I'm Awesome
Posts: 609
Joined: Tue Jan 20, 2009 4:27 pm UTC
Location: Here
Contact:

Re: Computer Scientists

Postby Brooklynxman » Mon Mar 02, 2009 8:11 pm UTC

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.
We figure out what all this means, then do something large and violent

The thing about changing the world...once you do it the world's all different.

I'm Angel. I beat the bad guys.

Spoiler:
Image

User avatar
Quizatzhaderac
Posts: 1821
Joined: Sun Oct 19, 2008 5:28 pm UTC
Location: Space Florida

Re: Computer Scientists

Postby Quizatzhaderac » Mon Mar 09, 2009 2:36 am UTC

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.
The thing about recursion problems is that they tend to contain other recursion problems.

User avatar
Indon
Posts: 4433
Joined: Thu Oct 18, 2007 5:21 pm UTC
Location: Alabama :(
Contact:

Re: Computer Scientists

Postby Indon » Tue Mar 10, 2009 8:45 pm UTC

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.
So, I like talking. So if you want to talk about something with me, feel free to send me a PM.

My blog, now rarely updated.

Image

User avatar
diotimajsh
Posts: 658
Joined: Wed Nov 14, 2007 7:10 am UTC
Contact:

Re: Computer Scientists

Postby diotimajsh » Tue Mar 10, 2009 11:17 pm UTC

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.
Osha wrote:Foolish Patriarchy! Your feeble attempts at social pressure have no effect on my invincible awesomeness! Bwahahahaa


Blog type thing

keeperofdakeys
Posts: 658
Joined: Wed Oct 01, 2008 6:04 am UTC

Re: Computer Scientists

Postby keeperofdakeys » Wed Mar 11, 2009 7:46 am UTC

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

Tac-Tics
Posts: 536
Joined: Thu Sep 13, 2007 7:58 pm UTC

Re: Computer Scientists

Postby Tac-Tics » Wed Mar 11, 2009 1:47 pm UTC

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.

User avatar
Will
There are about a million things I can do from behind
Posts: 2256
Joined: Mon Sep 10, 2007 11:12 pm UTC
Location: St. Heraldwulf's Stone
Contact:

Re: Computer Scientists

Postby Will » Wed Mar 11, 2009 3:11 pm UTC

Real programmers use ed.
Meaux_Pas: Is it fucking Taint Sunday or something?
liza: Screw y'all, I'm going to the moon

Shriike
Posts: 127
Joined: Mon Jan 26, 2009 3:27 am UTC
Location: Ohio

Re: Computer Scientists

Postby Shriike » Wed Mar 11, 2009 3:53 pm UTC

Will wrote:Real programmers use ed.

Real programmers use butterflies.
Image

User avatar
aleflamedyud
wants your cookies
Posts: 3307
Joined: Tue Oct 09, 2007 7:50 pm UTC
Location: The Central Bureaucracy

Re: Computer Scientists

Postby aleflamedyud » Fri Mar 13, 2009 5:25 am UTC

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!
"With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward. If you can't accept any of that, you are not fit to be a graduate student."

Shriike
Posts: 127
Joined: Mon Jan 26, 2009 3:27 am UTC
Location: Ohio

Re: Computer Scientists

Postby Shriike » Fri Mar 13, 2009 6:09 am UTC

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?
Image


Return to “Computer Science”

Who is online

Users browsing this forum: No registered users and 2 guests