Page 3 of 5 [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

geek
Veteran
Veteran

User avatar

Joined: 11 Mar 2007
Age: 67
Gender: Male
Posts: 723
Location: Elsewhere

23 Mar 2007, 8:17 pm

Understood.

I don't rewrite things either, I write code to do something once, as a modular function, and cut & paste it into anyplace I need it. I've reused some functions dozens of times. If I were lazy, I could even just put them into <my_junk.h> . Works for me.

On the other hand, I pretty regularly need to port my applications, I never know when someone's going to need them running on AIX, HP-UX, z/OS, or what have you, immediately. And on many of the platforms that do have C# support, BSD for example, you're basically dealing with a beta-level product that is occasionally tinkered with by 2 guys. That sort of thing makes owners of production networks nervous.

Or maybe I just don't use languages which were invented by Microsoft, take your pick.

Anyway, to each their own.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 76
Gender: Male
Posts: 9,795
Location: Somerset UK

23 Mar 2007, 8:26 pm

geek wrote:
Or maybe I just don't use languages which were invented by Microsoft, take your pick.

Total agreement there. I glanced at, then completely ignored C# when in came out. SharpDevelop came along, and that got me interested. Now Mono. MS have completely lost it. :)


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


chadders
Deinonychus
Deinonychus

User avatar

Joined: 3 Dec 2006
Gender: Male
Posts: 354

23 Mar 2007, 11:14 pm

Sadly I think I will have to adjust to C# at some point :(. I would much rather do C++, but the unit I have to do is based of C#.

Stupid Microsoft rip off everything. Open Source community made PHP, Microsoft made ASP :roll:.


_________________
- Chadders

That's my two pence worth.


geek
Veteran
Veteran

User avatar

Joined: 11 Mar 2007
Age: 67
Gender: Male
Posts: 723
Location: Elsewhere

23 Mar 2007, 11:24 pm

chadders wrote:
Stupid Microsoft rip off everything. Open Source community made PHP, Microsoft made ASP :roll:.


I recall that as being the C# story, too... Sun came out with Java, MS wanted to add extensions to it and have their own, incompatible version. Sun successfully sued them over it, MS decided that if they couldn't have an incompatible Java that they wouldn't support Java at all, and came out with C# as a substitute.

Of course Java wasn't open source at the time, and won't be for another few weeks (?), but the general principle is the same.



calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

24 Mar 2007, 1:58 am

There is the fact that Java's mistakes were recognized, and many of them are not in C#; so, it's not really a copy, so much as an improvement on the ideas. There are some fundemental problems with this whole style of language though.

Lau -

When I said well written native code, I was intentionally trying to avoid the points that you brought up. I'm sure that in general assembly code is too likely to be poorly written - which is why there tend to be libraries for important stuff.

As far as I see what you're saying about Forth (and it's a language I never knew well, and is long gone from my mind), it sounds a lot like the ideas which go into the scripting languages. Given that Python can be used to run C modules, and many of the key things that one would want to do are already encoded as such, and the fact that it is eminantly more popular now, I think I'll stick with it. Might take another peek at Forth though - just for historical interest. I actually thought it was a dead language.

While C doesn't enforce OO design, it can be used for it. It's just an incredibly ugly thing to do. But long before C+classes existed, people were finding that they needed OO design principles, and used them in their C code. I'm not particularly demanding that my language force me to use OO. I like the flexibility (though I can't remember when I last wrote a C++ program without them - probably just before I figured out how to use operator new) of being able to choose.



ahayes
Veteran
Veteran

User avatar

Joined: 2 Dec 2006
Gender: Male
Posts: 9,506

24 Mar 2007, 2:30 am

I like using 'new' way more than 'malloc(pointer,sizeof(datatype))'



calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

24 Mar 2007, 2:51 am

Yeah. But sometimes you need to actually carve out space in shared memory, which is why you need to redefine operator new - and it ain't pretty.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 76
Gender: Male
Posts: 9,795
Location: Somerset UK

24 Mar 2007, 7:24 am

calandale, as an example of Forth, I amused myself, when ahayes put out a "little" C++ program on the KBABZ awards thread, by responding with much the same program in Forth.

Forth is a dead language? I suppose so, to a large extent. Another case of "too many standards", maybe. Offhand though, a language that come part and parcel with its own compiler, which you can replace/extend/mess with any way you like. Where you can change everything about it, from adding the odd "function" down to changing the lexical analysis. Assembler built in. (E.g. If you want to use the machine's built in multibyte "MOV"/"MOVEM"/whatever, you can probably do so within a single line of 64 characters. Then you can instantly use it.). All that without leaving "the command line". Where else do you find anything quite as powerful? (And the whole thing in 3 Kbytes of Z80 machine code).

    Things against Forth:
  • Portable? Not if you do use the assembler, but that's hardly surprising.
  • Fast? Not as fast as assembler. In practice, maybe only a factor of ten, though. I know of no other general purpose "interpreter" (for that is, ultimately, what it is) that comes remotely close. Compiled C, in my experience, is typically a factor of two down on assembler, even on and exceptionally good day.
  • Intelligible? Not really. Particularly not if RPN gives you headaches.
  • Verbose? Hardly. Don't take a contract writing in Forth where you are paid by lines of code written. (Mind you, it's all in WORDS, so maybe by definition it is verbose?)
  • Bloated? Not at all. You'll have trouble filling one megabyte of program space, let alone a Gig. That project where you were hoping to get the boss to buy in some 8x8x8 array of quad core processors... you'll have to be content with getting it all to run on a single 8086


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

