PDA

View Full Version : What programming language to start with? And a short story of how I got here!


Stabilityonitsown
April 4th, 2008, 06:32 PM
Hi guys before we start I would just like to say I am using Debian...
WARNING! Please go back if you don't like story's.
Anyways quite a long time ago I was on yahoo and I met a group of friends programming in Visual Basic. They got me into it, and before I knew it I was programming like that. I made small but useful programs. Then I learned that Visual Basic was soooo old and was soo nooby and stuff like that, so I was pressured to moving up. They told me C# and C++ was my best option to move up. I decided to go with C#. I did that for about a year, it was not something I really succeeded in. In fact I found it confusing and needed gurus by my side 24/7. I then stopped programming for a while and learned about Linux over msn. I learned from my friend who at the time was burning it to CD just in case windows crashed, and he told me how great it was. He linked me to "Ubuntu". I read over the entire site and said to myself "Dam, this freakin rocks, no virus's no firewalls needed, nothin!!!". But unfortunately due to lack of CD's and knowledge I was unable to install it so I went with windows for some time and then when I got computer upgrades I installed Ubuntu. Then found that Ubuntu was built off Debian and heard Debian was more stable. Sooo, I went to Debian. Now, I am here, and I am wanting to program AGAIN but this time I want to be successful and be able to be that guru standing over someones back. So I ask fellow members of the Ubuntu community, whats the "best" and "easiest" programming language to start off with? And no I am not going back to C# or Visual Basic lol. Maybe when I got to college :lolflag:!
That just about wraps it up hope you liked my loonnnnggg story!

ruy_lopez
April 4th, 2008, 06:41 PM
Learn C or Python. A lot of folks say Python is the best first language. I don't know. I learned C first (although I wouldn't say I have learned it completely). So I cannot compare how I would have faired if I'd learned Python first. For that I would have to unlearn C (in this instance, completely), and start again.

Before you learn any language, you should probably familiarise yourself with the command-line (assuming you haven't done so already).

EDIT: see the Programming Talk FAQ in the sticky list.

Stabilityonitsown
April 4th, 2008, 06:45 PM
Lolz yeah I am a bit of nub to linux. I see what you mean, but this thread is a simple where I should go down the road.

deadimp
April 4th, 2008, 06:48 PM
PHP is also a pretty easy language to learn. It was actually my stepping stone from GML (Game Maker Language) to C++ a few years back. If you're interested in making desktop applications, PHP has a library with GTK bindings that you can use.
Funny thing is, now I'm back to PHP.

Stabilityonitsown
April 4th, 2008, 06:53 PM
What about ruby. I have tried it and found it pretty fun.

Aztek
April 4th, 2008, 07:39 PM
Judging from personal experience (mostly C/C++) and what I've heard I would recommend C++ or Python.

eskimspy
April 4th, 2008, 09:28 PM
Everyone said it was supposed to be hard, but I found C much easier than C++ or Java.

pmasiar
April 4th, 2008, 09:36 PM
Doing your own research (by reading sticky FAQ, written according to local expertise) will always give you better info than to rely on random advice of stranger with unknown background.

Best first language is Python (see poll in FAQ). See wiki in my sig for links.

Is you consider debian as more stable, are you aware that with more stability comes older (more obsolete) versions of programs? This is exactly reason of phenomenal popularity of ubuntu: based on debian, but with current snapshot of packages, stabilized every 6 months and released.

Of course, without good work of hundreds of debian developers it would be not possible, but ubuntu has different goal than debian: limited subset of debian programs, for limited subset of computer architectures, optimized for desktop and friendly to beginners. If you do more research, you will find that sabdfl Mark was debian developer, but instead of trying to become debian project leader and trying to realize his vision, he decided to start ubuntu with different goals (see above).

lnostdal
April 4th, 2008, 09:37 PM
if i met myself back when i was where you are now i'd say Common Lisp and C .. both are easy to learn and easy use, and they are different enough so you cover a large area with them

edit:
some links:
www.gigamonkeys.com/book/
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
ftp://ftp.lispworks.com/pub/software_tools/reference/HyperSpec-7-0.tar.gz

Stabilityonitsown
April 4th, 2008, 10:47 PM
Doing your own research (by reading sticky FAQ, written according to local expertise) will always give you better info than to rely on random advice of stranger with unknown background.

Best first language is Python (see poll in FAQ). See wiki in my sig for links.

Is you consider debian as more stable, are you aware that with more stability comes older (more obsolete) versions of programs? This is exactly reason of phenomenal popularity of ubuntu: based on debian, but with current snapshot of packages, stabilized every 6 months and released.

Of course, without good work of hundreds of debian developers it would be not possible, but ubuntu has different goal than debian: limited subset of debian programs, for limited subset of computer architectures, optimized for desktop and friendly to beginners. If you do more research, you will find that sabdfl Mark was debian developer, but instead of trying to become debian project leader and trying to realize his vision, he decided to start ubuntu with different goals (see above).I see what you mean, but I found Ubuntu buggy(please don't get offended just my personal opinion), and I would rather have stability than updated software and system features. It takes 3 years for me to get used to 1 release anyway.

Anyway back on topic, yes I actually tried python with my friend but didn't have a clue as to what it did so I just moved on. I now am trying python again and got to say its pretty fun and easy. Something I wish I started out with years back.

Shining Arcanine
April 4th, 2008, 11:02 PM
Hi guys before we start I would just like to say I am using Debian...
WARNING! Please go back if you don't like story's.
Anyways quite a long time ago I was on yahoo and I met a group of friends programming in Visual Basic. They got me into it, and before I knew it I was programming like that. I made small but useful programs. Then I learned that Visual Basic was soooo old and was soo nooby and stuff like that, so I was pressured to moving up. They told me C# and C++ was my best option to move up. I decided to go with C#. I did that for about a year, it was not something I really succeeded in. In fact I found it confusing and needed gurus by my side 24/7. I then stopped programming for a while and learned about Linux over msn. I learned from my friend who at the time was burning it to CD just in case windows crashed, and he told me how great it was. He linked me to "Ubuntu". I read over the entire site and said to myself "Dam, this freakin rocks, no virus's no firewalls needed, nothin!!!". But unfortunately due to lack of CD's and knowledge I was unable to install it so I went with windows for some time and then when I got computer upgrades I installed Ubuntu. Then found that Ubuntu was built off Debian and heard Debian was more stable. Sooo, I went to Debian. Now, I am here, and I am wanting to program AGAIN but this time I want to be successful and be able to be that guru standing over someones back. So I ask fellow members of the Ubuntu community, whats the "best" and "easiest" programming language to start off with? And no I am not going back to C# or Visual Basic lol. Maybe when I got to college :lolflag:!
That just about wraps it up hope you liked my loonnnnggg story!
Learn either C or Fortran, depending on what you want to do.

Learn C if you want to make a six digit salary working as a computer programmer for a major corporation. Learn Fortran if you want to become either a scientist or an engineer. If you are a geek like me, learn both. They are both great languages with their own strengths and weaknesses. C is the operating system language. Virtually all operating systems today are written in C. It is a very efficient language. Fortran is the math language. Anything involving mathematics is best written in Fortran for its high efficiency. It is more efficient than C when dealing with numerical operations.

I learned C (89) over a period of 6 months, starting last september. I am right now learning C++, Java (5.0) and Fortran (90). I am learning C++ because I thought I would be using it in the future, I am learning Java because the Computer Science department is forcing it upon me (the humanity!) and I am learning Fortran because I have learned that all of the programs that the area in which I want to do research in the future are written in Fortran.

I also know PHP (my first language) and some assembly. Some people here are recommending PHP and PHP is a great language for web programming, but if you want to do application programming, I would not recommend it.

Stabilityonitsown
April 4th, 2008, 11:54 PM
Learn either C or Fortran, depending on what you want to do.

Learn C if you want to make a six digit salary working as a computer programmer for a major corporation. Learn Fortran if you want to become either a scientist or an engineer. If you are a geek like me, learn both. They are both great languages with their own strengths and weaknesses. C is the operating system language. Virtually all operating systems today are written in C. It is a very efficient language. Fortran is the math language. Anything involving mathematics is best written in Fortran for its high efficiency. It is more efficient than C when dealing with numerical operations.

I learned C (89) over a period of 6 months, starting last september. I am right now learning C++, Java (5.0) and Fortran (90). I am learning C++ because I thought I would be using it in the future, I am learning Java because the Computer Science department is forcing it upon me (the humanity!) and I am learning Fortran because I have learned that all of the programs that the area in which I want to do research in the future are written in Fortran.

I also know PHP (my first language) and some assembly. Some people here are recommending PHP and PHP is a great language for web programming, but if you want to do application programming, I would not recommend it.
May I ask, why is everyone learning java because they "have to"?

pmasiar
April 5th, 2008, 12:43 AM
May I suggest:
1) read stickies and continue discussion in appropriate sticky thread about learning programming etc
2) if you quote, be nice and trim off unrelevant parts so we can se to what part of the previous post do you answer?

