PDA

View Full Version : Language Hopping



emobrad
October 6th, 2008, 04:06 PM
A language hopper is someone who will start to "learn" a language, and get a feel of the language, then switch to a new language. Someone who thinks the more languages they know the better they are suited for the real world. I notice that a lot of people will do this mainly because they want to "know" everything.

But in fact, they're missing many important parts of a language. There is a difference between language hopping, and language testing.

Language testing is just learning a few things to see if you'd like to continue the language, as opposed to learning the basics to say you have some knowlage of the language.

Language hopping is mainly caused by a few things.
1) Wanting of speed.
2) The thought that the more languages you know, the better programmer you are.
3) One language is "too hard" so the other languages would be easier.

And all 3 of these have been proven to make for very inefficiant programmers.

So now that you know my feelings on this topic, what do you fellow borgs and gorgs (girl borgs) think about this subject?

pmasiar
October 6th, 2008, 04:41 PM
http://norvig.com/21-days.html - Teach Yourself Programming in Ten Years. 'nuff said 8-)

LaRoza
October 6th, 2008, 04:48 PM
So now that you know my feelings on this topic, what do you fellow borgs and gorgs (girl borgs) think about this subject?
Borg is Borg, there are no gender distinctions. "Borgs" don't exist. There is the Borg (me), and Borg drones.

DrMega
October 6th, 2008, 04:58 PM
A programming language is just a specific implementation of a set of "rules" that apply to pretty much all lanaguages, so once you've mastered one language, you're already half way to mastering the rest.

Being a good programmer is not about knowing every single function in a particular language, it is about being able to translate a real world requirement into a set of algorithms, and then being able to choose the most suitable language(s) to implement those algorithms, and then doing it, often learning as you go on.

I've been programming now for 21 years years, the last of 13 of which professionally, but I still have huge amounts to learn about specific languages and platforms. I reckon if I stay in this job until I retire, I will still be learning as I go along.

emobrad
October 6th, 2008, 05:08 PM
Borg is Borg, there are no gender distinctions. "Borgs" don't exist. There is the Borg (me), and Borg drones.


Yes, I know this, and that's why I put it, just for poops and giggles.

CptPicard
October 6th, 2008, 05:17 PM
Being cynical, the "other languages are too hard" reason seems to be very prevalent, especially if someone hops all the time. You should be able to settle down pretty quickly into your first language.

emobrad
October 6th, 2008, 05:17 PM
A programming language is just a specific implementation of a set of "rules" that apply to pretty much all lanaguages, so once you've mastered one language, you're already half way to mastering the rest.

Being a good programmer is not about knowing every single function in a particular language, it is about being able to translate a real world requirement into a set of algorithms, and then being able to choose the most suitable language(s) to implement those algorithms, and then doing it, often learning as you go on.

I've been programming now for 21 years years, the last of 13 of which professionally, but I still have huge amounts to learn about specific languages and platforms. I reckon if I stay in this job until I retire, I will still be learning as I go along.

And that's exactly my point. I understand what you're saying about having to know a few other languages. But what I'm saying, is someone who decides to start learning Java, and gets sick of Java for some reason, or decides "I've learned enough of this language and I want a new one because I'll be a better programmer" when they know nothing of the language besides maybe basic I/O or something such as that. I'm not saying "Pick one language, and never change" because that's rediculous. A language is nothing more than a tool, but learn how to use the tool before you decide to get a new one.

You don't see carpenters buying a type of table saw and not learning how to use it because they want to use a drill. (Bad analogy but you get the picture I hope)

Sinkingships7
October 6th, 2008, 05:31 PM
I'm not saying "Pick one language, and never change" because that's rediculous. A language is nothing more than a tool, but learn how to use the tool before you decide to get a new one.

+1
Very true.

pp.
October 6th, 2008, 05:53 PM
learn how to use the tool before you decide to get a new one.

Learn how to saw before you decide to get a needle?

DrMega
October 6th, 2008, 06:37 PM
Learn how to saw before you decide to get a needle?

It would take a very long time to saw a piece of wood up using a needle:)

danbuter
October 6th, 2008, 06:42 PM
I "language-hopped" for the first year or so, mainly as I just wasn't sure what would fit my needs. Now I just use Ruby, as it fits me the best.

slavik
October 6th, 2008, 06:45 PM
I "language-hopped" for the first year or so, mainly as I just wasn't sure what would fit my needs. Now I just use Ruby, as it fits me the best.
IMO, you should pick a paradigm that works very well for the specific set of problems you want to solve (or the few that you are interested in) and start learning the major languages in that field. Once you start feeling like you know everything, try to learn the basics of other languages following the same paradigms.

pmasiar
October 6th, 2008, 07:02 PM
A programming language is just a specific implementation of a set of "rules" that apply to pretty much all lanaguages, so once you've mastered one language, you're already half way to mastering the rest.

Yes, but it is true only inside same family of languages. When you learn one of C, C++, Java, C#, learning others is trivial, but it hardly helps you to learn Lisp, Forth, or Prolog, or even any of (Python, Perl, Ruby).

Languages are in families, but there are huge differences between families. To avoid being blob programmer should learn languages from different families. And yes, there are huge differences between them - but invisible for a blub programmer who knows one family and thinks he knows them all.

LaRoza
October 6th, 2008, 07:10 PM
IMO, you should pick a paradigm that works very well for the specific set of problems you want to solve (or the few that you are interested in) and start learning the major languages in that field. Once you start feeling like you know everything, try to learn the basics of other languages following the same paradigms.

I would recommend learning other paradigms after learning one very well. No point in learning the same thing over and over with a possibly different syntax and standard library.



Languages are in families, but there are huge differences between families. To avoid being blob programmer should learn languages from different families. And yes, there are huge differences between them - but invisible for a blob programmer who knows one family and thinks he knows them all.

"U" key stuck? :-)

DrMega
October 6th, 2008, 07:28 PM
Yes, but it is true only inside same family of languages. When you learn one of C, C++, Java, C#, learning others is trivial, but it hardly helps you to learn Lisp, Forth, or Prolog, or even any of (Python, Perl, Ruby).

Languages are in families, but there are huge differences between families. To avoid being blob programmer should learn languages from different families. And yes, there are huge differences between them - but invisible for a blob programmer who knows one family and thinks he knows them all.

A for loop is still a for loop regardless of syntax. An If, Else, Endif block is still conditional on boolean logic whether you enclose the blocks in braces or named tokens or whatever. My point is that once you know that a program is a big collection of conditional statements, boolean logic, IO functions and operators etc, and you know how each of these constructs works, then it is just a case of learning the syntax to make that happen in whatever language.

LaRoza
October 6th, 2008, 07:38 PM
A for loop is still a for loop regardless of syntax. An If, Else, Endif block is still conditional on boolean logic whether you enclose the blocks in braces or named tokens or whatever. My point is that once you know that a program is a big collection of conditional statements, boolean logic, IO functions and operators etc, and you know how each of these constructs works, then it is just a case of learning the syntax to make that happen in whatever language.

That doesn't quite work in all paradigms. A C++ programmer could learn the syntax of Haskell quite quickly, but trying to program as if it were C++ would fai.

pp.
October 6th, 2008, 08:01 PM
once you know that a program is a big collection of conditional statements, boolean logic, IO functions and operators etc, and you know how each of these constructs works, then it is just a case of learning the syntax to make that happen in whatever language.

Do that, and you're bound to write Basic programs in C++, Assembly, Prolog, Forth, Lisp, Python, Neuf, REXX, COBOL, PostScript, BASH, JCL and so forth.

DrMega
October 6th, 2008, 08:05 PM
That doesn't quite work in all paradigms. A C++ programmer could learn the syntax of Haskell quite quickly, but trying to program as if it were C++ would fai.

I never suggested that you can use one language as though it is another. My point is you can't call yourself a programmer if all you can do is cobble code together. To be a programmer you need to understand the various constructs which apply in pretty much every language. You then design an algorithm which could be implemented in pretty much any language (you might do that stage in your head). You then must implement that in whatever language.

If you were my boss and you asked me to write a routine that adds up all the numbers from 1 to 100, and he wanted it doing a language I'd never used before, I would still know that I need a for loop and so all I'd need to do is learn the specific syntax of that language.

Over the course of my career, I've had to switch languages a few times, and not within the same "family" of languages. Each time I've had to, I didn't have to re-learn what a variable was, or what boolean logic was, or what a while loop would be used for.

pp.
October 6th, 2008, 08:10 PM
If you were my boss and you asked me to write a routine that adds up all the numbers from 1 to 100, and he wanted it doing a language I'd never used before, I would still know that I need a for loop

Pfui!

