473,560 Members | 2,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Complementary language?

Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be to
study two languages at the same time. Probably sounds crazy, but it
works out better for me. Being a newbie, I find almost all languages
fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a non-tech to
choose? Does any single language do a better job in Python's weaker
areas? Would anyone care to suggest one to supplement Python. That is,
if you could only use Python and one other language, which would it be?
Thank you for your time and help.
Jul 18 '05 #1
26 2123
HackingYodel wrote:
Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be to
study two languages at the same time. Probably sounds crazy, but it
works out better for me. Being a newbie, I find almost all languages
fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a non-tech to
choose? Does any single language do a better job in Python's weaker
areas? Would anyone care to suggest one to supplement Python. That is,
if you could only use Python and one other language, which would it be?
Thank you for your time and help.


Python (CPython - aka standard - implementation) and C would be my preferred
combination.

The reason is that I often work with hardware, and hardware means C (since every
vendor I have ever dealt with provides a C API for their drivers).

It combines well with the CPython interpreter as that, as you may have guessed
from the name, is written in C and exports a direct C/API.

Cheers,
Nick.

--
Nick Coghlan | nc******@email. com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #2
I'm a big fan of C# myself, it kinda takes the good from C++ and Java and
combines them in a way.
Jul 18 '05 #3
At home I almost use python exclusively, the other two languages I can
be productive is C# and C++, I chose C# because I am a Windows
programmer (don't throw tomato at me, I am no troll..) and I choose C++
because the algorithm was implemented in this dialect in school.

Jul 18 '05 #4
HackingYodel wrote:
Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be to
study two languages at the same time. Probably sounds crazy, but it
works out better for me. Being a newbie, I find almost all languages
fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a non-tech to
choose? Does any single language do a better job in Python's weaker
areas? Would anyone care to suggest one to supplement Python. That is,
if you could only use Python and one other language, which would it be?
Thank you for your time and help.


Depends on what you want to get out of the second language. (Disclosure:
I only use Python, C, and FORTRAN on a regular basis. Any of my comments
about other languages should be liberally salted.)

For use *with* Python, C could be helpful. I end up writing a little bit
of C or C++ every once in a while to speed up my calculations or to use
some library written in C or C++.

If you do numeric calculations, learning just enough FORTRAN to do loops
and math can be quite useful. I find that F2PY makes writing FORTRAN
subroutines for numerical calculations over Numeric arrays much easier
than C.

If you develop on a Mac, some Objective-C could come in handy. I find
that it's object model and dynamism are quite close to Python's. The
lessons you learn in each should reinforce the other's. PyObjC makes
mixing the two languages dead easy and more convenient than indoor
plumbing. However, almost all Objective-C texts require knowledge of C
(which makes sense, since Objective-C is a true superset of C, unlike C++).

For didactic purposes, I suggest picking something distinctly *less*
like C/Java/Python. Learn something that's going to expand the way you
think about programming. And when you learn a new paradigm, implement it
in Python and share it with the rest of us. :-) For example, Phillip
J. Eby took the idea of "generic functions" from the Common Lisp Object
System and implemented it for us[1]. (BTW, thank you, Phillip.)

Common Lisp might be a good one to learn. It's even more
"multi-paradigm" than Python. You could very easily learn more
approaches to programming through Common Lisp than three other
languages. This book[2] looks promising.

Summary recommendation: Learn Python and a language that complements it
*pedagogically* . When you are fluent in Python and encounter a problem
where you want to, for example, use a library written in C, then learn
some C.

[1] http://dirtsimple.org/2004/11/generi...ve-landed.html

[2] http://www.gigamonkeys.com/book/

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #5
HackingYodel <taoiststarte r@-nospam-yahoo.com> writes:
Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be
to study two languages at the same time. Probably sounds crazy, but
it works out better for me. Being a newbie, I find almost all
languages fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a
non-tech to choose? Does any single language do a better job in
Python's weaker areas? Would anyone care to suggest one to supplement
Python. That is, if you could only use Python and one other language,
which would it be? Thank you for your time and help.


It depends on what your goals are. Python is an excellent language for
learning OO and procedural programming, and makes it possible to learn
functional programming as well.

Part of the Python philosphy is that there should be one obvious way
to do something. That's what makes it an attractive language to
me. Eiffel shares this philosphy, in that every feature of the
language was added to solve a specific problem that programmers
encounter. It does many other things the exact opposite of
Python. It's statically typed, with no loopholes allowed. For cases
where you're not sure that something is conformant with a variable
(meaning it's the same class as the variable or inherits from it in
some way), there's even a "work if you can" assignment operator. So
you see code that looks like:

