Favorite Programming Language?

Started by
135 comments, last by umbrae 16 years, 4 months ago
I like to program in D for some of the reasons I like python and do not dislike C++ as much as some people seem to do.

These are the most important ones to me:

- the support for arrays, not as powerful but still akin to lists in python
- attention to all kinds of details that make code more maintainable and less error prone
- support for many programming styles, I liked this in C++ and python as well: object-oriented, modular, procedural, a bit of functional, generic, contract and meta-programming. Compile-time reflection and function execution stands out for me.
- combination of garbage collection and manual memory management
- high-speed compilation, binary compatible with C
- unicode support

I like scheme too which is something totally different. I've found out there's a spec for scheme with pythonic identation, I might just program in this. edit: I-expressions
Advertisement
Quote:Original post by rollo
Quote:Original post by DevFred
Quote:Original post by UnshavenBastard
I am by no means a software engineer (actually I still suck at desgin)

But when what you have to implement "by contract"

You raise a very interesting point here (design by contract). It would be cool if one could write preconditions, postconditions and invariants in Java interfaces.


check out the Eiffel language


Or Coq. Contracts proven at compile time.

Require Import List.Require Import Arith.(* Defining the interface for a set *)Module Type SET.  (* 't' is the type of the set, 'item' the type of the items *)  Parameters t item : Set.  (* Define an empty set *)  Parameter empty : t.  (* An implementation must provide these two functions *)  Parameter add : t -> item -> t.  Parameter mem : t -> item -> Prop.    (* The following axioms must hold for every implementation of list *)  (* There is no element which is a member of the empty set *)  Axiom mem_empty : forall x : item, ~ mem empty x.  (* A recently added item is a member *)  Axiom mem_add : forall (x : item) (s : t), mem (add s x) x.  (* Adding a new item to a set doesn't change anything to the other items in the set *)  Axiom mem_other : forall (x y : item) (s : t), mem s y \/ x = y <-> mem (add s x) y.End SET.Module Type EQDEC.  Parameter t : Set.  Parameter eqdec : forall a b : t, {a = b} + {a <> b}.End EQDEC.Module Natural.  Definition t := nat.  Definition eqdec := eq_nat_dec.End Natural.(* An simple implementation of a set *)Module ListSet (ITEM : EQDEC) : SET with Definition item := ITEM.t.  Definition item := ITEM.t.  Definition t := list item.  Definition empty := (@nil item).  Definition add (s : t) (x : item) := x :: s.  Definition mem (s : t) (x : item) := In x s.  Theorem mem_empty : forall x : item, ~ mem empty x.  Proof.    red; intros.    inversion H.  Qed.  Theorem mem_add : forall (x : item) (s : t), mem (add s x) x.  Proof.    intros.    simpl.    left.    trivial.  Qed.      Theorem mem_other : forall (x y : item) (s : t), mem s y \/ x = y <-> mem (add s x) y.  Proof.    split; intros.    destruct H.    simpl.    right; trivial.    subst.    apply mem_add.    simpl in H.    destruct H; auto.  Qed.End ListSet.    
My favourite language is by far Java. It has a much better structured system than other languages, it is supported by virtually all platforms in a consistent way, and it is frequently used in many handheld devices such as PDAs, Mobile Phones, etc. I am a master of Java; other languages not so much ^_^
Giftiger WunschProof that god is imaginary: www.godisimaginary.com
Quote:Original post by DevFred
Quote:Original post by UnshavenBastard
I am by no means a software engineer (actually I still suck at desgin)

But when what you have to implement "by contract"

You raise a very interesting point here (design by contract). It would be cool if one could write preconditions, postconditions and invariants in Java interfaces. Somehow along these lines maybe:

interface Set<E>{    public boolean contains(E elem);    public void add(E elem)    post (contains(elem));    public void remove(E elem)    pre (contains(elem))    post (!contains(elem));}


That would be awesome!


Contracts in Java, C4J

I have an inexplicable fondness for LISP. I wrote my first A* implementation in LISP and ran it on a LISP interpreter that I wrote in Java.

I use too many languages right now to really have a favorite. I do all of my professional work in C++. I do my hobby programming in C#, Objective Caml, &#106avascript, php and python. There are things I love and hate about each of them.<br><br>My least favorite language is C. If I never see another malloc/free call, it'll be too soon.<br><br>
LISP, huh?
I have some experiene with scheme, as I was demanded to use it at gunpoint (or something), and now have an incurable form of parenthesophobia.
Quote:Original post by UnshavenBastard
I am by no means a software engineer (actually I still suck at desgin), but I sometimes came across where MI would have been nice, because the solution with deriving from a base class that's not supposed to have certain behavior that was then implemented through interfances by the deriving classes, was dull because every class had to implement quite some stuff that was "contracted" by interface again (well, copy & paste + some modification), I thought that was not very elegant, while multiple inheritance would have been a very cool thing.
Although you might be right and it could have been solved totally different... and just did not see that ^^

EDIT:
for clarification, I like interfaces when there are just a few simple methods and/or properties to be implemented.
But when what you have to implement "by contract" starts to become more than a few lines of code, I tend to dislike it :D
(could still be due to the fact that I am not good at design ;-) )


The technique I would use in this situation would be delegation or similarly, a component based design.

This topic is closed to new replies.

Advertisement