What do you do if that language does not have any FOR loops? And why would you use any kind of iteration for that problem?



I didn't have to re-learn what a variable was, or what boolean logic was, or what a while loop would be used for.

Variables in Assembly, XSLT and Prolog the same?

DrMega
October 6th, 2008, 08:10 PM
Do that, and you're bound to write Basic programs in C++, Assembly, Prolog, Forth, Lisp, Python, Neuf, REXX, COBOL, PostScript, BASH, JCL and so forth.

Ok. All these years I've been writing perfectly good, well structured, efficient, readable, modular code and getting paid for doing so, and I've been doing it wrong for all these years. I must tell my boss tomorrow and volunteer for a sizeable pay cut as penance.

mssever
October 6th, 2008, 08:11 PM
If you were my boss and you asked me to write a routine that adds up all the numbers from 1 to 100, and he wanted it doing a language I'd never used before, I would still know that I need a for loop and so all I'd need to do is learn the specific syntax of that language.
Why would you need a for loop for that in Python?

print sum(xrange(1,101))The point is, even some most "basic" parts of one language aren't necessarily so basic to another.

Reiger
October 6th, 2008, 08:18 PM
IMO, you should pick a paradigm that works very well for the specific set of problems you want to solve (or the few that you are interested in) and start learning the major languages in that field. Once you start feeling like you know everything, try to learn the basics of other languages following the same paradigms.

However, if you are a beginning programmer you are very likely not to know... what (a) a programming paradigm is; (b) how these relate to efficient programatical problem-solving (so likely unable to decide which paradigm fits your problem most); (c) what you are talking about in the first place ('deeper' meaning, not just the dry semantics of the words).

Basically: if you didn't know the difference between a sledgehammer, a drill, a saw and a needle; how would you decide what tool you needed to fasten a button with?

pp.
October 6th, 2008, 08:19 PM
Ok. All these years I've been writing perfectly good, well structured, efficient, readable, modular code and getting paid for doing so, and I've been doing it wrong for all these years. I must tell my boss tomorrow and volunteer for a sizeable pay cut as penance.

We won't tell your boss if you don't. After all, he can't be expected to judge the quality of your code, being a boss.

You claimed that it was just a matter of applying the syntax of another language in order to solve the same problem in that other language. This is somewhat true for closely related languages. It is not true at all for languages which build on very different sets of paradigms.

With truly different languages properly used you'll get not just notational variants of the same program but structurally and qualitatively different programs. Just compare RPG to Prolog, for instance.

DrMega
October 6th, 2008, 08:23 PM
You claimed that it was just a matter of applying the syntax of another language in order to solve the same problem in that other language.

No I didn't.

pp.
October 6th, 2008, 08:27 PM
No I didn't.

No? That's how I read


My point is that once you know that a program is a big collection of conditional statements, boolean logic, IO functions and operators etc, and you know how each of these constructs works, then it is just a case of learning the syntax to make that happen in whatever language.

Please forgive if I've misread that and some similar statements.

LaRoza
October 6th, 2008, 08:31 PM
I never suggested that you can use one language as though it is another. My point is you can't call yourself a programmer if all you can do is cobble code together. To be a programmer you need to understand the various constructs which apply in pretty much every language. You then design an algorithm which could be implemented in pretty much any language (you might do that stage in your head). You then must implement that in whatever language.

I see your point now.



If you were my boss and you asked me to write a routine that adds up all the numbers from 1 to 100, and he wanted it doing a language I'd never used before, I would still know that I need a for loop and so all I'd need to do is learn the specific syntax of that language.
What if that language didn't have a for loop? What if it didn't have variables? (Haskell's variables can't change values, Fortran doesn't have for loops)

Also, scheme wouldn't use a loop most likely, but recursion.

DrMega
October 6th, 2008, 08:33 PM
No? That's how I read



Please forgive if I've misread that and some similar statements.

What that says is that just about every language has similar constructs (albeit syntactly different), so as long as you know how to program in one language, you don't have to re-learn from scratch when you switch to another.

Or are you saying that for each individual language you do have to re-learn from scratch? Are you telling me that knowing that an integer variable in C is a place to store an integer, you then have to find out what an integer is and what a variable is if you decide you have to do something similar in Fortran? That must take you a long time.

DrMega
October 6th, 2008, 08:40 PM
What if that language didn't have a for loop?

T-SQL doesn't have a for loop. There is very rarely a need for one (in fact there'd never been a need for one in a perfectly structured fully normalised database, but when forced to occassionally work with legacy systems, the need occassionally arises to use a for loop. In that situation you just have to remember that a for loop is fundamentally just a while loop (in a for loop you are incrementing a counter, and looping while that counter is above or below some defined threshold).


What if it didn't have variables? (Haskell's variables can't change values, Fortran doesn't have for loops)

A variable is, by definition, variable. I've never used Haskell but it doesn't sound much use if it doesn't have variables (unless it is some sort of data manipulation language like SQL - even many implementations of SQL have variables).

soxs
October 6th, 2008, 08:43 PM
If you were my boss and you asked me to write a routine that adds up all the numbers from 1 to 100, and he wanted it doing a language I'd never used before, I would still know that I need a for loop and so all I'd need to do is learn the specific syntax of that language.

Wrong, you just need one simple formula: (n*(1+n))/2 where n in your case is 100 :-P
[A little offtopic though]

pmasiar
October 6th, 2008, 08:45 PM
A for loop is still a for loop regardless of syntax.

Really? What would be simple obvious replacement of FOR loop syntax in Prolog? How would assignment look like in XLST, which does not have variables?

Your experience is quite obviously limited to Algol family of languages (Java and friends). You should learn something different - start with Prolog 8-)

DrMega
October 6th, 2008, 08:46 PM
Wrong, you just need one simple formula: (n*(1+n))/2 where n in your case is 100 :-P
[A little offtopic though]

That's great if your maths skills are any good. I wouldn't have known that forumala. It's kind of not the point I was trying to get at though.

Greyed
October 6th, 2008, 08:48 PM
A for loop is still a for loop regardless of syntax.

Uhm, I presume you do realize that this is wrong? There is a decided difference between for in C vs. for in Python. Of course a Perl programmer would know the difference as clear as the difference between for and foreach. A person who knows all three (well, 2 and 1 at a very basic level) would know why there is the difference and why Python doesn't have a C-style for; nor why it is missed.

If anyone is truly interested I can be pedantic on the topic but will stop there.

pp.
October 6th, 2008, 08:56 PM
What that says is that just about every language has similar constructs (albeit syntactly different), so as long as you know how to program in one language, you don't have to re-learn from scratch when you switch to another.

Or are you saying that for each individual language you do have to re-learn from scratch? Are you telling me that knowing that an integer variable in C is a place to store an integer, you then have to find out what an integer is and what a variable is if you decide you have to do something similar in Fortran? That must take you a long time.

In closely related languages you obviously can re-use much of what you have learned for one language in others. That's a bit of a tautology, because that is what makes them 'closely related'.

Your very simple example also serves to show the boundaries of seemingly transferable knowledge. There are indeed languages where a variable is not 'just a place to store things', while the expected behaviour of integers might not be apply to the next language you are going to learn.

Of course, some concepts are bound to appear in most if not all programming languages, and the problem solving skills learned in n languages may improve your speed in acquiring such skills for the n+1th language. There are pitfalls, however, especially for the experienced programmer of n languages.

DrMega
October 6th, 2008, 08:56 PM
I've had a top idea.

Next time we have to write or modify a program, why don't we all get so bogged down in syntax that we lose sight of what it is we're trying to make it do? Then we can pat ourselves on the back and tell ourselves that its OK that our program doesn't actually do anything, because at least we've defended our precious syntax differences by not using a single for loop, variable, if statement, IO function or anything, because had we done so we'd have been getting dangerously close to realising that different languages have similar constructs, and that just wouldn't do.

Reiger
October 6th, 2008, 08:56 PM
Haskell doesn't have destructive updates. Essentially that is the fundamental difference between Imperative and (Pure) Functional programming languages. Also: Functions are first class citizens, so you can pass functions (methods?) for arguments to other functions.

Now to say that doesn't sound like much (only) goes to show how little you know about functional programming. Filter all (relative) primes from a (sorted) list with 3 trivial lines of code:


primes (x:xs) = x : ( primes $ filter (`isRelativePrimeTo` x) xs )
primes x = x

isRelativePrimeTo = \x y -> x `mod` y /= 0


Example:


primes [2..] -- outputs all absolute primes. Infinite complexity ;)
primes [2,3,4,8,9,10] -- outputs: [2,3]


A similarly interesting XSLT example:

Sort a list of things in what is essentially a linkedlist of <div></div> elements. If you picture a linkedlist (which I'm sure your familiar with, it being one of the prime examples of cross-language data structures?) as being a row of boxes in which "left" points towards an item, and "right" points towards a trailing list as seen from the current 'position'...


<xsl:template name="divider" match="*">
<xsl:param name="num" />
<xsl:variable name="item" select="./*[position() = $num]" />
<div class="left">
<div class="left">
<xsl:copy-of select="$item" />
</div>
<xsl:if test="./*[last()] != $item">
<div class="right">
<xsl:call-template name="divider" select=".">
<xsl:with-param name="num" select="$num + 1" />
</xsl:call-template>
</div>
</xsl:if>
</div>
</xsl:template>


With some CSS this will (without the need of cumbersome & incompatible tables) give you an LTR row of items from a node-set.

LaRoza
October 6th, 2008, 08:59 PM
A variable is, by definition, variable. I've never used Haskell but it doesn't sound much use if it doesn't have variables (unless it is some sort of data manipulation language like SQL - even many implementations of SQL have variables).

Actually, it isn't at all a hinderance once you get used to the style. It is a pure functional language and has isn't at all anything like what most people are used to.

Consider that xmonad, the wm I use, is written in Haskell and all its configuration files are in Haskell, it is not all at limitted by it.

I suggest, if you are interested, looking at my wiki on Haskell. It is worth learning just to get a mind expansion.


Wrong, you just need one simple formula: (n*(1+n))/2 where n in your case is 100 :-P
[A little offtopic though]

Interesting.


Uhm, I presume you do realize that this is wrong? There is a decided difference between for in C vs. for in Python. Of course a Perl programmer would know the difference as clear as the difference between for and foreach. A person who knows all three (well, 2 and 1 at a very basic level) would know why there is the difference and why Python doesn't have a C-style for; nor why it is missed.

Or in Fortran 77, where there are no loops (in the standard) and one must write them manually, with structured programming designs and goto's.

pp.
October 6th, 2008, 09:06 PM
I've had a top idea.

Next time we have to write or modify a program, why don't we all get so bogged down in syntax that we lose sight of what it is we're trying to make it do? Then we can pat ourselves on the back and tell ourselves that its OK that our program doesn't actually do anything, because at least we've defended our precious syntax differences by not using a single for loop, variable, if statement, IO function or anything, because had we done so we'd have been getting dangerously close to realising that different languages have similar constructs, and that just wouldn't do.

You are mostly right if you refer to similar languages. Your sarcasm is wide off the mark once you realise that different programming languages can lead you to widely different algorithms. Those are differences which are very fundamental to the solution, and not only trivial notational variants of the same solution.

Kind of trivial example: In Basic, you use an iteration verb to iterate over a set of values plus some more verbs to perform some calculation on each of those values. In SQL, you describe your result as a set of tuples and a couple of operators to denote individual values in that tuple. If you perceive those paradigms as equivalent, you're giving away most of the power of having different tools at your disposal.

Maslow. To one with a hammer, all problems are as nails.

Canis familiaris
October 6th, 2008, 09:06 PM
Interesting.

It's based on a very clever algorithm:
Say


1 100 = 101
2 99 = 101
3 98 = 101
4 97 = 101
.. .. = 101
50 51 = 101
.. .. = 101
99 2 = 101
100 1 = 101

Precisely done 100 times twice over.
So 101 is added 100 times i.e. 101 * 100. Since it has been done twice.
It has to be divided by 2.
So (101*100)/2 = 5050

So in terms of n is (n*(n+1))/2.

Even if you want to use for loop, you'll have an efficient one. :P

LaRoza
October 6th, 2008, 09:07 PM
Maslow. To one with a hammer, all problems are as nails.

And if a person only deals with nails that is fine, but exploring other options is good for the mind I think.

pp.
October 6th, 2008, 09:08 PM
(n*(n+1))/2

Atributed to Gauss at a very tender age.

DrMega
October 6th, 2008, 09:14 PM
Or in Fortran 77, where there are no loops (in the standard) and one must write them manually, with structured programming designs and goto's.

That's kind of the point I was getting at, but everyone is so hung up on language specific terminology that they can't comprehend such concepts. You can make a for loop in any language provided that you can have a variable to use as a counter, conditional statements and some means of jumping programmatically to a designated point in the program. If that means you have to manually increment your counter, test it, and using a goto, then so be it. If you need to make a for loop, you can. If you needed to output every integer between 1 and 100 you wouldn't make 100 lines of code to write out each line would you?

Anyway, that's me out of this thread. Everyone can rest easy knowing that their particular language is unique and special and can do things that no other language in the whole world can do, even though it doesn't have any for loops or variables in it (because they have different names and are implemented in a different way).

nvteighen
October 6th, 2008, 09:18 PM
Also, scheme wouldn't use a loop most likely, but recursion.

Yup... a tail-recursion.

Language hopping is IMO very much related to a false impression on what programming is. Say a "language hopper" wants to code 3D games... and he reads that C++ is used for that... Then, logically he goes for C++ and crashes into the great ocean of STL, OOP, etc. etc. etc. and gets frustrated, makes some posts in UF's PT and then, he decides to go for <x> language... but his/her goal are 3D games and that <x> language was adviced to him/her because it would tell the "hopper" to program... so it gets frustrated and tries another language... and another... and finally he/she will certainly step down... unless some gentle souls shows him/her that programming is about modelling "real world knowledge" in some paradigm by using a logical language... and that expression power is a key for having that "real world knowledge" better reflected into the chosen paradigm.

Of course, you first need to know how to program. And, as we can't program without a programming language (even pseudocode qualifies as one for this purpose!), you need to learn a first programming language by the same time you learn to program. That's why the first language is that much harder than the rest. After having learned how to program and how to program in your first language, you should move on to a language that offers you something else you need or just want to learn. And in some certain moment, you'll start noticing common patterns among many programming languages, you'll recognize families, paradigms, etc. but that's a second step, IMO.

Canis familiaris
October 6th, 2008, 09:18 PM
Or in Fortran 77, where there are no loops (in the standard) and one must write them manually, with structured programming designs and goto's.
By recursion, I suppose?


(n*(n+1))/2

Atributed to Gauss at a very tender age.

Mighty Brilliant he was.

Reiger
October 6th, 2008, 09:25 PM
Talk about inefficient:


fib 0 = 1
fib 1 = 1
fib n = (fib (n-1)) + (fib (n-2))


Will have exponential complexity. So if you wanted to know:


fib (10^100)


Your PC would be running for, ehrm, quite a while. (Longer than the life-time of the universe, anyways.)

Can be substantially improved by:


pheidias = ((*0.5) $ 1+s5, (*0.5) $ 1-s5)
where
s5 = sqrt 5

phi = fst pheidias
phid = snd pheidias

fibprog z i m = (p*) $ floor $ (i*phi^r - m*phid^r) / sqrt 5 + 0.5
where
e = expon z
r = fst e
p = snd e

expon k
| k <0 = ((-k),(-1)^(-k))
| otherwise = (k , 1)

fibonacci = \k -> fibprog k 1 1


(It does slightly more than required because it'll also allow you to work with negative indices for the fibonacci sequence.)

This has (only) a linear complexity, which depending on the underlying implementation of the (^) function will be improved to as little as logarithmic complexity.

Incidentally: just tested: fibonacci sequence number (10^100 aka Gogol) is:


17976931348623159077293051907890247336179769789423 06572734300811577326758055009631327084773224075360 21120113879871393357658789768814416622492847430639 47412437776789342486548527630221960124609411945308 29520850057688381506823424628814739131105408272371 63350510684586298239947245938479716304835356329624 224137216

To compute it, takes the GHCi:


(0.01 secs, 525008 bytes)

pp.
October 6th, 2008, 09:25 PM
... hung up on language specific terminology that they can't comprehend such concepts. You can make a for loop in any language provided that you can have a variable to use as a counter, conditional statements and some means of jumping programmatically to a designated point in the program.

That's perfectly true. Since there are 'true' programming languages which do not meet all of the conditions you mention, there are indeed languages in which it is not possible to implement a for loop.


If that means you have to manually increment your counter, test it, and using a goto, then so be it.

You can do some very powerful programming using very ancient and feeble languages, if you have to. One of the masters of that art used to be Michael Jackson, a British software design gurus of the late-ish seventies, I believe.

LaRoza
October 6th, 2008, 09:27 PM
By recursion, I suppose?

No. Functions cannot be recursive in Fortran 77.

Canis familiaris
October 6th, 2008, 09:29 PM
No. Functions cannot be recursive in Fortran 77.

Conditions and GOTO then? If not How then?

Reiger
October 6th, 2008, 09:29 PM
Of course, you first need to know how to program. And, as we can't program without a programming language (even pseudocode qualifies as one for this purpose!), you need to learn a first programming language by the same time you learn to program. That's why the first language is that much harder than the rest. After having learned how to program and how to program in your first language, you should move on to a language that offers you something else you need or just want to learn. And in some certain moment, you'll start noticing common patterns among many programming languages, you'll recognize families, paradigms, etc. but that's a second step, IMO.

Yup. AND That's why you should have (to do) <insert_boring_time-consuming no-mental-attention-required_thing_here /> -- it'll give you time to think about your programs. And it really works well to have your concept written out first (not tested) and only then program it. (If we're talking first language.) It will help you develop a 'method to the madness'.

LaRoza
October 6th, 2008, 09:30 PM
Conditions and GOTO then? If not How then?

Yes.

There are also sometimes non standard loops built into different compilers for it, but I never use them.

pp.
October 6th, 2008, 09:32 PM
By recursion, I suppose?

I don't know about Fortran 77, but in other languages of comparable age recursion was utterly impossible to do.

The 'goto' is an instruction which causes the processor to start executing code at a particular location in memory. In the 'seventies (I think) the 'goto' instruction was declared to be the root of all evil, and 'structured programming' the latest of all programming paradigms.

Some clever people then proceeded to show how you could do some very clean and powerful constructs such as 'structured programming' and 'inverted structures' by using not only the lowly 'goto' but also his evil step brother, the computed goto.

pmasiar
October 7th, 2008, 02:31 AM
why don't we all get so bogged down in syntax that we lose sight of what it is we're trying to make it do? ...because at least we've defended our precious syntax differences by not using a single for loop, variable, if statement, IO function or anything,

Your sarcasm is misplaced. Differences between families of languages is not in syntax but in semantics. They manipulate different kind of objects in a different way, but you, from your position of ignorance, cannot admit you don't know any non-algol language.

Here, if you are such super-expert, show me loops in http://en.wikipedia.org/wiki/Prolog : print numbers 1..10. Trivial, right? As Linus says, talk is cheap - show us the code 8-)

emobrad
October 7th, 2008, 03:27 AM
Language hopping is IMO very much related to a false impression on what programming is. Say a "language hopper" wants to code 3D games... and he reads that C++ is used for that... Then, logically he goes for C++ and crashes into the great ocean of STL, OOP, etc. etc. etc. and gets frustrated, makes some posts in UF's PT and then, he decides to go for <x> language... but his/her goal are 3D games and that <x> language was adviced to him/her because it would tell the "hopper" to program... so it gets frustrated and tries another language... and another... and finally he/she will certainly step down... unless some gentle souls shows him/her that programming is about modelling "real world knowledge" in some paradigm by using a logical language... and that expression power is a key for having that "real world knowledge" better reflected into the chosen paradigm.

Of course, you first need to know how to program. And, as we can't program without a programming language (even pseudocode qualifies as one for this purpose!), you need to learn a first programming language by the same time you learn to program. That's why the first language is that much harder than the rest. After having learned how to program and how to program in your first language, you should move on to a language that offers you something else you need or just want to learn. And in some certain moment, you'll start noticing common patterns among many programming languages, you'll recognize families, paradigms, etc. but that's a second step, IMO.

^^^^ This == Win

Many people start a programming language and get frustrated that it's "taking too long to learn" and just quit and move onto a different language with a shorter syntax, without stopping to think what they actually want to do with their programs, and don't truly have the motivation to become a full fledged programmer

Greyed
October 7th, 2008, 03:43 AM
They manipulate different kind of objects in a different way, but you, from your position of ignorance, cannot admit you don't know any non-algol language.

Heck, he made mistakes even within algol languages.

emobrad
October 7th, 2008, 04:12 AM
Well, I didn't intend to make this thread for language bashing, just a descussion on your thoughts of language hopping.

I do understand what you're saying when you guys are saying "What would you do if there's a language that doesn't have any for loops or any loops at all", and if you have to do a program in a language that doesn't have those, well then I suppose you'd have to learn how to make the same thing happen without the loop. But what I think that DrMega and others are saying is that programming isn't about the language you use, it's about making the program work in whatever language you choose to use. Basically saying "Don't only learn one 'all purpose language', but learn multiple languages for different uses". You just use the best language for whatever you're trying to get acomplished. I mean nobody would program an OS in Java. And if they did, well then that OS would be a VERY slow OS

pmasiar
October 7th, 2008, 04:22 AM
but everyone is so hung up on language specific terminology that they can't comprehend such concepts.

No, it's **you** hung up on your lack of understanding of even **existence** of languages different from C/Algol family you already know. You did not even bothered to follow the link I provided you - because you know your arguments failed.

> You can make a for loop in any language provided that you can have a variable to use as a counter, conditional statements and some means of jumping programmatically to a designated point in the program.

But some language lack either. And you refuse to read wikipedia page and learn that. What a seasoned expert wannabe are you!

> Everyone can rest easy knowing that their particular language is unique and special and can do things that no other language in the whole world can do, even though it doesn't have any for loops or variables in it (because they have different names and are implemented in a different way).

Why won't you show me how to do it in Prolog then? Maybe bacause you cannot, and cannot admit your blub universe just crashed?

You have attidude but you lack experience. In time, you will realize that attitude is NOT a valid replacement for experience. 8-)

pmasiar
October 7th, 2008, 04:25 AM
LaRoza> No. Functions cannot be recursive in Fortran 77.

Conditions and GOTO then? If not How then?

It's trivial if you know how recursion is implemented in assembly: just implement your own stack for variables and track properly where you are. Stack is not magic, and recursion is just using stack to reentry the same code multiple times.

In fact, this was my first paid programming job at college: staff programmer was not able to fit hugely recursive algotithm in memory. I implemented my own stack and transformed recursive algorithm into iteration. Piece of cake 8-)

CptPicard
October 7th, 2008, 04:27 AM
I mean nobody would program an OS in Java. And if they did, well then that OS would be a VERY slow OS

How do you mean?

In particular, JVM bytecode on hardware is doable (although the JIT-compiler makes this unnecessary in practice), and a systemwide GC as an OS service would be pretty sweet. JVM as a base for an OS is not nearly as far-fetched and idea as you seem to imply.

Sinkingships7
October 7th, 2008, 04:36 AM
How do you mean?

In particular, JVM bytecode on hardware is doable (although the JIT-compiler makes this unnecessary in practice), and a systemwide GC as an OS service would be pretty sweet. JVM as a base for an OS is not nearly as far-fetched and idea as you seem to imply.

Doable? Sure. Practical? Probably not. :)