LaRoza
April 5th, 2008, 12:58 AM
May I ask, why is everyone learning java because they "have to"?

It is very often taught in schools, and it is popular in the job market.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Stabilityonitsown
April 5th, 2008, 02:55 AM
It is very often taught in schools, and it is popular in the job market.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Thank you for help!:popcorn:

Shining Arcanine
April 5th, 2008, 08:55 AM
May I ask, why is everyone learning java because they "have to"?

After the dotcom crash, people did not view a major in Computer Science as a safe career path and university enrollments in Computer Science halved. If they did not go back to normal, Computer Science departments would lose funding. To try to raise them, they decided to try to make Computer Science "fun" by getting rid of things non-geeks hate like bitwise operations, memory management, pointers and the need to have a brain. The language best suited to accomplishing that is Java, so now, virtually all Computer Science departments in the United States teach Java in virtually all of their required courses.

At my university, it is possible to become a Computer Science major knowing only Java, some assembly and a tiny bit of C for assembly programming. I complained about the lack of C and the undergraduate director of the Computer Science department agreed with me that they need more C in the curriculum, but I have not seen anything happen since.

Shining Arcanine
April 5th, 2008, 09:07 AM
It is very often taught in schools, and it is popular in the job market.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Everyone who has been in a job interview or spoken to someone who has been in a job interview and told me about it has told me that all of the companies want people who know C++ and that it is very difficult to get a job as a Java programmer. The only company I know of which hires Java programmers is in the UK. Java is not popular in the job market, at least not here in the United States.

lnostdal
April 5th, 2008, 09:18 AM
Everyone who has been in a job interview or spoken to someone who has been in a job interview and told me about it has told me that all of the companies want people who know C++ and that it is very difficult to get a job as a Java programmer. The only company I know of which hires Java programmers is in the UK. Java is not popular in the job market, at least not here in the United States.

*yawn* .. it's a friggin good thing i'm not "everyone"

i suggest you keep your "everyones" to yourself as some might view it as an insult ("why is this guy talking about _me_?") .. or find the blunt wrong-ness of the statement, well, annoying

pmasiar
April 5th, 2008, 09:20 AM
If they want to teach Java only, for job market, that is not CompSci but vocational training, you should get that cheaper as Associate Diploma in community college.

hessiess
April 5th, 2008, 09:30 AM
i started with python, but i never managed to understand it well enugh to actualy ues it for anuthing. I find c++ far more logical and easer to understand.

nvteighen
April 5th, 2008, 10:05 AM
I started with my grandad's ZX Spectrum BASIC. Then I stepped into Q(uick)BASIC. Because of a friend, entered Visual Basic 4 and 6 meanwhile I was also learning Javascript. Then I tried C++, but I got frustrated and stopped programming. Now I'm trying to come back with C, but mostly for fun and enjoyment.

If you want to program for hobby, learn a language you're sure you're going to enjoy for whatever reason (easiness, difficulty, portability, web apps, maths, etc.). If you're interested on Assembly, why don't try it? I'm interested in C and people in these forums have repeatedly told me better try Python because it's simpler (why? I want to try C because it's challenging!)

Shining Arcanine
April 5th, 2008, 11:07 AM
*yawn* .. it's a friggin good thing i'm not "everyone"

i suggest you keep your "everyones" to yourself as some might view it as an insult ("why is this guy talking about _me_?") .. or find the blunt wrong-ness of the statement, well, annoying

I said:

Everyone who ... and told me about it ...

That does not include you. Please read more carefully and avoid jumping to conclusions in the future.

CptPicard
April 5th, 2008, 12:13 PM
To try to raise them, they decided to try to make Computer Science "fun" by getting rid of things non-geeks hate like bitwise operations, memory management, pointers and the need to have a brain. The language best suited to accomplishing that is Java ...

Actually CompSci is at its best a pencil and paper discipline, and you mostly just need a brain and not even necessarily a computer.

It's well possible to get a very competent PhD in CompSci at my university without ever taking a C class (it's not mandatory), although it is unlikely of course you wouldn't know C if you went that far... but it's by no means a requirement. You can express everything that is really of interest in CompSci in higher-level languages, and a lot of HLLs actually make it possible to have logically interesting constructions such as first-class functions and continuations that would be impossible in C.

Java is just a handy way to give people some programming language to use as a tool... you could probably substitute something like Python for it, but I have a feeling that for example the Python loop construct is a bit too high level for me to use it as a first-language teaching tool...

Shining Arcanine
April 5th, 2008, 11:42 PM
Actually CompSci is at its best a pencil and paper discipline, and you mostly just need a brain and not even necessarily a computer.

It's well possible to get a very competent PhD in CompSci at my university without ever taking a C class (it's not mandatory), although it is unlikely of course you wouldn't know C if you went that far... but it's by no means a requirement. You can express everything that is really of interest in CompSci in higher-level languages, and a lot of HLLs actually make it possible to have logically interesting constructions such as first-class functions and continuations that would be impossible in C.

Java is just a handy way to give people some programming language to use as a tool... you could probably substitute something like Python for it, but I have a feeling that for example the Python loop construct is a bit too high level for me to use it as a first-language teaching tool...

My Discrete Mathematics classes used SML, but I really think C would be best for Computer Scientists. After all, virtually all compilers and operating systems are written in C and without them, there is not much for a computer scientist to study.

lnostdal
April 6th, 2008, 12:10 AM
“Computer science is no more about computers than astronomy is about telescopes.” -- Edsger Dijkstra

you're still using The Wrong Words when talking, "Shining Arcanine":

* always
* never
* all
* none

please..think before you use these words


