Discussion Topic |
|
This thread has been locked |
Mungeclimber
Trad climber
sorry, just posting out loud.
|
|
Topic Author's Original Post - May 5, 2011 - 12:55am PT
|
so I'm pretty much a newb when it comes to programming and I know maybe five things total about computer programming languages. I figure it may be time to take a class.
Programming in Perl
Object-oriented programming (.net and Java)
Programming in Python
Programming in php
If you could only do one, which one and why?
A long time ago I think I asked this of Clint, and he mentioned Python as being a skill that was more readily transferable. Clint, feel free to correct me if it wasn't you.
I have a website and php is used in a lot of web design and server side scripting, and Expression web supports php, which is what I'm going to use going forward. Used to use DW.
Object Oriented seems to be where a lot of the UI programming happens.
Perl seems to be the most versatile once mastered.
My goals in order are:
1. learn enough to be able to do simple scripts to expedite work
2. learn enough to be able to call bullshit on a dev trying to malinger on his work (no offense to devs in general, there are good and bad)
3. environment is primarily microsoft products, except at home where the website work is at. the db used there is mysql.
your thoughtful responses will be much appreciated!
Munge
|
|
WBraun
climber
|
|
Just wait till you need to debug 20,000 lines of code.
I'll come visit you in the lost your mind ward .....
|
|
Chinchen
climber
Way out there....
|
|
Basic.
|
|
nature
climber
Krabi, Thailand
|
|
COBOL
I've been doing web application development since '94
I started with Perl and got pretty good at it. But for web applications and development PHP has clearly put itself ahead of all other languages.
Now though I do almost all my work in Typo3 - A content management system based in PHP. Thus PHP remains the leader in that realm.
-
Edit: oops, I just noticed the comment regarding Micro$oft. I suggest you reboot and install Linux.
|
|
emu
climber
SF Bay area, CA
|
|
I have used each of your choices to various degrees.
Python is probably best choice as a first language. Python was originally based on a teaching language. Python is easy to read and write, and designed by people with good taste in languages. Python will help teach you good programming habits, and you'll learn useful techniques you'll be able to apply no matter what language you eventually end up working in. Once you know Python, it won't be that big a deal to learn PHP or Perl, although I think it's unlikely that you'll need or want to do so.
Many people I know treat Python as the "swiss army knife" of languages. It's the perfect tool if you need to quickly hack something up, or if you're trying to glue a couple of systems together.
|
|
froodish
Social climber
Portland, Oregon
|
|
The short answer is: it doesn't matter.
Your first programming language is the most difficult as you're learning not only the syntax and idiosyncrasies of the language, but also a bunch of meta skills that will apply to any other languages you'll learn in the future: Variables, control structures, algorithm patterns, commenting code, version control, mastering your editor/IDE of choice. etc., etc.
Python is not a bad choice. Although it's probably more idiosyncratic than most <insert significant whitespace joke here>, it does have the tradition of fun variable names ('Ni' & 'shrubbery' are much more fun than x & y -- Guido is an Monty Python fan, hence the name) and is well supported in a variety of environments. It's also what one of the leading web frameworks (Django) is written in.
PHP is ubiquitous in the web world, and it's good to know at least some, but honestly, I wouldn't recommend it as a first language. Because it's so accessible, the web is littered with poor PHP code.
I'm afraid some your goals and the classes you list aren't in very good alignment. The Microsoft world != the LAMP world.
JAVA is the classic OO teaching language, but unless you're doing enterprise web stuff, it's not as useful. If the .NET class is not using C# (and is instead using Visual Basic), don't bother.
I'd have to throw a nod out to Ruby as well. Rails is one of the leading web frameworks and Ruby/Rails is a joy to work in. It's a good general purpose language and has a ton of momentum at the moment. Ruby also has one of the most inspired manuals ever written: Why’s (Poignant) Guide to Ruby:
http://mislav.uniqpath.com/poignant-guide/book/
What's with all the hate for perl? I love perl. It's an incredibly useful general purpose programming language and it is the duct tape of the internet. Perl programing at its best is as elegant as it gets, but I suppose there's no accounting for taste ;-)
So you know my context... I've been doing web programming in a variety of environments (perl, JAVA, .NET, Rails, etc.) for the last 10 years or so. I do mostly front end work, but I know enough about the back end to get into trouble from time to time ;-) Before that I was in the game industry (C/C++ dominant.) Pretty much all self-taught.
Congrats on the move, it will change your relationship to computers! Feel free to ping me if you have any questions.
HTH,
-Steve
|
|
nutjob
Gym climber
Berkeley, CA
|
|
I think the first language learned should be a structured one, to help develop a more formal and generalized framework for understanding programming concepts. Something like C, since that is that is the core of linux and many apps on Windows too (though Basic and C++ and C-sharp and other stuff are more prevalent on Windows).
Given the stated goal of calling bs on developers' padded time estimates (sounds like you're a product manager!), this will give you the most generalized framework for the objective. Then learn a little more of the shortcuts available in the language of choice for your environment.
Just use whatever is a freshman computer science course nowadays. C or Java, etc. When I was learning it, pascal was the first "teaching" language.
|
|
rlf
Trad climber
Josh, CA
|
|
Definitely avoid Perl. The idiom "Write Once Read Never" is so true. Languages are languages. If you want to do web work, PHP and something in the .net world is your best bet.
"Just wait till you need to debug 20,000 lines of code."
20,000 lines of code is child's play. Try 5+ million lines of Fortran 77 that had to be portable to every major platform. DEC, IBM, CRAY, SGI, PRIME etc...
|
|
Gunkie
Trad climber
East Coast US
|
|
Perl is a very powerful language with syntax that mimics C++ & Java, to some extent. I've written tons of stuff in Perl. Web based cgi-bin apps, format conversion routines, and tools for manipulating huge ASCII files.
With that said, I think there is more money to be made for Python programmers. I've done a little in Python, mostly GUI development. Python is way better for GUI work than the Perl equivalent, Perl/TK.
Good luck and have fun with which ever direction you choose. I love locking myself into my digital lab and cracking out code and blocking out the rest of the world. And if you haven't guessed, I'm a geek (can't spell gEEk without an EE).
|
|
matlinb
Trad climber
Albuquerque
|
|
I'd vote for Python.
|
|
marv
Mountain climber
Bay Area
|
|
many of the jobs in my niche industry call for Perl/Linux more so than for Python or Java or whatever
|
|
Gary
climber
Desolation Basin, Calif.
|
|
I took a Perl class and have used it at work. If you are going to process and manipulate text files Perl will do very well, and it's not difficult to learn. Perl coders are also a helpful bunch. When I've had problems trying to do something, it was easy to get help through the Internets.
If you want to figure out how languages and computers work learn C.
|
|
rlf
Trad climber
Josh, CA
|
|
"many of the jobs in my niche industry call for Perl/Linux more so than for Python or Java or whatever"
Wanna bet. I've done this for 30 years. Perl is a hack as far as languages go. C++ is no better.
When you have written or worked on compilers, then we'll talk. I've written tons of perl over the years, it's junk.
"If you want to figure out how languages and computers work learn C."
This is very sound advice.
The grammar for C is very short and straight forward. It's a language for grownups.
|
|
k-man
Gym climber
SCruz
|
|
I wrote a book on programming in Prolog. Now that is one crazy language, there are no control structures in the language, all looping is done through recursion. I'd laugh when C programmers tried to figure out how the heck to do a simple if-then-else statement.
So, don't go to Prolog, it's not very applicable to other languages.
Many of the languages mentioned are "scripting" languages, as opposed to compiled languages where you're likely to write an actual application. While PHP is good for Web UI work, you'd probably wish you could implement the actual function calls in a more OOP-friendly language (like Java).
So yeah, learn the basics of programming (looping, OOP, file-handling, DB, etc) in a language you'll likely use a bunch, then you can pick up other languages as needed.
This Python sounds very good, I'll have to look into that one ;-)
|
|
drc
Trad climber
Durham, NC
|
|
I suppose taking time to respond here makes me a malingering dev, so I'll keep it short.
For web work, learn JavaScript for manipulating the DOM and communicating with the server and SQL for dealing with the database. Whichever language/platform sits between the two will seem really easy by comparison.
|
|
rectorsquid
climber
Lake Tahoe
|
|
Learn C if you want to write device drivers.
Learn C and C++ if you want to write higher performance computer games.
Learn JavaScript if you want to write web page scripts.
Learn PHP if you want to write web backend processing.
Learn Perl for cross-platform code interpreted code and if regular expression searching and file parsing are important.
Learn assembly language if you want to tell other people that their choice of language sucks for various reasons. Real men don't need compilers.
C# and .net stuff are not available on Linux and cut down on job possibilities there.
I'm not sure about Java and if it is a dying language.
I have not used Flash, Shockwave, etc., but they are useful in web design situations.
I write device drivers for Linux and Windows using C and write code that runs some time-sensitive algorithms for bioinformatics. C++ is the best choice for anything that has a high performance requirement because you get the speed of C in the critical areas and the object oriented capability of C++ in the same program where time is not an issue.
Dave
|
|
Murf
climber
|
|
rectorsquid is pretty close to right on.
One comment regarding Perl; you'll notice even the haters have programmed in it. At a lot of levels (Web, System Admin) its assumed you know some Perl.
With regards to to OP, I think you're question is what language should you use to learn programming.
|
|
Melissa
Gym climber
berkeley, ca
|
|
A gumby perspective on what I actually did as opposed to what would be useful if I had the smarts and follow through to make it happen as a real programmer might:
I was able to learn a functional amount of Perl (from programming-knowledge scratch) in a couple of weeks, but didn't have the attention span or real programming needs to follow through with Python, Java, or C. My efforts to learn them were a "Teach Yourself Perl in 30 Days" book from Borders, similar for Java, a half-ass bioinformatics class that included Python, and a 1-day intensive jump-start class at the UC Berkeley extension for C. Python didn't seem to be offering me anything new to justify the effort or switching to it. C blew my mind out of the gate and I totally did not have the patience to compile code for the simple data mining tasks I was trying to do. As a newb, every third character that I type is wrong, so the time spent compiling and recompiling was way more than the time it took to run my simple queries.
|
|
ryanb
climber
Seattle, WA
|
|
I've done profesional projects in all of the languages you mention and Python is the language I use when I have a choice.
Perl is popular because of the hugh amount of legacy code out there but it is too easy to go overboard with the lack of structure...working on a large legacy perl code base is not fun. Too often perl degrades into indecipherable regular expression and array derefrencing.
Java is widely used too verbose for my taste and I think it is having some issues due Oracles purchase of sun. You wouldn't want to use it for small scripting projects.
Php is widely used on small website but it is not well suited to much else.
Python is widely used on the web and is suitable for small sites or large (youtube, reddit). It has a clean syntax that makes it easy to get started writing small scripts yet it also includes a great OOP model that scales well to large projects. It has some great libraries and projects for all sorts of things (Django for the Web, SciPy/Numpy for science, AppEngine for scalability, Hg for source control, pychecker for error checking). There are also some great performance related projects (PyPy, Cython) that can be used to make it run fastter if needed and you can even use it to do .NET or JVM progaming (via IronPython and Jython).
It does eliminate much of the crap that slows down development in other languages so it won't help you with #2 if you are trying to manage C developers or something...you will just look like an ass when you say something like "My python programs never have memory leaks."
Not sure what issues wescrist had...it is way easier (for string handeling in particular) then matlab and has nothing to do with apple:
fo=open("afile.txt","w")
fo.write("Guido is a dutch genius!\n")
fo.close()
I think the thing that sums it up most is the python easter egg you can find by typeing import this at the shell:
The Zen of Python
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
|
|
|
SuperTopo on the Web
|