Come to think of it, that'd be a fun idea to tinker with (JVM as the base of an OS). And system-wide GC would be a pretty useful feat as well...

CptPicard
October 7th, 2008, 04:43 AM
Doable? Sure. Practical? Probably not. :)


http://en.wikipedia.org/wiki/Java_processor

mssever
October 7th, 2008, 05:54 AM
Haven't I heard of some embedded devices that run a Java OS? Granted, I don't know whether the kernel is entirely Java, but I'm pretty sure I've heard of embedded devices that are nearly all Java.

(I'd like to know what software my cell phone uses. Whatever it is, it sure runs slow and it's quite laggy, though that doesn't necessarily have anything to do with the language.)

pp.
October 7th, 2008, 06:30 AM
But what I think that DrMega and others are saying is that programming isn't about the language you use, it's about making the program work in whatever language you choose to use.

What some of us are saying is that 'the program' can become an entirely different one, depending on your choice of programming language. It's not just writing 'asdfghh' instead of 'for'. It's about producing qualitatively and structurally different programs.

LaRoza
October 7th, 2008, 06:30 AM
It's trivial if you know how recursion is implemented in assembly: just implement your own stack for variables and track properly where you are. Stack is not magic, and recursion is just using stack to reentry the same code multiple times.


Well yes, but Fortran compilers do not support recursive functions, although one could implement them (as you said) if one so wanted.


How do you mean?

In particular, JVM bytecode on hardware is doable (although the JIT-compiler makes this unnecessary in practice), and a systemwide GC as an OS service would be pretty sweet. JVM as a base for an OS is not nearly as far-fetched and idea as you seem to imply.

Perhaps he meant for desktop computers?

CptPicard
October 7th, 2008, 07:21 AM
Perhaps he meant for desktop computers?

Question is still essentially valid.

I am mostly asking though because it seems like a version of the old "Java is slow" myth from people who haven't tried Java in the past 5 years :)

tinny
October 7th, 2008, 08:17 AM
Haven't I heard of some embedded devices that run a Java OS? Granted, I don't know whether the kernel is entirely Java, but I'm pretty sure I've heard of embedded devices that are nearly all Java.


The answer is called JEMcore! Its FANTASTIC!!! Native Java execution! Ive used the aj100 chip before and its fast, something like 20 million byte codes per sec. You can even code hardware interrupts in Java.

Because its Java its memory safe and performs garbage collection etc... Just dont ask me how :-)