After all, virtually all compilers and operating systems are written in C

no, completely wrong (edit: as in not even "true" based on statistics) .. and even if it _was_ "true", it is totally beside the point when thinking about computer science

without them, there is not much for a computer scientist to study.
you're _not listening_, or comprehending what cptpicard is trying to say

CptPicard
April 6th, 2008, 12:17 AM
I honestly couldn't disagree more :)

Compilers and OSes may be written in C, but you might as well extend the argument and say that we might go all the way down and start writing in assembly, as machine code is what gets generated, and without machine code, there wouldn't be anything to study...

However, if you take compilers as an example, programming language analysis and design and parsing algorithms and code optimization transformations have nothing to do with C per se. You just need a brain to figure those out. If you finally want to implement something, maybe you want to be using C, but it's not a necessity...

CS is about problem analysis and algorithm design and analysis. You need some sort of a model to write your algorithms for; actual computers are just one of them, and even they can be made to simulate all sorts of interesting other machines (within limits of Turing equivalence of course)...

Remember: "Computer Science is as much about computers as Astronomy is about telescopes" -- (Dijkstra)

Stabilityonitsown
April 6th, 2008, 02:41 AM
Thanks for all the help guys, I went ahead and went with Python. And man it has got me HOOKED(not on phonix lol). It is super easy and straight forward, I just started yesterday and I am already learning the while loops and the thing is its really short, for example


Python

# password = "foobar"
# while password != "unicorn":
# password = raw_input("Password: ")
# print "Congratz!"


C++

# const int passwd = 13579;
# int input_passwd;
# std::cout << "Please enter your password: ";
# std::cin >> input_passwd;
# if (input_passwd == passwd)
# std::cout << "\nEnter!\n";
# else
# std::cout << "\nSorry! Wrong password!\n";
# return 0;


I know if I was a C++ programmer my monitor would be smashed to bits lol.

BTW guys I do NOT program in C++ nor do I know how to, so if the C++ code above is wrong please don't punish me. This is just a simple code I grabbed somewhere and have not verified it to know if it works. Again just an example to show that python is much easier.

Thanks for ALL your help I now LOVE python!!!

Shining Arcanine
April 6th, 2008, 10:38 AM
“Computer science is no more about computers than astronomy is about telescopes.” -- Edsger Dijkstra

you're still using The Wrong Words when talking, "Shining Arcanine":

* always
* never
* all
* none

please..think before you use these words


no, completely wrong (edit: as in not even "true" based on statistics) .. and even if it _was_ "true", it is totally beside the point when thinking about computer science


you're _not listening_, or comprehending what cptpicard is trying to say

You asserted that I was incorrect in stating that virtually all operating systems and compilers are written in C according to statistics, but you failed to cite any statistics that demonstrate that I am wrong. You also insinuated that computer science is something other than what I have stated, but you failed to state what that is.

You used quite a bit of packaging in your post, but there is no content. Please provide it in the future. Assuming that I can use references to objects in your head is analogous to assuming that others can follow hyperlinks to files on your hard drive.

CptPicard
April 6th, 2008, 10:52 AM
You asserted that I was incorrect in stating that virtually all operating systems and compilers are written in C according to statistics, but you failed to cite any statistics that demonstrate that I am wrong.

Actually, writing a compiler in Lisp (Inostdal's favourite language) is way easier than doing it in C. Writing the kind of number-crunching brute force pure-functional transformations I currently work with is easier in Haskell than in C. And the Haskell compiler is written in Haskell...

You also insinuated that computer science is something other than what I have stated, but you failed to state what that is.

Well, I think it is I who is actually giving you a differing definition to CompSci, he's just pointing out that you're not getting the point. May I ask you what your experience in the field is, academically speaking? :)

None of the subfields of CS I have been interested in have outright demanded the use of C -- even OSes can be written for the most part in something else. And the ones I am interested in -- classical algorithmics, linear programming models and AI, are just a total, absolute pain to write in C. Using C adds nothing to your understanding and limits the tools at your disposal.

Shining Arcanine
April 6th, 2008, 11:48 AM
Thanks for all the help guys, I went ahead and went with Python. And man it has got me HOOKED(not on phonix lol). It is super easy and straight forward, I just started yesterday and I am already learning the while loops and the thing is its really short, for example


Python

# password = "foobar"
# while password != "unicorn":
# password = raw_input("Password: ")
# print "Congratz!"
C++

# const int passwd = 13579;
# int input_passwd;
# std::cout << "Please enter your password: ";
# std::cin >> input_passwd;
# if (input_passwd == passwd)
# std::cout << "\nEnter!\n";
# else
# std::cout << "\nSorry! Wrong password!\n";
# return 0;
I know if I was a C++ programmer my monitor would be smashed to bits lol.

BTW guys I do NOT program in C++ nor do I know how to, so if the C++ code above is wrong please don't punish me. This is just a simple code I grabbed somewhere and have not verified it to know if it works. Again just an example to show that python is much easier.

Thanks for ALL your help I now LOVE python!!!

Those two code examples are not analogous for a few reasons:

1. You are using string passwords in python and integer passwords in C++
2. You are using a constant integer declaration for the password in C++ while using an inline string for the password in Python
3. You are using a function to request and retrieve the password in python while you are using inline code in C++

This would be more analogous:

string password;
while (password.compare("unicorn") != 0)
{
cout << "Password: ";
cin >> password;
}
cout << "Congratz";

Furthermore, fundamental differences exist between Python and C++ that make comparisons difficult. C++ is designed with the philosophy that the programmer knows best and there should be more than one way of doing something to enable the programmer to extract maximum efficiency from his code while Python is designed with the philosophy that there should be one and only one obvious way of doing things. Also, C++ is a compiled language while Python is an interpreted language.

Actually, writing a compiler in Lisp (Inostdal's favourite language) is way easier than doing it in C. Writing the kind of number-crunching brute force pure-functional transformations I currently work with is easier in Haskell than in C. And the Haskell compiler is written in Haskell...



Well, I think it is I who is actually giving you a differing definition to CompSci, he's just pointing out that you're not getting the point. May I ask you what your experience in the field is, academically speaking? :)

None of the subfields of CS I have been interested in have outright demanded the use of C -- even OSes can be written for the most part in something else. And the ones I am interested in -- classical algorithmics, linear programming models and AI, are just a total, absolute pain to write in C. Using C adds nothing to your understanding and limits the tools at your disposal.

I am a sophomore computer science student at Stonybrook University that is upset that all required programming classes in the curriculum use Java instead of C/C++. I have taken several classes either for the Computer Science major or related to it, including Foundations of Computer Science I (a discrete mathematics class that uses SML to demonstrate various things; it went over set theory, combinatorics, graph theory, logic), Foundations of Computer Science II (basic concepts used in compiler theory, databases and artificial intelligence were introduced, although the professor did not specifically mention that the things we learned could be used for that), Introduction to Programming in C (not required, but I wanted to learn C; it went over basic algorithm concepts), Intermediate C++ Programming (also not required, but I wanted to learn C++), Computer Science I (a required Java course, it was essentially a Java version of Introduction to Programming in C), Finite Mathematical Structures, etcetera.