a ?= b
if a /= Void then
doSomethingWith (a)
else
doSomethingElse With(b)
end

As you can see, it keywords instead of :. It's pure OO, in that there
are no free-standing functions; every function is a method of a
class. Functions aren't first-class objects, so you can invoke
parameterless methods with just object.method. This allows subclasses
to change such a method to a variable without you having to change any
code anywhere else in the system. It has export rules to control what
features (shorthand for methods and instance/class variables) are
visible to what other classes. Exceptions are handled in a completely
different method as well, with a method having an optional "rescue"
clause that gets invoked when an exception is raised, should repair
things, and then retries the method.

The key feature is "Design by Contract". Each method can have a set of
boolean expressions that must be true when the method is invoked, or
an exception is raised. Likewise, each method has a set of boolean
expressions that must be true when the function exits, or an exception
is raised. Finally, there's a set of expressions that are always true
when an externally-invoked method exits. These are the contracts, and
they make debugging wonderful. You can disable all those checks for
production code.

There are tools to display the the method headers, header comment, and
contracts (short form). There is a tool to display all methods a class
has, including inherited methods (flat form), and of course there's a
tool that displays the shortflat form.

If you want to do GUI programming on Windows, Linux or FreeBSD 5.x,
EiffelStudio is probably your best bet. It comes with a standard GUI
library, an IDE built on that library, and a reasonably
standards-compliant compiler and library. It hasn't yet drifted into
the parts of the language that are undergoing experimental changes.

<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 18 '05 #6

"HackingYod el" <taoiststarte r@-nospam-yahoo.com> wrote in message
news:cq******** **@news.chatlin k.com...
Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be to
study two languages at the same time. Probably sounds crazy, but it
works out better for me. Being a newbie, I find almost all languages
fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a non-tech to
choose? Does any single language do a better job in Python's weaker
areas? Would anyone care to suggest one to supplement Python. That is,
if you could only use Python and one other language, which would it be?
Thank you for your time and help.


Java. Because of Jython.
Perfect partners. They can work together.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.818 / Virus Database: 556 - Release Date: 12/17/2004
Jul 18 '05 #7
http://lambda-the-ultimate.org/
http://advogato.org/
http://c2.com/cgi/wiki?WelcomeVisitors
www.artima.com

It's a big world out there, you can glimpse Haskell, LUA, CLU, scheme,
squeak etc.
Disclaimer: going into these sites is liking going into REM sleep when
it's 95 degrees Fahrenheit (hot) and really humid

Jul 18 '05 #8
HackingYodel <taoiststarte r@-nospam-yahoo.com> wrote:
Hello all! I'm learning to program at home. I can't imagine a better
language than Python for this. The ideal situation, for me, would be to
study two languages at the same time. Probably sounds crazy, but it
works out better for me. Being a newbie, I find almost all languages
fascinating. C, D, Objective-C, Ocaml, C++, Lisp, how is a non-tech to
choose? Does any single language do a better job in Python's weaker
areas? Would anyone care to suggest one to supplement Python. That is,
if you could only use Python and one other language, which would it be?


I assume you mean _programming_ language in the strict sense, because,
otherwise, I think SQL (which is more of a _query_ language) or XML
(which is a _markup_ lanugage) might be more "urgent" learning needs
than any second _programming_ language. So, within programming...:

Probably C, but Pyrex is also a strong contender for _use_. Problem is,
there are a zillion great books on C, none on Pyrex: thus, having to
choose one of them, C enjoys a huge advantage in _learning_. Also,
while Pyrex is amazingly mature and solid, it no doubt still has some
little way to go -- for example, the pypy project had to introduce a
small extension to Pyrex (the ability to inject inline C code, namely
labels and goto statements) in order to use Pyrex as the target for code
generation -- while C's completeness and stability are indisputable.

C's key advantages: it has much the same _philosophy_ as Python --
simplicity, lack of redundancy, trust in the programmer -- while aiming
squarely at the LOW end of language levels, closer to the machine, as
much as Python aims squarely at the HIGH end, closer to application
programming needs. This makes them a great complement for each other.

Pyrex is close to "C with Python syntax" and is designed for ease of
interfacing with Python, generating on your behalf all the boilerplate
code that you'd normally need to do the interfacing with the Python C
API directly. Still, I've never taught Pyrex to anybody who didn't
already know at least _some_ C, so it feels risky to recommend as "the
one othe language besides Python"...