http://www.ajile.com/index.php?option=com_content&task=view&id=20&Itemid=27

tinny
October 7th, 2008, 08:23 AM
I am mostly asking though because it seems like a version of the old "Java is slow" myth from people who haven't tried Java in the past 5 years :)

Yeah, the JVM is like rocket science. I am a firm believer that the Java compiler + JVM produce better machine interpretable code than your average C coder will.

When you compile and run your Java code you are leveraging off some of the best C coders in the world (factoring in runtime optimizations).

Practical and theoretical limitations are too different things

DrMega
October 7th, 2008, 11:00 AM
What some of us are saying is that 'the program' can become an entirely different one, depending on your choice of programming language. It's not just writing 'asdfghh' instead of 'for'. It's about producing qualitatively and structurally different programs.

You're so tied up with my for loop example that you fail to see the point I was trying to make. I used the for loop example not to be taken literally (in fact I give examples of where a for loop doesn't exist for the benefit of those obsessed with looking at one tiny detail and sticking with it rather than seeing the bigger picture), but to make the point that to be a programmer, you have to understand something about how computers work. If you change the language does the processor suddenly change its instrauction set and stop reading the instructions sequentially from memory? If I stop using C# and instead use xyz, would I have to change the memory in my machine to some strange quantum technology that is neither RAM nor something else, yet is both and neither all at once?

You criticise my attitude. That's fine, people usually do when they run out of constructive things to say. You say I have attitude and no experience, again that's fine. I'll continue gaining experience and getting paid for writing good code, while you spend your time on hear criticising me:)

Bye.

xlinuks
October 7th, 2008, 11:19 AM
Be a real professional programmer knowing 1 language and you will be hunted by employers for life. Be an intermediate programmer knowing 10 languages and you'll be hunting employers for life.

CptPicard
October 7th, 2008, 11:24 AM
but to make the point that to be a programmer, you have to understand something about how computers work.

Actually, you don't. Programming is about describing problems and problem solutions, processes and computational entities using some given formalism, and as long as the semantics of the language work as advertised, you really don't need to know anything about how a computer works. Turing-completeness is the only significant feature that mechanistically computable languages have theoretically in common. To use lambda calculus to express something, you only need the concepts of function definition and application.

This is a typical low-level myth, and just shows that someone who pushes it hasn't used, say, Haskell :)

pp.
October 7th, 2008, 01:11 PM
You criticise my attitude.

Just for the record: I did not and I still don't.

pp.
October 7th, 2008, 01:40 PM
Be a real professional programmer knowing 1 language and you will be hunted by employers for life. Be an intermediate programmer knowing 10 languages and you'll be hunting employers for life.

Or don't know any programming languages at all and be hunted by employers for all eternity.

njkt
October 7th, 2008, 01:50 PM
I blame ADD for all my language hopping.

CptPicard
October 7th, 2008, 02:13 PM
Be a real professional programmer knowing 1 language and you will be hunted by employers for life. Be an intermediate programmer knowing 10 languages and you'll be hunting employers for life.

To be honest if I were hiring I would be suspicious of a guy who only knows one language, no matter how well. It would give me the impression that he doesn't necessarily see the big picture, is not particularly intellectually curious, and that it is possible that he is actually a fairly bad developer when "taken off script" as his thinking has not been influenced by stuff outside of his usual box.

DrMega
October 7th, 2008, 02:14 PM
Just for the record: I did not and I still don't.

Ok. Sorry. Although you would have had a right to as I didn't put my point across very well and having been in a stinking mood for a couple of days now, and I suspect some of that has shown through in my posts.

I'm going to have to stop posting when I'm in a mood:)

pmasiar
October 7th, 2008, 02:24 PM
to be a programmer, you have to understand something about how computers work. If you change the language does the processor suddenly change its instrauction set and stop reading the instructions sequentially from memory? If I stop using C# and instead use xyz, would I have to change the memory in my machine to some strange quantum technology that is neither RAM nor something else, yet is both and neither all at once?

Like a typical blub programmer, you are obsessed which low-level architecture. Most likely you never heard of http://en.wikipedia.org/wiki/Lisp_machine and quite obviously about Forth, which was implemented in silicon 25 years ago, as it is really easy to do.

It is funny how you continue to argue but refuse to read one wikipedia page which would prove wrong your comprehension what is substance of programming, while claiming to learn. Exactly like blub programmer would do.

pp.
October 7th, 2008, 02:24 PM
Ok. Sorry. Although you would have had a right to ...

Yes, that's ok, but don't overdo it. :popcorn:

LaRoza
October 7th, 2008, 06:03 PM
I am mostly asking though because it seems like a version of the old "Java is slow" myth from people who haven't tried Java in the past 5 years :)
Well, consider that pmasiar said he does Java during the day, he probably knows its speed or limitations.

C was meant to be used to program OS's. Java was meant to be used to program toasters (so to speak). Which do you think is the ideal language for programming an OS?



I blame ADD for all my language hopping.

Everyone blames that, however, don't make excuses. If ADD were never "discovered", we'd have less excuses and more success.

Canis familiaris
October 7th, 2008, 06:07 PM
By ADD you mean:
http://en.wikipedia.org/wiki/Attention-Deficit_Hyperactivity_Disorder

?

LaRoza
October 7th, 2008, 06:10 PM
By ADD you mean:
http://en.wikipedia.org/wiki/Attention-Deficit_Hyperactivity_Disorder

?

Yes, it is something rather recent and is used to "explain" often normal behavior or less than optimal life styles.

I haven't met anyone who claimed to "have" it and didn't have normal behavior and need excuses or have a life style which would encourage such problems.

The worst part is that is applied to a very large number of people and can be "treated" with dangerous drugs. The modern opiate.

nvteighen
October 7th, 2008, 06:21 PM
Yes, it is something rather recent and is used to "explain" often normal behavior or less than optimal life styles.

I haven't met anyone who claimed to "have" it and didn't have normal behavior and need excuses or have a life style which would encourage such problems.

The worst part is that is applied to a very large number of people and can be "treated" with dangerous drugs. The modern opiate.
More than modern opiates, psychology is one of the modern myths. Yes, there is certainly scientific and serious psychology, but in some cases it works in some way too close to how myths worked in the Ancient World, giving people explanations of reality and their interaction with the world through emotional and psychic (not rational) causes and therefore, from description psychologists go into prescription (telling you how to improve the way you interact with your environment).

In my experience, psychologists can be great advisors that may help you a lot (it also depends on the patient) and sometimes drugs are needed to balance neurotransmissors (which is based on Neurobiology's discoveries). But you can't rely on them as you rely a surgeon or a dentist... it's just there's a different kind of knowledge involved.

CptPicard
October 7th, 2008, 06:55 PM
Yes, there is certainly scientific and serious psychology,

In particular the behavioural/cognitive science parts of it... people do have certain patterns that can become destructive unless there is awareness of them that allows intervention.



but in some cases it works in some way too close to how myths worked in the Ancient World, giving people explanations of reality and their interaction with the world through emotional and psychic (not rational) causes and therefore, from description psychologists go into prescription (telling you how to improve the way you interact with your environment).

Sounds like religion... ;) It's not such a bad way of dealing with issues necessarily, if it works for some person though.



In my experience, psychologists can be great advisors that may help you a lot (it also depends on the patient)

Most of the time they just tell you the obvious, though. At least if you're even the slightest bit self-conscious.



and sometimes drugs are needed to balance neurotransmissors (which is based on Neurobiology's discoveries).

IMO, drugs is where it's at. They are much maligned for strange reasons, but when I went through a seriously rough patch years ago, getting on SSRIs was like flipping a switch to get lights back on. The effect is hard to describe...

pmasiar
October 7th, 2008, 06:56 PM
Well, consider that pmasiar said he does Java during the day, he probably knows its speed or limitations.

Not really, I usually just whack a quick solution using obsolete tricks, and am forced to learn new tricks as I go (our local guru uses even older tricks and does not plan to upgrade). So I am guilty as charged ;-)

> C was meant to be used to program OS's. Java was meant to be used to program toasters (so to speak). Which do you think is the ideal language for programming an OS?

Yes, but compiler writers in last 20-30 years learned awful lot of tricks, which are easier to apply by program than manually, so expertly compiled Java code might be easily comparable to average code by average Joe Shmo.

LaRoza
October 7th, 2008, 08:00 PM
In particular the behavioural/cognitive science parts of it... people do have certain patterns that can become destructive unless there is awareness of them that allows intervention.