In my spare time, I have written programs in C to solve chinese remainder problems, to compute the maximum cycle length for the solution of the 3n+1 problem between two bounds, to find large prime numbers (with the help with the GMP Library), etcetera. Although I have not taken any courses on it, I have also taught myself concurrency and assembly language (only to find that my highly optimized assembly was less optimal than machine generated assembly due to how Visual Studio inlined it into my C code). I also have 4 years of experience from before college writing PHP scripts that used MySQL backends.

Two professors emeritus of computer science at New York University recently made comments regarding computer science curricula that are extremely close to my own thoughts. They might be more qualified to talk about these things

http://developers.slashdot.org/article.pl?sid=08/01/08/0348239&from=rss

Here is my general take on what languages are suited for what things:

Fortran - Numerical, Engineering, Scientific applications
C/C++ - Operating Systems, Compilers, Games and General Applications
Lisp - Artificial Intelligence
HTML/XHTML/XML/CSS/RSS - Web pages
PHP - Web Programming
SQL - Databases
Assembly/Compiler Intrinsics - Anywhere that vectorization needs to be done in C/C++/Fortran programs
SML - Discrete Mathematics

Misc - Genetic Algorithms, Genetic Programming, Gene Expression Programming and Quantum Algorithms.

The misc category is for things about which I do not know enough to be able to place them. The only language that I listed above in which I have no experience was Lisp, although I have a book on Artificial Intelligence in my room that demonstrates that Lisp is well suited to Artificial intelligence programming. I did a cursory search through it the day when I found it in the garage and I found that the material it covers heavily overlaps with material from my Foundations of Computer Science II class. I have not done things in Operating Systems, Games and Artificial Intelligence. I wrote a scanner once for a computer science assignment that required me to write a program to read another program's source code, format it and output it because I insisted that I do the assignment "the right way." The program I submitted had no less than 1171 lines of code, but was fairly robust and could handle virtually all preprocessed C89 programs, although I did not have time to finish it. I have a copy of the Dragon book that I used to assist me in the scanner's design. My university does not require that students learn compiler theory, but I plan to take the class and use the dragon book for it. Everything else (with the exception of engineering and scientific applications, although I will be doing stuff with scientific applications soon) are things in which I have experience.

Note that I am explicitly excluding Java and Javascript because I find Java programming to be mindless and I remember that when I was doing web development as a hobby, I found that Javascript (and tabular designs) was often used for things that should have used CSS.

lnostdal
April 6th, 2008, 12:35 PM
You asserted that I was incorrect in stating that virtually all operating systems and compilers are written in C according to statistics, but you failed to cite any statistics that demonstrate that I am wrong. You also insinuated that computer science is something other than what I have stated, but you failed to state what that is.


no, i didn't fail in doing any of this because this, or that, was not what i was trying to do


You used quite a bit of packaging in your post, but there is no content.


that was the point .. i'm _not_ providing any content _on .. purpose_

.. again you fail to understand and listen even when people do something like this vs. you directly (ie; finger puppets, artificially simplified context) ..

edit: turns out, i'm in luck .. this is not my problem, at this point i do not think i care any more .. this conversation is, or should be - over ..

edit2: *snip* never mind this part .. he asked

CptPicard
April 6th, 2008, 01:15 PM
I am a sophomore computer science student at Stonybrook University

Well, I can understand your enthusiasm but talk to you in 3-4 years' time :) You are on a logically precarious ground trying to argue for a very restrictive definition for CompSci and trying to state that C is somehow remarkably civilizing for Computer Scientists. The whole point of our science is to push the boundaries of the tools so that problems can be tackled more directly and efficiently, and always implementing everything from scratch on low level doesn't cut it.

Would you say that Alan Turing didn't have a brain because his abstract machine actually dared to imagine it's got unlimited memory on a completely fictitious tape? :)

My own enlightenment as a CS guy came from Scheme and lots of pencil and paper. There is nothing in memory management that makes you a better person -- understanding how much more expressive power you get from higher-level constructs, does. Incidentally, I never implemented anything in C during my university times apart from the trivial homework of the half-semester C class that I just took for the credit, not for the learning experience.

that is upset that all required programming classes in the curriculum use Java instead of C/C++.

Be glad. You'll get to the actual point of the exercise sooner.

I have taken several classes either for the Computer Science major or related to it, including Foundations of Computer Science I (a discrete mathematics class that uses SML to demonstrate various ...

Yeah. You'll get there. You're not as much of a kid as I initially thought, but I would appreciate it if you didn't have the arrogance to just flat-out contradict the slightly more extensive life experience of someone else -- it's not a personal attack really ;)

(only to find that my highly optimized assembly was less optimal than machine generated assembly due to how Visual Studio inlined it into my C code).

Meet "what CompSci is really about" and why you're wrong. Writing a superior research compiler that gets even better is faster, and more effective in a higher-level language :)

Two professors emeritus of computer science at New York University recently made comments regarding computer science curricula that are extremely close to my own thoughts.

They must be rather engineering-minded. There is this kind of a division among CompSci people, really. Our professors (Uni of Helsinki, Linus Torvalds' and yours truly's alma mater) don't quite agree. MIT didn't either, they started teaching programming with SICP and Scheme, and later on moved to Python.

In general, in our curriculum actual programming is becoming less and less pronounced; it's supposed to be an academic institution, not a code monkey school.

Now, of course I am not saying that it is not important for an academically educated CS person to know what goes on under the hood. It's just that our problem domains tend to operate on a more abstract level, and the basement infrastructure should be dealt with only when necessary, and perhaps by those people who are specifically interested in it.


Note that I am explicitly excluding Java and Javascript because I find Java programming to be mindless

Why? Just because it has a garbage collector, huh?

The problem with Java is that it lacks higher-level constructs, not that it has some of them.

ruy_lopez
April 6th, 2008, 01:48 PM
There is nothing in memory management that makes you a better person -- understanding how much more expressive power you get from higher-level constructs, does.

This is really the engineering/science dichotomy again. Memory management is useful to engineers who are looking to build systems that run well. It's not very useful - in fact, it's an unnecessary chore - to a scientist who wants to test his/her own theories.

The problem is that most sciences attract both engineers and scientists. CS is no different.

I tend to be a bit schizophrenic with regards to which camp I fall into. I love the scientific approach. It seeks to understand and to show how something works. But I also like to build interesting systems. So I end up reimplementing higher level code in C in case I ever want to use it in a system (not always with 100% success).

Shining Arcanine
April 6th, 2008, 03:24 PM
Well, I can understand your enthusiasm but talk to you in 3-4 years' time :) You are on a logically precarious ground trying to argue for a very restrictive definition for CompSci and trying to state that C is somehow remarkably civilizing for Computer Scientists. The whole point of our science is to push the boundaries of the tools so that problems can be tackled more directly and efficiently, and always implementing everything from scratch on low level doesn't cut it.

Computer Scientists need not reimplement everything from scratch on the low level. That is why they have third party libraries and automated programming (an early term for compiler technology).

I consider low level programming to be programming in anything that is machine dependent and high level programming to be programming in anything that is portable. According to that definition, C is a high level language. I admit that there are degrees of high levelness (e.g. Lisp > PHP > C++ > C), but I really think that the notion of a high level language should be analogous to that of a portable language and thus be absolute, rather than relative.

Would you say that Alan Turing didn't have a brain because his abstract machine actually dared to imagine it's got unlimited memory on a completely fictitious tape? :)

