|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Paradigm changes (From Java to Lisp)
Hello
there are lots of languages in the programming field, like Java, C, PHP, C++, Objective C, Ruby, and so on. Altough some these language s don't share the same paradigm (example: C is imperative, JAVA is OO), they have lot's of things in comon - constructs - and, in example, it's possible to write non-OOP code in Java wich will look like procedural code). Now let's say one needs to do a paradigm change and go from a language like Java to a language like Lisp. This will imply a new way of thinking about programming. The point of this thread is to gatter some experiences with these "harder" paradigm changes - not necessarly with those languages. So, what's yours? Was it "hard", was it pointless and you ran away screaming, was it good for your general programming skill? The reason for the interest: one of my courses this semestrer is a ADT course with the lisp language so I want to get some pointers on this so I don't get caugth in the paradigm. Any other advice is welcome. Thanks |
|
#2
|
|||
|
|||
|
Hi zapata,
This is an interesting topic to discuss. I myself have have programmed in LISP in the past and other languages such as JAVA, C, PASCAL and VB. I'm not an expert in any, but I know how to program, so personally the language doesn't bother me too much. Personally from my experience I think LISP is good fun & very useful learn, it's a functional language based on symbolic representation and the manipulation of these symbols - which means everything is a function and thus the syntax reflects this (loads of brackets...and I mean loads) so programs can be built in a very efficient way, you define 'inner'-functions, then 'outer' functions which call the inner ones and keep doing this till you have something productive. I was a bit daunted by it at first, but as I actually learnt LISP before I did JAVA, I think it has helped me build more efficient functions and methods for whenever I program. I think it's defonately useful as it will help you understand more obscure languages and general logic if ever you have read them whilst in the industry, you wil feel more comfortable so it's only a good thing. Finally programming should never be considered 'hard', its just about communicating in a restricted way. Speaking/writing english is actually more difficult. If your programs work in theory, they will work when put into code, If they don't, the theory must be wrong! Good luck with you're course Dalyboy |
|
#3
|
|||
|
|||
|
I have recently been learning common lisp after having had a fair amount of experience with ALGOL family languages (eg java) so I know where you're coming from. It can be slightly frustrating and you may feel (as someone said on c.l.l recently) that you're going from being a doctor or a lawyer in your own language (one you've mastered) to being a taxi-driver in someone else's. But as you say, it's really a great thing to do - even if you're may be unlikely to produce production lisp code, it will teach you things about programming, programming languages, data structures, algorithms and so on. It's really a delight to use and even as a stumbling newbie I can get ideas down in code surprisingly quickly, using very little code.
My experience is that the way it looks - the prefix notation and the brackets, even the striking lack of boiler-plate code and syntax - isn't a problem. This just melts away very quickly and you're left looking at the code, especially if you use SLIME/emacs, which takes care of brackets/indentation etc. What is more challenging are things like macros, which don't seem to have an equivalent in other languages, lexical closures, lots of lambda functions and functions that take lambdas as parameters etc, which are possible in many languages but not normally as widely used...this is still stretching my brain! Although they might be puzzling at first, these are obviously very elegant, powerful ideas that will appeal to anyone interested in programming. The main thing to note about lisp from the p.o.v of paradigms is that it doesn't have one built in. If anything, the programmer imposes a paradigm onto it. It's an inherently flexible language that you can use to write in any style which may or may not be what people normally think of as 'lispy' - procedural, functional, OOP, create your own embedded language if that's more convenient. To take OOP, in common lisp you have CLOS, or if you're using a lisp that doesn't have objects you can write objects into it using 50 or 100 lines of code (this is done as an example in the paul graham book below). If you haven't already, have a look at practical common lisp. Other good reads are ANSI Common Lisp by paul graham and, of course, the wizard book. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Software Design > Paradigm changes (From Java to Lisp) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|