+1



IMO, drugs is where it's at. They are much maligned for strange reasons, but when I went through a seriously rough patch years ago, getting on SSRIs was like flipping a switch to get lights back on. The effect is hard to describe...

No, drugs are where the drug companies want it to be. Keep them sick. Keep them paying.

Your personal experience was good wasn't it? What about psychic surgeons? I saw (video, I'd love to see him in person) James Randi talking about it and he proved it as a fraud (although he did it very well, and never called anyone a liar. If he didn't have facts or records, he didn't comment). This woman swore a "psychic surgeon" helped her (but didn't have documentation and Randi wouldn't comment on it) because of one good experience.

CptPicard
October 7th, 2008, 08:12 PM
No, drugs are where the drug companies want it to be. Keep them sick. Keep them paying.

If you get an infection, you take antibiotics. They don't keep you sick, and if you live in the civilized world, the financial cost is not going to kill you and you probably have a doctor who isn't on the drug industry's payroll so he won't push you to be on antibiotics for the rest of your life "just in case".

Analogously, when your brain has issues, you take brain-pills.

There is no reason to assume that to psychiatric medication should be an exception, in particular when there is much evidence of it being beneficial. It is possible that in particular antidepressants are over-prescribed, but considering that for a healthy individual they are harmless, giving them a shot is perfectly fine with me.



Your personal experience was good wasn't it? What about psychic surgeons?

No, it is not placebo effect, trust me. Measuring it objectively is difficult, of course, but I am sceptical enough to be able to tell the difference, I suppose.

LaRoza
October 7th, 2008, 08:35 PM
If you get an infection, you take antibiotics. They don't keep you sick, and if you live in the civilized world, the financial cost is not going to kill you and you probably have a doctor who isn't on the drug industry's payroll so he won't push you to be on antibiotics for the rest of your life "just in case".

Well, that is the most common analogy but it falls apart. The antibiotics don't require fancy doo dads and cute charts showing how the "work" when all the time it is mostly guess work and "lets see what happens" with psychiatric drugs.



Analogously, when your brain has issues, you take brain-pills.

Except they don't know how or why it works, and they advertise it in magazines...



No, it is not placebo effect, trust me. Measuring it objectively is difficult, of course, but I am sceptical enough to be able to tell the difference, I suppose.
That is good you are well. I have seen a lot more of what they do and with more people, so perhaps things are different all over.

http://www.youtube.com/watch?v=QHG8cjI5B-w

nvteighen
October 7th, 2008, 08:39 PM
If you get an infection, you take antibiotics. They don't keep you sick, and if you live in the civilized world, the financial cost is not going to kill you and you probably have a doctor who isn't on the drug industry's payroll so he won't push you to be on antibiotics for the rest of your life "just in case".

Analogously, when your brain has issues, you take brain-pills.

There is no reason to assume that to psychiatric medication should be an exception, in particular when there is much evidence of it being beneficial. It is possible that in particular antidepressants are over-prescribed, but considering that for a healthy individual they are harmless, giving them a shot is perfectly fine with me.

+1


No, it is not placebo effect, trust me. Measuring it objectively is difficult, of course, but I am sceptical enough to be able to tell the difference, I suppose.

And trust me too. Last year I started to develop a depression and it was caught early because of a anxiety crisis I had. I had to be medicated and it was a fairly long process, but there really is a difference.

But an anti-depressive pill, as I was told by the doctor, has no effect if there's no will to change one's way of life. The pill is a help, but the cure is in yourself.

A psychologits usually tells you common-sense. Actually, there's almost no secret on what they tell you, the point is that they tell you those things when you are not able to see it, because you're under some sort of psycho-emotional disorder. It's true that is helpful, but the way it works makes it one of the mythologies of our time: you're told something that you finally have to believe as true in orther to cure yourself; even if it's false, but at least gives you something to improve the way your life is.

Religion has subtle difference: you don't have to believe it in order to get some better life. You just believe or not and the consequences of that are not noticeable in this life, but in the after-life (if you believe in one). You might be very religious and exactly follow the tenets of your faith, but be depressive person... of course, religion gives a meaning to that suffering (in Christianity: Redemption through Penitence), but it doesn't take the suffering away.

Last ideas on Classical Mythology tend to separate myths from religion. The discussion is a bit extense, but it relies on the existence of myths that hadn't any rite associated to them and viceversa. There's a relationship between Myth and Rite, but not a necessary one.

Greyed
October 7th, 2008, 09:20 PM
I am mostly asking though because it seems like a version of the old "Java is slow" myth from people who haven't tried Java in the past 5 years :)

I wouldn't call it a myth nor something that is untested in the past 5 years. I have yet to find a Java application which, when compared to similar applications written in Python, let alone C, comes close to Python in terms of either speed of development, speed of execution or RAM required to run the application.

My most recent example from about a year and a half ago can be read here:
http://linux.derkeiler.com/Mailing-Lists/Debian/2007-03/msg02009.html

Presently I am running Deluge and after several days with 9Gb of torrents loaded up for seeding it is pulling a paltry 44Mb of RAM and a load of 0.3. I'm not about to download Azureus (or whatever it is called now) to test it again but I would bet cold hard cash, with confidence and of at least 4 numbers, that it wouldn't come close to 44Mb of RAM and a load of 0.3 with the same torrents loaded up.