He had a brain, but I think Charles Babbage had many of his ideas first. Charles Babbage's analytical engine was a century ahead of its time and utilized a turing-complete language that had similarities to Fortran, specifically, the punch cards. Despite that, it was all theoretical, much like Alan Turing's abstract machine, as Charles Babbage never finished it.

My own enlightenment as a CS guy came from Scheme and lots of pencil and paper. There is nothing in memory management that makes you a better person -- understanding how much more expressive power you get from higher-level constructs, does. Incidentally, I never implemented anything in C during my university times apart from the trivial homework of the half-semester C class that I just took for the credit, not for the learning experience.

I am not familiar with Scheme. What are its merits?

Yeah. You'll get there. You're not as much of a kid as I initially thought, but I would appreciate it if you didn't have the arrogance to just flat-out contradict the slightly more extensive life experience of someone else -- it's not a personal attack really ;)

I have found you to be very courteous and I do not consider that to be a personal attack. I take it as a complement.

Meet "what CompSci is really about" and why you're wrong. Writing a superior research compiler that gets even better is faster, and more effective in a higher-level language :)

I agree with you that it is easier to write complex software such as compilers in higher level languages (higher level relative to C), but I firmly believe that knowing C is very important, if not because it is efficient, then because it utilizes pointers. I really like how (at least in the original K&R C) there is little distinction between integers and pointers in C. It elucidates the details of the underlying system architecture while maintaining a portable language.

In addition, I find C to lay the foundations of object oriented programming (i.e. higher level languages) with structures, as when you declare an object in C++, what is really being made in memory is a structure and, to use a bit of Java jargon, all of the methods are really functions designed to operate on the structures that are created in memory. C makes things clear in a way that Java does not and perhaps cannot due to all of the abstraction it attempts.

They must be rather engineering-minded. There is this kind of a division among CompSci people, really. Our professors (Uni of Helsinki, Linus Torvalds' and yours truly's alma mater) don't quite agree. MIT didn't either, they started teaching programming with SICP and Scheme, and later on moved to Python.

In general, in our curriculum actual programming is becoming less and less pronounced; it's supposed to be an academic institution, not a code monkey school.

Now, of course I am not saying that it is not important for an academically educated CS person to know what goes on under the hood. It's just that our problem domains tend to operate on a more abstract level, and the basement infrastructure should be dealt with only when necessary, and perhaps by those people who are specifically interested in it.

I am planning to pursue graduate studies in cellular and molecular biology (with a heavy emphasis on research involving computers) after I finish my undergraduate career, so I suppose I am fairly engineering-minded as well.

Nothing keeps me from working with the more abstract things in Computer Science, but I enjoy the applied aspects of it.

Why? Just because it has a garbage collector, huh?

The problem with Java is that it lacks higher-level constructs, not that it has some of them.

I dislike automatic garbage collection and I really like to do memory management on my own, but that is not the chief reason I dislike Java. The chief reason I dislike Java is that it attempts to force me to think in terms of its libraries when I want to think in terms of how things work. I find C allows me to do that.

Lacking pointers and operator overloading (yet still having function overloading) are other sour points, although I suppose you could consider pointers to go along with memory management. The fact that Java is exclusively object oriented (as opposed to multiparadigm like C++) is another sour point, as I would prefer to be able to mix functional programming and object oriented programming to match my thoughts.

CptPicard
April 6th, 2008, 04:06 PM
Computer Scientists need not reimplement everything from scratch on the low level. That is why they have third party libraries and automated programming (an early term for compiler technology).

Seems to me you're still advocating it, if you believe it is not manly enough or something not to write stuff in C.

I consider low level programming to be programming in anything that is machine dependent and high level programming to be programming in anything that is portable.

1960s called, they want their mindset back.. C was high-level back then or thereabouts. Let's ask pmasiar, he was there :)

According to that definition, C is a high level language.

You can operate on whatever definition you want, but I am not buying it.

I admit that there are degrees of high levelness (e.g. Lisp > PHP > C++ > C), but I really think that the notion of a high level language should be analogous to that of a portable language and thus be absolute, rather than relative.

Your "absolute" limit is completely subjective, and you just draw it conveniently.

Portability is a consequence of being a HLL because you're by definition operating on top of an abstract machine which behaves the same on all hardware. C was among the first languages to approach that, but seriously, the true HLL features of today are something completely different. C lacks everything in that department -- try doing closures (lambdas), continuations or (convenient) lazy lists for starters.


He had a brain, but I think Charles Babbage had many of his ideas first.

Doesn't really have much to do with the gist of the argument itself.


I am not familiar with Scheme. I admit that I will probably never use it, but I am curious, what are its merits?

It's a sort of minimalist Lisp. It's got everything C doesn't, in a very concise syntax. Really gives you a feel of dealing with pure abstract computation instead of bit-pushing. See the examples above.


I agree with you that it is easier to write complex software such as compilers in higher level languages (higher level relative to C)

In many ways, HLLs not only make it easier, but also have great benefits in terms of what you can do in the first place. Plus there are the obvious benefits to code quality... most research compilers are not written in C for obvious reasons.

but I firmly believe that knowing C is very important, if not because it is efficient, then because it utilizes pointers.

Right. So we're still at the phase where pointers are a revelation? :)

I really like how (at least in the original K&R C) there is little distinction between integers and pointers in C. It elucidates the details of the underlying system architecture while maintaining a portable language.

Yes, it is good in the "this is how computer architecture works down there" way, but raw integer-equivalent pointers are not something you want to actually see anywhere in your code. Ever. Really.

When I was a kid there was this book I read that gave me similar information in terms of gnomes carrying letters between numbered boxes...

Pointers are nothing but a low-level language's way of making the distinction between call by value and call by reference. It's more implicit in HLLs but it's there. In higher-level languages yet, you just look at it as bind and evaluate...

C makes things clear in a way that Java does not and perhaps cannot due to all of the abstraction it attempts.

You can emulate OOP in an ugly way like that in any language that has functions and structures. Essentially, pretty much, uh, any language. It's not to C's merit that you can do that. You can do all sorts of things you shouldn't. :)