I haven't looked at D enough to judge whether it's fully portable, fully
stable, and just as easy to interface with Python as C; also, I don't
know how the material available for it compares to C's excellence.

Objective-C is cool... on the Mac; I'm not sure how well-supported it is
elsewhere, though. In addition to C's advantages, it would let you make
Cocoa GUIs on the Mac easily (with PyObjC &c). But then, the right way
to study Obj-C from scratch is no doubt to start with C, anyway.

OCAML and other modern functional languages are great, but not
particularly easy to use in cooperation with Python. If you had to pick
one for purely cultural purposes, though, I'd suggest Haskell... simpler
and sharper... OCAML is relatively Big and Rich, which may be a
practical plus but for study purposes is rather a minus, I think. Much
the same applies to (Common) Lisp and C++: huge languages, very rich,
which may be a plus for practical production uses but surely isn't for
study purposes.
Alex
Jul 18 '05 #9
Robert Kern <rk***@ucsd.edu > wrote:
Common Lisp might be a good one to learn. It's even more
"multi-paradigm" than Python. You could very easily learn more
approaches to programming through Common Lisp than three other
languages. This book[2] looks promising.


If you're looking for SERIOUS multiparadigmat icity, I think Oz may be
best -- <http://www.info.ucl.ac .be/people/PVR/book.html> (the book's
authors critique the vagueness of the "paradigm" concept, and prefer
"model", but that's much the same thing).

You start with pure declarative programming (aka "functional " in many
circles), move on to concurrency in a purely declarative worldview
(easiest way to see concurrency), then enrich both sequential and
concurrent models as the book progresses, by message-passing, explicit
state ("procedural "), object-oriented, _shared_ state, and finally
relational. GUI, distributed, and constraint-based programming round
out a grandiose conceptual tour.

"SICP for the 21st Century"...? (SICP: google for it!). I currently
think so, though, studying CTMCP (the Oz book) in my spare time, it will
take me a while before I've finished it and can fairly offer such a
lofty recommendation for it... still, I notice from the back-page blurbs
that Peter Norvig has no reservations drawing a parallel with SICP (aka
Abelson and Sussman), and Norvig's assessment must count for more than
mine!
Alex
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1591
by: Thiva Charanasri | last post by:
http://www.poweroflanguage.org Track: Computer Language 1st World Congress on the Power of Language: Theory, Practice and Performance Date: March 6 - 10, 2006 Bangkok, Thailand On this very auspicious occasion, Thai people will join hands with
22
2846
by: Michael Nahas | last post by:
Antti & all interested, The draft description of my language to replace C is available at: http://nahas.is-a-geek.com/~mike/MyC.pdf I am a long time C programmer (I read the old testament in 1987) and I've tried to keep the spirit of C and make as few changes as possible. I was mostly driven by the bloat of C++ and, now, C99. I was...
134
7913
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've increasingly been using scripting languages (especially Python and Bourne shell) which offer the same speed and yet are far more simple and safe to...
0
1592
by: Thiva Charanasri | last post by:
http://www.poweroflanguage.org Track: Computer Language 1st World Congress on the Power of Language: Theory, Practice and Performance Date: March 6 - 10, 2006 Bangkok, Thailand On this very auspicious occasion, Thai people will join hands with
669
25637
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990....
2
5326
by: R. MacDonald | last post by:
Hello, Group, If drawing on a control, it would be desirable to select a colour that significantly differs from the control's background colour. Is there a standard (or preferred) way to programmatically select a complementary color at run time? Thanks in advance for any suggestions. Cheers,
10
10757
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language Aquisition Device (2) Color Aqusition Device (3) Sound Aquistion Device (4) Smell Aquisition Device (5) Touch Aquisition Device (6) Art...
17
4687
by: CoreyWhite | last post by:
I bought this book years ago, when I was just learning C++. Since then I've gone through every math course offered at my college, taken courses on coding C & thinking in terms how how to make the smallest tightest algorithms to preform specific functions. I've also grown and matured a lot, and am wiser and older. I'm reading through the C+...
4
3710
by: Johny | last post by:
I use PIL to write some text to a picture.The text must be seen wery clearly. I write the text to different pictures but to the same position. As pictures maybe different, colour, in the position where I write the text, is also different. Is there a way how to set the font colour so that it will be seen very clearly in the picture? For...
0
7635
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8068
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7600
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7921
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.