24 Mar 2007, 12:27 pm

Ah, I forgot it was interpreted. Actually this is where Python shines: it has some of the advantages of both worlds. Other languages have moved in this direction as well.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 76
Gender: Male
Posts: 9,795
Location: Somerset UK

24 Mar 2007, 1:15 pm

I did put "interpreter" in quotes (see, I've done it again), because there's not a better way to say it. The inner loop of Forth goes like:

    Code at label NEXT:
  1. Fetch CFA (Code Field Address) held in the cell pointed to by the FORTH IP (Instruction Pointer).
  2. Increment the FORTH IP to the following cell.
  3. Branch to the fetched CFA.

If the processor could do it, that might all boil down to a single instruction: "JUMP *(IP)+".
A "NOP" would be code that merely jumped back to NEXT.
The "+" word, would just do "ADD (SP)+,(SP)" (if that made sense in the machine in question) before jumping to NEXT.
A literal value would do something like "MOVE (IP)+,-(SP)" before jumping to NEXT. In fact, this is what makes for that "factor of ten" speed. To stack a literal in Forth takes hardly any more time than doing it in machine code anyway, and it takes no more code space. Ditto for lots of stuff. In fact, my "factor of ten" is probably pessimistic, depending on the processor concerned.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


jfberge
Veteran
Veteran

User avatar

Joined: 4 Mar 2007
Age: 51
Gender: Male
Posts: 506
Location: Cell block B, #9

26 Mar 2007, 6:27 pm

Lau wrote:
What a strange concept -> "despising" a language. Javascript is an excellent language, in context and by evolutionary right.


And yet I do. Javascript just isn't a productive language for applications. The only real functionality it offers is manipulation of the browser DOMs, some basic math routines, and a primitive array class. Thanks to the free typing, no precompilation error warnings are possible.

Debugging is a pain, as well. If something's wrong in your Javascript, the whole document simply stops processing

The despising comes more from professional irritation at having to write Javascript, and with web apps in general. The whole GET/POST paradigm of structuring applications just doesn't jibe with anything more interactive than a form. Xmlhttprequest is the only way to emulate a traditional application, and it isn't very robust. Application state has to be faked by server sessions or endless baton passing, because a page refresh destroys everything.

It's just silly to me that I spend half of my time trying to fix constantly changing browser issues and tediously debugging in Venkman, the only useful debugger I've seen for JS, and that this is the future of software.

Maybe in another few years I'll be more productive with CSS/XHTML/Javascript development, but for the last year it's been an aching pain.



ahayes
Veteran
Veteran

User avatar

Joined: 2 Dec 2006
Gender: Male
Posts: 9,506

26 Mar 2007, 6:33 pm

jfberge wrote:
Lau wrote:
What a strange concept -> "despising" a language. Javascript is an excellent language, in context and by evolutionary right.


And yet I do. Javascript just isn't a productive language for applications. The only real functionality it offers is manipulation of the browser DOMs, some basic math routines, and a primitive array class. Thanks to the free typing, no precompilation error warnings are possible.

Debugging is a pain, as well. If something's wrong in your Javascript, the whole document simply stops processing

The despising comes more from professional irritation at having to write Javascript, and with web apps in general. The whole GET/POST paradigm of structuring applications just doesn't jibe with anything more interactive than a form. Xmlhttprequest is the only way to emulate a traditional application, and it isn't very robust. Application state has to be faked by server sessions or endless baton passing, because a page refresh destroys everything.

It's just silly to me that I spend half of my time trying to fix constantly changing browser issues and tediously debugging in Venkman, the only useful debugger I've seen for JS, and that this is the future of software.

Maybe in another few years I'll be more productive with CSS/XHTML/Javascript development, but for the last year it's been an aching pain.


Google has an API that where you to develop a Java program and instead of compiling to byte code it gets turned into an AJAX app.



calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

26 Mar 2007, 8:16 pm

But he's talking javascript, something completely different.



timseal
Emu Egg
Emu Egg

User avatar

Joined: 9 Dec 2006
Gender: Male
Posts: 2

28 Mar 2007, 7:42 pm

Haskell, anyone?



jfberge
Veteran
Veteran

User avatar

Joined: 4 Mar 2007
Age: 51
Gender: Male
Posts: 506
Location: Cell block B, #9

29 Mar 2007, 8:41 am

ahayes wrote:
Google has an API that where you to develop a Java program and instead of compiling to byte code it gets turned into an AJAX app.


Yeah, I just saw that today. I'll have to give it a whirl. The google page for it makes the exact same complaints I did about web development. Makes me feel better.



kidwiththereplaceablehead
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 5 Mar 2007
Gender: Male
Posts: 55
Location: NSW, Australia

31 Mar 2007, 7:42 am

dammit they came so close to the perfect computer language but then they had to go and spoil it all by doing something stupid like the .net framework! i hate it oop and basic need to come together but not like that why can't they use vb for the gui and syntax and c++ for the components and as for counting from zero thats just stupid why can't c++ just count from 1 dammit!