Before this I was running KTorrent from KDE3 but it has a serious memory leack problem. I run my torrent client on a headless machine and check in on its VNC desktop maybe once every week or two. KTorrent has leaked enough memory in that time to put the machine almost completely into swap hell. Deluge, so far, seems far better behaved in terms of memory though it does lock up when I minimize it. :(

Now, one could say that this is just Azureus being, really, really, REALLY poorly programmed. But this is just an example of a pattern I see in Java programs vs. other comparable programs written in other languages. I use it mainly because I did the testing and have the numbers.


To be honest if I were hiring I would be suspicious of a guy who only knows one language, no matter how well. It would give me the impression that he doesn't necessarily see the big picture, is not particularly intellectually curious, and that it is possible that he is actually a fairly bad developer when "taken off script" as his thinking has not been influenced by stuff outside of his usual box.

It certainly has not limited my choices of employers. My main problem is that I'm in love with Python and want a job coding Python. They are still fairly rare. The few that do pop up often include technologies I have not yet been exposed to (mysql in production environments as an example). Its a catch-22. Need experience to get job, need job to get experience. In fact I've seen ads for jobs where they list several languages, admit they're coding in only one of them but will consider anyone with experience in one of the languages since the hurdle of learning the first language is done with.

CptPicard
October 7th, 2008, 09:38 PM
Except they don't know how or why it works, and they advertise it in magazines...

First of all, all you need is empirical evidence from double-bind tests, which we've got. Second, for causality, to take SSRIs in particular, the functional pathway of the drug is fairly well understood -- depression results in decreased amounts of serotonin in the brain, which results in more depression and even actual, measurable "slowing down" of a person's thoughts, even physical mobility and reactions.. (I've got experience of this -- it's the lowest circle of hell for a guy who is used to being smart and having wetware "work" to specs).

Sure the marketing effect is a problem in itself in all medication, but that's why you don't get to advertise prescription drugs to the public over here..



That is good you are well. I have seen a lot more of what they do and with more people, so perhaps things are different all over.

I'd rather trust the psychiatrists I've spoken to, really... at least they're highly educated doctors.

I do understand there is this some weird ideological crusade going on against treating psychiatric problems with medication... it usually is either some extreme-right tinfoil hat mind-control fear, some religious anti-materialist bias (mind doesn't have a physical basis so everything must be banned that shows otherwise!1) or just simple hostility to such disorders as illness in general ("just pull yourself up on your own or kill yourself already")...

Then there is the fun bunch who expect you to find Jesus, and want to make you find Jesus so that they could get to Heaven.



http://www.youtube.com/watch?v=QHG8cjI5B-w

To suggest a comparison of SSRIs to Ecstasy doesn't exactly lend credibility you know... are all substances that alter your physical state, thus including your mental state, bad?

SSRIs do not give you a "buzz". They slowly work over a period of 3-6 months, even a year, and essentially take you out of the zombie state that clinical depression induces. You do not feel particularly "cheerful" or anything -- for a depressed person it is enough not to feel the sense of impending doom and complete hopelessness that you know is because you're not being "well", but you're still unable to do anything about it. Nothing helps, and eventually you run out of energy to try.


+1
And trust me too. Last year I started to develop a depression and it was caught early because of a anxiety crisis I had.

Good, I am glad you got treated early. At some point it becomes a huge effort just to drag yourself to doctor :)



But an anti-depressive pill, as I was told by the doctor, has no effect if there's no will to change one's way of life. The pill is a help, but the cure is in yourself.

Actually, antidepressants pull you out of the cycle of the interactions between your psychology and your brain chemistry. A persistent low mood results in brain changes -- people with chronic depression actually have real changes in brain physiology that can be seen in MRIs (this is why recurrent depression tends to become chronic). And that in turn of course keeps you in a low mood.

The important part about antidepressants is that they give you the capacity and energy and curiosity and will to actually go on with your life a little, which then feeds back positively.

The psychotherapy and "change your life" stuff is crap from my own perspective -- when you're stuck in a rut enough, you no longer feel you have "a life" you could change in any way. It's a different planet really. When on the other hand you get liberated from the really unbelievable darkness that can fall on you, you just do what you feel makes you feel better, automatically, like people generally do.

tinny
October 7th, 2008, 09:40 PM
I wouldn't call it a myth nor something that is untested in the past 5 years. I have yet to find a Java application which, when compared to similar applications written in Python, let alone C, comes close to Python in terms of either speed of development, speed of execution or RAM required to run the application.

My most recent example from about a year and a half ago can be read here:
http://linux.derkeiler.com/Mailing-Lists/Debian/2007-03/msg02009.html

Presently I am running Deluge and after several days with 9Gb of torrents loaded up for seeding it is pulling a paltry 44Mb of RAM and a load of 0.3. I'm not about to download Azureus (or whatever it is called now) to test it again but I would bet cold hard cash, with confidence and of at least 4 numbers, that it wouldn't come close to 44Mb of RAM and a load of 0.3 with the same torrents loaded up.

Before this I was running KTorrent from KDE3 but it has a serious memory leack problem. I run my torrent client on a headless machine and check in on its VNC desktop maybe once every week or two. KTorrent has leaked enough memory in that time to put the machine almost completely into swap hell. Deluge, so far, seems far better behaved in terms of memory though it does lock up when I minimize it. :(


I see stats of RAM usage (and yeah Swing likes its memory), but where are these speed stats you claim? Just your intuition? You must have VERY good eyes, because “if” Java was even 4 times as slow I being human wouldn't notice it.



Now, one could say that this is just Azureus being, really, really, REALLY poorly programmed. But this is just an example of a pattern I see in Java programs vs. other comparable programs written in other languages. I use it mainly because I did the testing and have the numbers.


I think we need to see more “raw” examples. Not ones that are dependant on an unknown entity such as the Azureus teams development skills.



It certainly has not limited my choices of employers. My main problem is that I'm in love with Python and want a job coding Python. They are still fairly rare. The few that do pop up often include technologies I have not yet been exposed to (mysql in production environments as an example). Its a catch-22. Need experience to get job, need job to get experience. In fact I've seen ads for jobs where they list several languages, admit they're coding in only one of them but will consider anyone with experience in one of the languages since the hurdle of learning the first language is done with.

You are not limited for choices because you know more than one language, right? :-) If you where just a Python coder you would be limited in choices. Its just simple Math, more Jobs == more choices

CptPicard
October 7th, 2008, 09:51 PM
I have yet to find a Java application which, when compared to similar applications written in Python, let alone C, comes close to Python in terms of either speed of development, speed of execution or RAM required to run the application.

The C comparison is a little unfair -- I'm willing to give that Java is maybe on par with unoptimized gcc output (with -O3 being substantially better) in, say, my own work code which is a fairly intense number cruncher and coded to a fairly "C-like Java" standard for performance reasons. Nevertheless, it's plenty fast enough, and beats alternatives.

But Python... hmmm.. now that's an interesting claim. :) The JVM does have memory overhead, but execution speed... I have run enough tests myself to see that Python loses in speed in at least the things I have tried. Now, one has to remember that Python calls C libraries a lot, so that can give it an edge here. If we did pure Python vs. pure Java, I am quite sure indeed Java wins -- in particular function call overhead in Python is awful. :)



Now, one could say that this is just Azureus being, really, really, REALLY poorly programmed. But this is just an example of a pattern I see in Java programs vs. other comparable programs written in other languages.

Yes, a lot of Java coders are idiots who spam little objects around all the time. That, and GUI stuff not being Java's strong point to begin with...



My main problem is that I'm in love with Python and want a job coding Python.

At least you have chosen a language that is quite flexible in the way you solve problems -- that's the important part here. You could check out some Lisp to be really cool though ;)

LaRoza
October 7th, 2008, 09:59 PM
First of all, all you need is empirical evidence from double-bind tests, which we've got.

To clarify (as this is off topic), I am not against the drugs themselves, just how they are marketted and used (at least, in the USA), especially with children.

CptPicard
October 7th, 2008, 10:06 PM
To clarify (as this is off topic), I am not against the drugs themselves, just how they are marketted and used (at least, in the USA), especially with children.

Oh... *orders crew to disengage the Borg*, then.

hod139
October 7th, 2008, 10:18 PM
My brain hurts after trying to read through this thread.... It has been all over the place.

Yes there are different language paradigms and there are even multi-paradigm languages (e.g. Oz). There are even emerging paradigms (i.e. stream processing). It's good to know these paradigms, and at least at a high level the differences between them.

Greyed
October 7th, 2008, 10:22 PM
I see stats of RAM usage (and yeah Swing likes its memory), but where are these speed stats you claim? Just your intuition? You must have VERY good eyes, because “if” Java was even 4 times as slow I being human wouldn't notice it.

Middle of the message I switch over from RAM usage to load as measured by the OS. Code quoting to differ quoting my message from quoting you...



Now for the part that really kicks Java's head in. Azureus at nice 0
would punch my box up to a load of 2. 1 for it and 1 for X keeping up with
its updates. I set it to nice 5 and I get the load down to 1 and a
semi-responsive box.

Rufus in Python (wxWidgets as its GUI set)... load of mayyyybe 0.1 at nice 0.

Wine + uTorrent... load of 0.01.


Azureus at nice 0 = load of 2.
Azureus at nice 5 = load of 1.
Rufus at nice 0 = load of 0.1.
Wine + uTorrent at nice 0, load of 0.01.

I further expanded on that by noting my current client, Deluge, at nice 0 but with a larger set of torrents, is currently pushing my machine to a load of 0.3.


I think we need to see more “raw” examples. Not ones that are dependant on an unknown entity such as the Azureus teams development skills.How are they unknown?

http://sourceforge.net/projects/azureus/

Noodle through the source yourself all you want.


You are not limited for choices because you know more than one language, right? :-) If you where just a Python coder you would be limited in choices. Its just simple Math, more Jobs == more choicesI was replying more to the person who said the more languages we know the lower the change we have of finding an employer. IE, I was confirming the good Cpt's point, not refuting it.

Be that as it may I have passed up many Perl jobs. I wrote Perl professionally for 3 years prior to learning Python and another 2 after. Now? Not for all the tea in China. Could I do it if I had no other choice and my ferrets were going to starve? Sure. But given anything less than those dire straights I'll leave it safely in my past. ;)


Now, one has to remember that Python calls C libraries a lot, so that can give it an edge here. If we did pure Python vs. pure Java, I am quite sure indeed Java wins -- in particular function call overhead in Python is awful. :)

Which you can alleviate inside Python easily enough for those areas that need it.


At least you have chosen a language that is quite flexible in the way you solve problems -- that's the important part here. You could check out some Lisp to be really cool though ;)I've been keeping an eye on LaRaza's beginner's programming challenges. The recent one to code a previous challenge in Scheme, Common Lisp or Haskell piqued my interest. I'll have you know LaRaza owes me a new monitor. My brains exploded over the last one right around chapter 2 of the introduction to Haskell I was perusing. 8-[ Getting brain off an LCD is no fun.

LaRoza
October 7th, 2008, 10:24 PM
I've been keeping an eye on LaRaza's beginner's programming challenges. The recent one to code a previous challenge in Scheme, Common Lisp or Haskell piqued my interest. I'll have you know LaRaza owes me a new monitor. My brains exploded over the last one right around chapter 2 of the introduction to Haskell I was perusing. 8-[ Getting brain off an LCD is no fun.

Being Borg, I have had to get brains off more diverse objects; LCD isn't so bad.

tinny
October 7th, 2008, 11:01 PM
Middle of the message I switch over from RAM usage to load as measured by the OS. Code quoting to differ quoting my message from quoting you...


Ok, my mistake.



How are they unknown?

http://sourceforge.net/projects/azureus/

Noodle through the source yourself all you want.


Yep sure. Unkown for a reasonable person though :-) Im not going to review that code because it has no bearing on the issue of the performance of the Java platform.

What I meant by raw examples was that we need to be looking at recognised benchmarks not a bittorrent client as the yard stick for software performance.