In addition, to claim that an it is a minus on an OOP language to have automatic polymorphism (that is, you don't force-cast your structures), proper encapsulation and automatic class namespaces and finally, the object.method(param) syntactic sugar is pretty disingenious and just shows you need to put down Java in any way you can think of. You could just as well claim something similar of any other OO language in existence.


I am planning to pursue graduate studies in cellular and molecular biology (with a heavy emphasis on research involving computers) after I finish my undergraduate career, so I suppose I am fairly engineering-minded as well.

My very smart friend is pursuing a PhD in Computational Genetics, and I don't think I ever saw him write more than a few lines of C during the time when I was still at university :) OS kernel stuff and compilers are very different beasts to what you're planning on doing, and getting comfortable with decent HLLs will serve you well in your studies. It is hard to argue this point as you obviously just don't "know" yet and seem to still be fascinated by the bits and pieces, but you'll get tired of them and want to get something actually done...



I dislike automatic garbage collection and I really like to do memory management on my own

Why? Is it fun or something? :confused: (or is this the typical Padawan-programmer's "it gives me all teh control!!1" argument?)

The chief reason I dislike Java is that it attempts to force me to think in terms of its libraries when I want to think in terms of how things work. I find C allows me to do that.

You mean you don't use the C standard library? Or those ready-made libraries you advertised at the beginning of your post as being there for use so you don't have to reimplement everything from scratch?

I like to think of things in my problem in terms of what they are, not what the machine doing.

HLLs "force" you to think in more abstract terms. It's a Good Thing. In Scheme and Haskell and Prolog, you think in very, very abstract terms. Prolog in particular has very little to do with "how things actually work" -- you don't need to be aware of the constraint satisfaction search that is going on behind the scenes.


Lacking pointers...

You're aware that every object reference in Java except primitive types are pointers?


object oriented (as opposed to multiparadigm like C++) is another sour point, as I would prefer to be able to mix functional programming and object oriented programming to match my thoughts.

You're able to mix functional programming with imperative programming in C++? Wow.

Now, I'm not such a huge Java fan myself, but I certainly do not disagree with it for the reasons you're giving...

urosh2
April 6th, 2008, 04:37 PM
I currently started with python. I am not a programmer, but i am quick learner with python. I think it's almost easy as Visual Basic. There are quite good GUI programming tools available. My choice is boa constructor.

Shining Arcanine
April 6th, 2008, 04:49 PM
In addition, to claim that an it is a minus on an OOP language to have automatic polymorphism (that is, you don't force-cast your structures), proper encapsulation and automatic class namespaces and finally, the object.method(param) syntactic sugar is pretty disingenious and just shows you need to put down Java in any way you can think of. You could just as well claim something similar of any other OO language in existence.

A need to put down Java implies specifically complaining about all aspects of Java. I have not complained about the Java syntax. Therefore not specifically complaining about all aspects of Java is true and by modus tollens, a need to put down Java is not true.

I found you to be fairly courteous earlier, but now I am starting to find you to be insulting. You need to learn that other people think differently and prefer philosophies that were mainstream in the 1980s to those that are mainstream today. Newer is not always better. You of all people should know that since you are posting on forums dedicated to an OS (Ubuntu) that is based (API-wise) on an OS from the 1970s (Unix).

My very smart friend is pursuing a PhD in Computational Genetics, and I don't think I ever saw him write more than a few lines of C during the time when I was still at university :) OS kernel stuff and compilers are very different beasts to what you're planning on doing, and getting comfortable with decent HLLs will serve you well in your studies. It is hard to argue this point as you obviously just don't "know" yet and seem to still be fascinated by the bits and pieces, but you'll get tired of them and want to get something actually done...

You are right. I learned recently that I will never need to write more than few lines of C for such research. Instead, I will have to be able to speak, think and write Fortran 90, as the molecular dynamics software the lab in which I am doing undergraduate research uses is written in Fortran 90.

Why? Is it fun or something? :confused: (or is this the typical Padawan-programmer's "it gives me all teh control!!1" argument?)

It allows me to reuse the same memory locations as long as possible to avoid having to do additional calls to malloc(), which are very expensive in terms of the time they take:

http://www.virtualdub.org/blog/pivot/entry.php?id=186

Minimizing the number of calls to malloc() is a concept that Firefox used to make its memory usage more efficient:

http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage/

You mean you don't use the C standard library? Or those ready-made libraries you advertised at the beginning of your post as being there for use so you don't have to reimplement everything from scratch?

It is possible to use existing libraries where they are useful and to write new libraries where they are not, but the idea of always finding a library to shoehorn into a solution to a problem is not the right way to go about things. See the link to the comments by the New York University professors in my earlier post and the link below for more on this.

HLLs "force" you to think in more abstract terms. It's a Good Thing. In Scheme and Haskell and Prolog, you think in very, very abstract terms. Prolog in particular has very little to do with "how things actually work" -- you don't need to be aware of the constraint satisfaction search that is going on behind the scenes.

C and Fortran are members of the set of high level languages. That is an absolute concept. If you want to utilize relative concepts, you must state to what they are relative. Otherwise your language is ambiguous.

The features that you find to be positive in languages on the level of Java and even higher level languages are not necessarily good things. Read the following essay to learn why:

http://www.ultratechnology.com/forththoughts.htm

You're aware that every object reference in Java except primitive types are pointers?

They are references, which while being similar to pointers, are not pointers. With references, you do not have access to actual memory locations, while pointers let you go where ever you want. Java is not well suited to implementations of the MPI library as a consequence of this:

http://en.wikipedia.org/wiki/Message_Passing_Interface#Java

If Java had actual pointers, the implementation of the MPI library would be a non-issue.

You're able to mix functional programming with imperative programming in C++? Wow.

Now, I'm not such a huge Java fan myself, but I certainly do not disagree with it for the reasons you're giving...

Bjarne Stroustrup is fan of multi-paradigm programming:

http://www.ddj.com/cpp/207000124?pgno=4

Why am I the only one making citations here?

Chayak
April 6th, 2008, 05:00 PM
I started using perl for scripting/text parsing and I remember looking through trying to decipher what I'd written a week later. I tried python and once I was up to speed on doing scripting tasks I found it to be much easier for me. My CS focus is mainly in C/C++ but I'll have to learn Java as well.

I guess it's what you want to do in the future as well. If you want to work in satellite, spacecraft, or flight programming Ada or C is the standard. Just an example.

mivo
April 6th, 2008, 05:09 PM
What about ruby. I have tried it and found it pretty fun.

I always found Ruby to be easier to "get" than Python. It's a wonderful language, and it's the only one I actually succeeded a bit in, except various Basic dialects over the best twenty years. Now, a lot of people recommend Python, and it's a solid recommendation because the language's community is huge, and there is an overwhelming number of books for all levels of knowledge available.

As for Ruby, the selection of books is much smaller, though there are titles for novices and experts alike. If you want to start with the basics, I'd recommend Chris Pine's "Learn to Program", which uses Ruby as the tutorial language. There's a web tutorial by the same writer, too, located here (http://pine.fm/LearnToProgram/). A link to the book is also on that site.

For a curious and entertaining way of learning Ruby, I can also recommend Why's Poignant Guide to Ruby (http://poignantguide.net/ruby/). It is different, cute, funny, informative and humorous, and above all: creative. Highly recommended. :)

I think whatever language you learn, the important part is that you stick to it for some time. Don't jump around too quickly, because you'll soon get confused and lose interest in the whole programming thing at all.

CptPicard
April 6th, 2008, 05:44 PM
A need to put down Java implies specifically complaining about all aspects of Java. I have not complained about the Java syntax.

Oh, so there is a counter-example to complaining about everything in Java so you're not making dubious claims about "OO-misfeatures by existence" and directing them at Java in particular.. ;) I will repeat myself: all OO languages have language features for expressing things in terms of objects. Java is no different. It is not a "remarkable" language, but it is not particularly awful either. Most importantly, it serves its purpose as a first language, although there may be better options -- HLLs, preferably.

I found you to be fairly courteous earlier, but now I am starting to find you to be insulting.

On the other hand, being dragged down into pointlessness like this makes me feel like you're [someone slightly frustrating] in disguise... only more verbose :)

You need to learn that other people think differently and prefer philosophies that were mainstream in the 1980s to those that are mainstream today.

Actually, Lisp is from the 50s. People would write programs on pencil and paper and then send them off to a "compiler" who would turn it into machine code...

These are matters of opinion now? :) Discussions would be rather pointless if that were the case. Interestingly, I can see your POV very well for what it's worth, it's just that I do not see much proof of you recognizing what I'm saying here. Therefore, you're arguing for the superiority of a rather restricted viewpoint, which is doomed to fail IMO as you're only willing to consider anything within your scope of experience.


Newer is not always better.

Corollary -- older is not better by virtue of being older.


It allows me to reuse the same memory locations as long as possible to avoid having to do additional calls to malloc(), which are very expensive in terms of the time they take:

Nice. Now, if only counting my mallocs helped with these monads I'm building in Haskell... again, another problem-level abstraction I'm working on, instead of fighting the machine. You really need to get comfortable with the idea that algorithmic solutions are the ones you're expected to find and use as the computer scientist... they always trump low-level optimizations like this. As an example, if someone figured out a nicer caching algorithm for Firefox, there would not be need for this malloc trickery.


It is possible to use existing libraries where they are useful and to write new libraries where they are not, but the idea of always finding a library to shoehorn into a solution to a problem is not the right way to go about things.

Err.. what exactly stops you from rolling your own in Java if you so choose? Nothing. For some reason the existence of the Java API is bad for Java and Good for other languages.


C and Fortran are members of the set of high level languages. That is an absolute concept. If you want to utilize relative concepts, you must state to what they are relative. Otherwise your language is ambiguous.

No, you're making up your own absolutes and trying to shift the burden on proof on others to disprove your assertions. We both know well that we're talking about relatives, and that your claim to the absoluteness of your own ideas is all in your own head.

The concept of HLL evolves over time. This whole semantic bickering is totally pointless though and seemingly aimed at deflecting the points that are being made. HLLs allow you to think of things in terms of your problem, which makes you a better computer scientist in general... the whole point is to understand your problems, their characteristics, structure, and how the structure can be exploited on various kinds of computational architectures by creating automatic algorithms -- even ones that run on completely theoretical machines. Then, you analyse your solution and try to figure out if you could come up with something more competitive.

Counting your mallocs is, frankly, pathetic compared to that kind of transcendental thinking.


They are references, which while being similar to pointers, are not pointers. With references, you do not have access to actual memory locations, while pointers let you go where ever you want.

Yes, but this is not any different on any other modern language which is not C, C++ or something similar. Pointer arithmetic is a corner case which you never really need unless you really need it, and then you should be using C.


Java is not well suited to implementations of the MPI library as a consequence of this:

Somewhat non-issue. Java has its own mechanisms for implementing something like that, and if you really wanted to add support, it is conceivable it could be done on the VM level. Again, "use the right tool for the job", and I'm not awfully concerned about something like this as a computer science person who is more interested in the computational nature of problems instead of how to push bits from machine to machine.


Bjarne Stroustrup is fan of multi-paradigm programming:


Nothing wrong with multi-paradigm programming. You can write as much static code on Java as you like. Or, you can use another language.

I am not going to let you wave the emerging straw man that I would be claiming something as silly as saying that there isn't a whole computational universe outside Java, too..


Why am I the only one making citations here?

Because your claims are pretty easily disputed just as they are. As I said, you're pushing a point that is hard to defend, and just makes you seem like you're doing it because you lack the experience and have a narrow view of what solving problems computationally is like.

But if you insist.. :)

http://www.paulgraham.com/avg.html

pmasiar
April 6th, 2008, 06:41 PM
Very interesting discussion, and even if heated and opinionated, never descended to flamewars. Maybe we are learning something :-)

Shining Arcanine seems live valid addition to forum, bright, opinionated, informed. Often we look down on the low-bean posters, but Shining Arcanine is no noob.

I like also CptPicard answers. I like that he really tries to understand the position, listen, and answer on points, with calm, as is appropriate for a Captain of a Starship :-)