Heres a very basic benchmark: (I dont think its that valid, but Python does pretty well IMO)
http://twistedmatrix.com/users/glyph/rant/python-vs-java.html




I was replying more to the person who said the more languages we know the lower the change we have of finding an employer. IE, I was confirming the good Cpt's point, not refuting it.


Consequence of joining the thread late, HELLO EVERYONE

Greyed
October 8th, 2008, 12:16 AM
Yep sure. Unkown for a reasonable person though :-) Im not going to review that code because it has no bearing on the issue of the performance of the Java platform.

That's just it. Abstract programs that only exist to benchmark a language tell you the language benchmarks well. Real world programs that are in extensive use are, well, real world programs that actually do something other than benchmark a language. I don't care if a language benchmarks quickly. I care that I have not seen a single java application perform faster and/or use less memory. If the benchmarks don't translate well over to the real world applications then the benchmarks are useless to me.


What I meant by raw examples was that we need to be looking at recognised benchmarks not a bittorrent client as the yard stick for software performance.

Heres a very basic benchmark: (I dont think its that valid, but Python does pretty well IMO)
http://twistedmatrix.com/users/glyph/rant/python-vs-java.html

You mean something like this:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=javaclient&lang2=python

Or a somewhat better comparison since Psyco performs some of what the JIT compiler does:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=javaclient&lang2=psyco

And yes, I'm well aware that Java's benchmarking higher than Python on those tests.

tinny
October 8th, 2008, 01:57 AM
That's just it. Abstract programs that only exist to benchmark a language tell you the language benchmarks well. Real world programs that are in extensive use are, well, real world programs that actually do something other than benchmark a language. I don't care if a language benchmarks quickly. I care that I have not seen a single java application perform faster and/or use less memory. If the benchmarks don't translate well over to the real world applications then the benchmarks are useless to me.


That is a very good point.

Lets put the language and platform to the side for one moment then.

Do you think the ability of your average Python coder is better than your average Java coder? I think so. The fact that a developer codes with Python is probably a strong indication that they are intellectually inquisitive (Python wasnt taught at my University) and also more passionate about software development.

If your answer is yes then do you think that this would somewhat distort this pseudo benchmark?

(Better programmers will always write better stuff, no matter what the language)

pmasiar
October 8th, 2008, 01:57 AM
No, drugs are where the drug companies want it to be. Keep them sick. Keep them paying.

That's sad but true: there is no market for drugs which will heal you in one pill. There is no market to treat diseases which bother only poor parst of the globe, like Africa. Big pharmas are interested in pills to manage chronic diseases of rich people, without making you healthy: pay them as long as you live (or as long as you can afford to). :-(

Because of the profit, of course: it cost 1B USD and takes 10-15 years to develop drug and psh it through all clinical trials. Firms have to get investors to finance it, and they want profits.

p4plus2
October 8th, 2008, 02:24 AM
To me I find it appropriate to hop to a new language after the following conditions are met:

1. Practice the old language or you will forget it then all was to waste(though a review brings back fast it is still relearning it time that can be avoided by a 20 project)
2. You have a firm grip on all current languages you know(this can include)
*At least one major project you spent a month making(what you do with project doesnt really matter....just make something and take your time!)
*10-20+ minor 1 day project type things EDIT: not just random coding but something useful not "var1 + var2 = result1" apps more like a calculator with ability to calculate nth root or permutations.
*covered most common uses of the language
*When you can fluently type the language AND debug it.
3.when you can honestly tell yourself "I have mastered this language enough to move on now"

just my opinions.....

I hold by the standards, the only exception to this is I write "hello world" apps in many many languages for fun and experimenting to see if I would like that language in the future....but first I am sticking with c++ for awhile 1 month under my belt in not enough. once I fluently can write games I will move on....(one game down :):))

hopefully, people understand what I am saying....I think I may have worded some of this information poorly...in such case my bad >.<

Sinkingships7
October 8th, 2008, 03:50 AM
[...] but first I am sticking with c++ for awhile 1 month under my belt in not enough. once I fluently can write games I will move on....(one game down :):))

I hope you mean simple ASCII art games? How are you currently doing with C++, and is it your first language?

Greyed
October 8th, 2008, 03:53 AM
Do you think the ability of your average Python coder is better than your average Java coder?

Being a Python programmer who cringes any time I have to poke at Java I'll just say I am biased and leave it at that. ;)


If your answer is yes then do you think that this would somewhat distort this pseudo benchmark?

If we were to take all of the code equally and presuming the Python programmers were generally better than the Java programmers (or, heck, the reverse, yes). However, there is a caveat to that. In the "Real world of applications" pseudo benchmark we're not talking the average programmers. To bring even a moderate-sized application to light is no small feat. It is one which I believe that culls the weakest from each set and leaves only the above average programmers to come to light. So we would be comparing not the average of each, but the above average.

tinny
October 8th, 2008, 04:11 AM
If we were to take all of the code equally and presuming the Python programmers were generally better than the Java programmers (or, heck, the reverse, yes). However, there is a caveat to that. In the "Real world of applications" pseudo benchmark we're not talking the average programmers. To bring even a moderate-sized application to light is no small feat. It is one which I believe that culls the weakest from each set and leaves only the above average programmers to come to light. So we would be comparing not the average of each, but the above average.

hmmm, perhaps. Alot of the "real" applications that ive worked on have been released with code that has been contributed to by rubbish programmers.

But I do agree with what you are saying, it really does seem that squeezing out that last 10% requires 90% of the effort.

Greyed
October 8th, 2008, 04:29 AM
I hold by the standards, the only exception to this is I write "hello world" apps in many many languages for fun and experimenting to see if I would like that language in the future.

Personally my two standard beginner projects in any language are either a random die generator that takes standard XdY+/-Z notation (ex, 3d6+2) or a random password generator which takes a pattern (Bab1Bab!) and would generate passwords based on that pattern while recognizing consonant from vowels, upper case from lower case, numbers from alpha and symbols from numbers and alpha. IE:



{grey@teleute:~/bin} newpass.py Bab1Bab!
Gek7Woq} Rix8Raj^ Qix3Dup% Kas4Tij( Qus2Sif_
Pij0Gok| Siv0Zux= Qil9Lib@ Xeh7Bac_ Jat8Lef.
Gev0Fip? Fak3Lah& Wef1Kam? Dad1Rav{ Lep2Jey*
Bec2Qon, Qaj5Jid| Nex5Bop( Kax7Bil} Xuf1Bes,
Lax6Zag+ Nix0Tob, Gaz5Tus[ Xow6Tik* Wap4Soy%
Both of those are good since they cover basic input/output, most of the logic constructs, looping, string parsing and touches most of the common data structures. It isn't too deep but it is enough to know if I'll like the feel of the language and, once that is tackled, be able to build up to more complex and diverse concepts.

Hmm, that reminds me, my newpass script is a tad behind the times. I need to tear it apart and put it back together with all the improvements I made in a version which I no longer have access.

p4plus2
October 9th, 2008, 01:02 AM
I hope you mean simple ASCII art games? How are you currently doing with C++, and is it your first language?

1.
No it was a game based with QT, It was based on a tutorial...then I added my own twists by adding keyboard support, new features, level system, etc.... my next game will be 100% my code though, most likly based on tic-tac-toe...since then I can set up a nice tic-tac-toe AI for the computer player which seems fun

2.
I have since abandoned QT, to try SDL I am still unsure of what I will use for graphics so I am jumping around looking at different gui/graphical implementations of c++...SDL is kinda fun atm and it has nice openGL support i hear for the future of my developments in c++.

3.
I this is my first computer language, I have used php just over 1 1/2 years....and since have a very nice grip on php(and php is still my major practice). I have little javascript too but thats just random stuff I have picked up, never dedicated time to learn that though.

4.
I am handling c++ very well I would think, not the best by far but i understand a very large percentage of how things work now its a matter of improving application of concepts.

I have my road planned out way way into the future...after c++ I plan on moving onto perl(seems backwards but oh well...) then I will go with fortran(since it is preferred for speed and used in 90% of worlds fastest computers_....lastly I see java in their somewhere...though java is somewhat of a low priority for me.
That is over next 10+years though. so by the time i'm 26 I should be doing very nicly in the computer industry :).

njkt
October 10th, 2008, 12:03 AM
Well, consider that pmasiar said he does Java during the day, he probably knows its speed or limitations.

C was meant to be used to program OS's. Java was meant to be used to program toasters (so to speak). Which do you think is the ideal language for programming an OS?




Everyone blames that, however, don't make excuses. If ADD were never "discovered", we'd have less excuses and more success.

You took my jest too seriously, what i meant to say is that I get bored easily and often find something new to try out in my free time.