Both posters are smart and have points. Why I am with Captain? Of course, first reason is that Captain is always right :-)

I remember, in my junior year (but no, it was not in 60ties, I am not **that** old :-) ) , when I read book about software engineering process and talked to my mentor, I did not understand why he was NOT as excited as I was. Now I am as underwhelmed with such brave new theories as he was back then. Even if new is forgotten old.

Remeber these rules:

(1) In theory, there is no difference between theory and practice. In practice, there is.

(2) Show me person who does not appreciate 10 years of experience, and I show you person who lacks them.

(3) You have to go too far to learn how far you should go.

(4) Smart person learn from own mistakes. Cheap person learns from mistakes of others.

Nothing is as easy as promised, software is engineering, ie finding compromises while solving practical problems, withing constrainst of the real-life problem. The is no theory, only guess. No silver bullet, sorry to let you know. :-)

Can+~
April 6th, 2008, 07:57 PM
I think the discussion is far from objective. Mostly is about two different ways to solve a problem:

a) Shining Arcanine: screw garbage collection, make your own memory management, pointers are great, etc.
b) Cpt Picard: Use higher level language.

Shining, you should be more open to another language, C is great because you can code all your own methods of managing memory, but other people doesn't want, or doesn't have the time to do it. Sometimes, I just need a list which can hold different types of data, and I won't start building nodes with pointers to each other and build malloc-ing memory methods for each, I may just do a = ["foo", 2] on python.

But those are just opinions, if you like to build from scratch everything, go ahead, specially on the learning phase about the basics of programming. But when you need things done quickly or easier, you are better off with a higher level language that deals with all that and you just worry about other things, instead of fighting the damn "Segmentation Fault".

My opinion is, learn C to learn about the basics. Learn a high level so you don't have to worry about low level stuff, and actually solve the problem, instead of trying to build a whole set of libraries to start solving the problem, unless you're coding a kernel or something, or you have a specific way to allocate memory for some reason.
-By someone who likes both C and python.

CptPicard
April 6th, 2008, 08:34 PM
My argument really is deeper than just one of convenience. Sure, one of the big reasons is "not just bothering to code with mallocs", but it always ruffles my feathers when someone suggests that using HLLs is some sort of a cop-out -- the more inexperienced the programmer/computer scientist wannabe, the more open the attitude often is, because they have just learned to code in C on the low level and now they feel so very leet that they refuse to believe that something that doesn't hug the hardware could both be in some sense "easy" but also so intellectually challenging that it makes them feel like n00bs all over again.

Interestingly, I would dare throw down the gauntlet and and suggest that those who insist on bit-pushing the most are the most afraid to face up to their own theoretical inadequacy, and pump up the ego instead by coding with raw pointers, as if that had merits in itself. Unfortunately, C is not hard, so there is nothing to brag about. Problems, analysis and algorithms are.

The big drop-out numbers in CS happen at around the time when the first (real, not some undergrad intro) Theory of Computation class comes around. Also, when these same wannabes who drop out at that point meet their first HLL that isn't a 1:1 mapping on actual concrete operations on the machine, they break down and weep.

As for more citations, I could list a bunch of CS textbooks in my bookshelf. There is actually no code in most of them, unless it is some fragment of pseudocode. But mostly it's just math -- you're supposed to figure out the implementation in your language of choice yourself... and certainly if I get the choice I'm not going to start fooling around with memory allocation when the real challenge is to get the algorithm right and working.

Shining Arcanine
April 6th, 2008, 10:06 PM
CptPicard, if you are entranced with the latest and greatest programming languages, why are you attempting to argue their virtues with a college sophomore? Should you not be applying them to the real world problems you are attempting to solve?

I will continue to write in my "low level languages" thankful that I do not have to rewrite my programs everytime I need to move to another computer architecture like one does when one writes programs in a real low level language. Please continue writing code in your "high level languages." I am sure that in 20 to 30 years, we will see whose approach was more successful.

CptPicard
April 6th, 2008, 10:20 PM
Too bad it seems like you are not interested in even trying to be receptive to what I am trying to tell you. I am arguing with a college sophomore because the said college sophomore was very eager to push a point, which I as a more experienced person consider immature as far as a person's evolution as a computer scientist goes. Therefore, as the college sophomore seemed like worth my time and honest piece of my mind, I spent a lot of time clarifying what exactly is wrong with his position. To no avail, apparently.

Best of luck with this attitude with your teachers at university. :)

And yes, trust me, I intend to keep on making use of the best tools available for a given problem. You will give up on your blinders eventually, too, if you stay in the field. I simply expect you to be able to raise your game.

pmasiar
April 6th, 2008, 10:20 PM
I read somewhere nice analogy between architecture and programming.

Programmers can, and sometimes are expected, to hold in their mind multiple abstraction levels, and solve problems in appropriate level, and with little guidance beyond experience and gut feeling, no strict rules, little tools to help manage all those complexity layers. One statement of SQL or single click on a web form can result in many billions CPU instructions on multiple computers.

While in architecture, there are many different occupations, each taking many years to study, and many with "codes" and rules how to manage it's own layer of complexity: From bottom up: Physicist, chemicist and material scientist study different sides of particles, then manufacturer produces raw materials, builder builds building according to architect's plans (with plumber, elecricians, painters, interior designers work each on it's part) and according to fire code and city building standards, as defined by civic engineer and zoning comission, financed by banks. Quite a lot of layers, each with specific skills, regulations, trade organizations.

So it is foolish to reject useful abstraction and uncesessarily look how it is done at the CPU level - architect does not worry about chemical bindings in material, it ie just requires to use material passing regulation for fire code.

Abstractions are good, they allow us to solve problems.

Chayak
April 6th, 2008, 10:58 PM
From reading the discussion again I can honestly say that I agree with both CptPicard and Shining Arcanine. There are times when you need to delve into the internals and micromanage every aspect of your code. It has it's uses paricuallry when working with limited space and memory. Do things take longer at lower levels, yes, is their times when you need to pay attention to such detail? Yes. There are reasons things like flight software for satellites and aircraft are written in languages like C and Ada. Would I need to write an email program in Ada? That would be overkill in my book.

As for higher level languages there are just as many applications for which they are well suited. Do you need to process masses of text and put the results in a database? I use python for that quite a bit as the code is quick to write and I can get on with other work. Do I think writing a C program and paying attention to memory management in such a situation overkill? Absolutely.

I've always wondered about the whole 'elite' and 'fanatic' mentality that some programmers have for their language. The same thing about operating systems. I know it's human nature to want to feel that you are better than someone else but look at it this way. You can't use a philips screwdriver for every task. I look at programming languages, software, and operating systems the same way. Everything has it's strengths and weaknesses so why be so attatched to your screwdriver when you could pick up another tool and do a task much easier?

That's just my 2 cents so feel free to ignore me if it seems crazy to you.

Shining Arcanine
April 6th, 2008, 10:59 PM
I read somewhere nice analogy between architecture and programming.

Programmers can, and sometimes are expected, to hold in their mind multiple abstraction levels, and solve problems in appropriate level, and with little guidance beyond experience and gut feeling, no strict rules, little tools to help manage all those complexity layers. One statement of SQL or single click on a web form can result in many billions CPU instructions on multiple computers.

While in architecture, there are many different occupations, each taking many years to study, and many with "codes" and rules how to manage it's own layer of complexity: From bottom up: Physicist, chemicist and material scientist study different sides of particles, then manufacturer produces raw materials, builder builds building according to architect's plans (with plumber, elecricians, painters, interior designers work each on it's part) and according to fire code and city building standards, as defined by civic engineer and zoning comission, financed by banks. Quite a lot of layers, each with specific skills, regulations, trade organizations.

So it is foolish to reject useful abstraction and uncesessarily look how it is done at the CPU level - architect does not worry about chemical bindings in material, it ie just requires to use material passing regulation for fire code.

Abstractions are good, they allow us to solve problems.
I love SQL. When I was in High School, I was able to solve many problems by using SQL and create fast solutions (relative to using binary files). I had a pokemon fan site (which is still online, although it has not been updated for a few years) that had a pokedex, which stores and retrieves information regarding various pokemon in a fashion useful to people playing the pokemon video games. One problem I encountered when working on it involved finding all of the possible matings (with the shortest possible path length) between various pokemon that would produce a given pokemon with a given trait that could only be obtained through mating. There are various rules regarding how pokemon mate, so solving this problem was more complex than the problem of finding all paths with the shortest possible path length between two vertices in a graph, especially when implementing its solution with a server side script that could be accessed by dozens, if not hundreds of people at any given time and dealing with over 10,000 vertices, but I was able to do it by using a clever MySQL database design and multiple levels of caching. To my knowledge, my website is still the only one on the internet that implements this solution in a server side script.

The solution is still online if anyone is interested:

http://www.pokedex.net/

Just click on any pokemon and then any of its moves to receive the list of all of the shortest possible matings that produces that pokemon with that given move in the pokemon video games. I recommend an egg move, as those are the ones that pokemon are typically mated to have.

This is why whenever someone is interested in learning to create dynamic web pages, I always recommend PHP and MySQL, although I typically omit mention of MySQL until after they are familiar with PHP. My interest in program efficiency started when I was working on the above problem.

By the way, I apologize in advance if anyone has trouble accessing the site right now. My host (A Small Orange) is having name server issues, which is causing outages for many of their customers, but they are fairly good at taking care of those problems, so I expect it to be resolved shortly.

pmasiar
April 6th, 2008, 11:39 PM
You seems to be smart and thinking programmer, Shining Arcanine.

Now when you learn to trim when quoting, so we can see to which part you respond, I will like you even more :-)

Welcome at the forum. You will learn that many people have bias based on their experience, mine is web based app, and suggesting Python for beginners. Seems like your interests are closer to the metal, that's fine too.

If you want to blow your mind about what is possible close to metal, take a look at Forth, or it's new variant, Factor.

LaRoza
April 7th, 2008, 01:15 AM
I guess it's what you want to do in the future as well. If you want to work in satellite, spacecraft, or flight programming Ada or C is the standard. Just an example.

I know Lisp has been used. I can't find the link, but I read something of someone debugging code 100,000 miles away while it was running, and it was Lisp.

CptPicard
April 7th, 2008, 01:20 AM
It was Deep Space 1:

http://www.flownet.com/gat/jpl-lisp.html

Where there are extreme survivability requirements is another domain where I really wouldn't be doing C. Way too uncontrolled and bug prone. Anything that you can do something like automatic verification on would be far preferable.

(EDIT: W00t, my thanks per post ratio is already over 10% ;) )

LaRoza
April 7th, 2008, 01:25 AM
It was Deep Space 1:

http://www.flownet.com/gat/jpl-lisp.html

Where there are extreme survivability requirements is another domain where I really wouldn't be doing C. Way too uncontrolled and bug prone. Anything that you can do something like automatic verification on would be far preferable.

Thanks. I was off, it was 100.000.000 miles, not 100.000 as I stated.