DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

View Poll Results: favorite programming language?
Asm 19 12.93%
C 55 37.41%
C++ 31 21.09%
C# 7 4.76%
Java 13 8.84%
Javascript 5 3.40%
Perl 28 19.05%
PHP 29 19.73%
Ruby 11 7.48%
Python 32 21.77%
Shell 25 17.01%
Awk 11 7.48%
Others: Tcl, Erlang, Haskell, Ocaml, D, Forth ... 19 12.93%
Multiple Choice Poll. Voters: 147. You may not vote on this poll

Reply
 
Thread Tools Display Modes
Old 7th November 2008
snes-addict's Avatar
snes-addict snes-addict is offline
Real Name: Ken
BSD gamer
 
Join Date: Oct 2008
Location: Minnesota, USA
Posts: 34
Thanked 0 Times in 0 Posts
Default

I like C. It's small, simple, portable, and fits the Unix philosophy perfectly. As a BSD fan, how can I go wrong?
__________________
"Experience is what you get when you were expecting something else." - /usr/games/fortune
Reply With Quote
Old 7th November 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by snes-addict View Post
I like C. It's small, simple, portable, and fits the Unix philosophy perfectly. As a BSD fan, how can I go wrong?
I agree.
Reply With Quote
Old 7th November 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

As much as I like C, I have to ask in what way you find it to be "small"? C is simple indeed, in that it stays out of my way and lets me do what I want to do (for the most part - being able to cast a function pointer to void * and pass it around would be useful). I don't see the small, though. Compilers are hugely complex, and the amount of code that must be written to perform a given task is usually more than with a lot of other, especially interpreted, languages.
Reply With Quote
Old 7th November 2008
Oko's Avatar
Oko Oko is offline
Fsck Surgeon
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 774
Thanked 36 Times in 32 Posts
Default

Quote:
Originally Posted by mdh View Post
As much as I like C, I have to ask in what way you find it to be "small"? C is simple indeed, in that it stays out of my way and lets me do what I want to do (for the most part - being able to cast a function pointer to void * and pass it around would be useful). I don't see the small, though. Compilers are hugely complex, and the amount of code that must be written to perform a given task is usually more than with a lot of other, especially interpreted, languages.
If I remember correctly the reason that Ken Thomson chose C to write Unix was that once compiled C binaries are only 30% slower and bigger than if the Unix was coded in Assembly. Do not forget that Ken, Denis, and company where grand masters of the Assembly which was at the time consider basic programming skill. Roff and original version of Troff were written in Assembly.
In 60 both Ken and Ritch actually were involved in the writing an unsuccessful time-sharing operating system in Assembly.


The fact that Ruby in one command can do for what C needs 20 commands doesn't make it simple. The simplest language is Assembly (or to be more precise Assembly for couple MIPS chip-sets) and every C line of code requires 5 lines of code in Assembly.

Your remark about compilers is only partially true. It is true that modern compilers or more precisely GCC are huge but that fact is that you do not need compiler to run binaries unlike interpreter which must be present to execute program written in an interpreting language. Do you think it would be possible for Damn Small Linux to be 50MB if it had compiler? Basic OpenBSD installation is about 540MB (I never install the games and install bsd.mp kernel only if the machine actually has multiple processors). Without compiler the installation is only 300MB. It is fairly easy to trim down "Desktop" version of OpenBSD probably to 200MB.

On the another note I, as many OpenBSD users, have hight hope that GCC will be thing of the past in no time and that PCC will be the only compiler present in the base of the system.


C is not a perfect language. The C is if I remember correctly soft parsing
language. This problem is know from late 70 when U.S. department of defense commission large grant to overcome that weakness. Since C was not fixable they invented whole new language ADA Most of software for embedded devices in airplanes for instance is written in ADA for that particular reason.

The reality is that no computer language is perfect since otherwise we would not have so many of them. An average Unix user must use interpreter on the daily base (shell). I cast my vote for C but I really like
shell, sed, awk, and perl. In my line of the work I have to use mark up languages far more often (mostly TeX which is actually interpreter but
also HTML and CSS) than any of previous languages. All of us also use every day Post Script but only few of us thing of it as a real programming language which is. Post Script is the best language for describing graphics on the page but is general purpose language which could be used to program numerical computations for instance.

How relevant my opinion is? Probably not very much. In all my life I was exposed mostly to procedural languages with the exception of Lisp (Functional) and Fortran (Numerical language).

Last edited by Oko; 7th November 2008 at 03:52 PM.
Reply With Quote
Old 7th November 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by mdh View Post
As much as I like C, I have to ask in what way you find it to be "small"? C is simple indeed, in that it stays out of my way and lets me do what I want to do (for the most part - being able to cast a function pointer to void * and pass it around would be useful). I don't see the small, though. Compilers are hugely complex, and the amount of code that must be written to perform a given task is usually more than with a lot of other, especially interpreted, languages.
Well, PCC, the C99 compiler recently imported into OpenBSD/NetBSD.. has a code base less then 5MB in size. (And produces executable smaller then GCC..).

Just because most compilers are bloated, doesn't mean they have to be.
Reply With Quote
Old 7th November 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by mdh View Post
As much as I like C, I have to ask in what way you find it to be "small"? C is simple indeed, in that it stays out of my way and lets me do what I want to do (for the most part - being able to cast a function pointer to void * and pass it around would be useful). I don't see the small, though. Compilers are hugely complex, and the amount of code that must be written to perform a given task is usually more than with a lot of other, especially interpreted, languages.
How is C small?

The syntactical rules fit in your head easy, compare to Perl and it is microscopic !!! The hardest thing to remember is how to use an enum[eration] or that in pointer arithmetic, you increment or decrement in multiples of the size of the memory it points to rather then directly modifying the address N. The differences between foo.bar, foo->bar, p, *p, and &p being fairly easy to recall.


There are no built in functions - everything is 'man made', be it your own functions, stuff from the standard library, or abusing compiler 'built ins'. Likewise their are only a few fundamental types (char, short, int, ...).


Standard C is so darn portable, it's practically useless for a lot of fun stuff -> file system manipulations; network communication; the good, the bad, and the ugly of manipulating processes / threads, e.t.c. If you ever dig into it, you would probably be surprised just how little standard C places on the 'popular' demands of popular operating system features being present. That's why we have things like POSIX, SUS, and the DOS/Windows APIs to define whats hopefully available on platform X. For example: dirent.h and the various ^.*dir() functions are fairly portable by convention, but not required to be there.

Of the standard issue functions and feature found in hosted environments, the most complex are probably the string, time, and math procedures.





Now let's look at a few larger languages.... C++, Java, Python, Ruby. We gain much larger standard library features, which will be there in the case of Java, Python, and Ruby at least (as I never read the C++ standard). They generally dictate a number of operating system features be provided, such as those related to threads, processes, file system, and network resources.


We also have to accept the fact that many things are now objects and gain a list of common 'methods' which we must now remember. Strings, Lists, Hashes, blah blah and their manipulations. Although in the case of C++, things like std::string and std::vector are optional, you probably want them!!! By contrast most of the string functions in C are stuff most sane programmers would write themselves if need be, and come in a can of common operations so we don't have to debug them.


Likewise we gain exceptions, reflection, and in the case of Java/Python/Ruby a much more complex form of code reuse (packages / modules, jars / gems / eggs, et. al.) and any associated complexity. Hey, what if some poor schleps destructor throws an exception, causes other objects to be destroyed while unwinding the stack and one of those destructor's throws an exception? Oh shit, if some one just tried to delete 20MB of allocated database queries, that's really bad -- terminate() now! (It's probably not a good idea to throw exceptions from a destructor in any language with a call stack anyway, let along in C++).


Then look at assembly languages, X86 ASM for example... You have to deal with some form of consideration about the several modes the CPU has (real, protected, blah blah) and I'm no even going to mention the # of addressing modes... That's a lot more to stuff in head then C, lol.



C is the kind of language, that is small, beautiful, and elegant; but so mind numbingly so, that you can spend a long time in coming to either appreciate or hate it for what it is, at least that is my opinion of the matter.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 7th November 2008 at 08:27 AM.
Reply With Quote
Old 7th November 2008
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

Did have some favorites over the time: Fortran, Pascal, even Basic - but nowadays C and Python.
__________________
use UNIX or die :-)
Reply With Quote
Old 8th November 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by Oko View Post
On the another note I, as many OpenBSD users, have hight hope that GCC will be thing of the past in no time and that PCC will be the only compiler present in the base of the system.
Quote:
Originally Posted by BSDfan666 View Post
Well, PCC, the C99 compiler recently imported into OpenBSD/NetBSD.. has a code base less then 5MB in size. (And produces executable smaller then GCC..).

Just because most compilers are bloated, doesn't mean they have to be.
I too share the hope that GCC will be replaced with PCC - or at least with another BSD-licensed compiler that both compiles code faster and creates executable code that runs faster and is smaller...and doesn't require the types of system resources one usually only sees in Vista marketing material.

Though, as far as I know, PCC is still a long way from being able to compile a complete base system.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 8th November 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by JMJ_coder View Post
Though, as far as I know, PCC is still a long way from being able to compile a complete base system.
Then you clearly haven't been following its development.

http://marc.info/?l=openbsd-cvs&m=121899860512511&w=2

As has been mentioned, both NetBSD & OpenBSD (kernel,userland) have been successfully compiled using PCC (plus a few patches..).

This does not include ports, but, a fair share of them might compile with little modification.

But it is still a work in progress, yet, already impressive.
Reply With Quote
Old 8th November 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
Then you clearly haven't been following its development.
So I'm a couple months out of the loop.


We could also use a good BSD replacement for GDB (assuming that there isn't one - I'm not aware of any).
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 8th November 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by JMJ_coder View Post
So I'm a couple months out of the loop.


We could also use a good BSD replacement for GDB (assuming that there isn't one - I'm not aware of any).
OpenBSD has pmdb(1), though.. it's only somewhat maintained.. one could go as far as saying it's broken.
Reply With Quote
Old 8th November 2008
snes-addict's Avatar
snes-addict snes-addict is offline
Real Name: Ken
BSD gamer
 
Join Date: Oct 2008
Location: Minnesota, USA
Posts: 34
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
OpenBSD has pmdb(1), though.. it's only somewhat maintained.. one could go as far as saying it's broken.
I was just about to say that. However, I did not realize it was BSD-Licensed. Google seems to turn up nothing, and I can't find the license in the OpenBSD source tree.
__________________
"Experience is what you get when you were expecting something else." - /usr/games/fortune
Reply With Quote
Old 8th November 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by snes-addict View Post
I was just about to say that. However, I did not realize it was BSD-Licensed. Google seems to turn up nothing, and I can't find the license in the OpenBSD source tree.
As with many programs, the copyright is appended to the header of each source file..

The majority of which are ISC licensed, the authors being:
Copyright (c) 2002 Artur Grabowski <art AT openbsd.org>
Copyright (c) 2002 Federico Schwindt <fgsch AT openbsd.org>
Copyright (c) 2002 Jean-Francois Brousseau <krapht AT secureops.com>

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pmdb/

Also, I'd like to correct my prior post.. pmdb(1) does work, but I forgot about the ptrace(2) requirement, I'm pretty sure the GENERIC kernel does not have PTRACE compiled in by default.

EDIT: For sake of correctness, the license on a few of the files is 2 clause BSD, which.. the ISC is an equivalent of.
EDIT2: Here I am, demonstrating my ignorance.. PTRACE is part of GENERIC, the pmdb(1) bugs I'm seeing may genuinely be bugs.

Last edited by BSDfan666; 8th November 2008 at 06:19 AM.
Reply With Quote
Old 8th November 2008
snes-addict's Avatar
snes-addict snes-addict is offline
Real Name: Ken
BSD gamer
 
Join Date: Oct 2008
Location: Minnesota, USA
Posts: 34
Thanked 0 Times in 0 Posts
Default

Quote:
Here I am, demonstrating my ignorance.
That's alright. Forgetting to even read the source files is, to me, even more humiliating!
__________________
"Experience is what you get when you were expecting something else." - /usr/games/fortune
Reply With Quote
Old 8th November 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

There're also the two branches of TenDRA, at ten15.org and tendra.org respectively. Currently, only the ten15 is in FreeBSD ports. I'll probably port the tendra.org one some time this month.
Reply With Quote
Old 21st November 2008
vigol's Avatar
vigol vigol is offline
Real Name: mehrshad moslehi
vigol
 
Join Date: Aug 2008
Location: tehran
Posts: 30
Thanked 0 Times in 0 Posts
Default

First of all (x)HTML isn't even a language. Although from it's term it's imply "LANGUAGE", but ; in fact, it's just a Markuping System/Structue.
!I think So.!

1. (Asm & C & C++) + [T]?CSH ( & in some rarely cases : SH) + "Saint perl" +
Some *UNIX [Like!] tools/LANG (grep, awk, sed, ...) +++ VI/VIm=> I Have all things. so, Why do I hurt myself with learning something else?

2. C# is only one ugly quick answer, nothing much.
3. Java was a good idea with a wrong situation, I beleive that it -- bytcode - must be implement in C/C++ heaven too!
4. C# & Java -- All_Together -- : It's just a draft of a theory, but I think many phenomenons on the earth are bothered from Kernighan and Ritchie's book -- C Syntax --, from 1978 till now! I LOVE C Syntax -- especially Arrays! , and mentioned authors, too. What's some people problems with Array Syntax ? I don't know exactly!
__________________
mehrshad moslehi ---- vigol ---- vigolyas
Reply With Quote
Old 25th November 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by vigol View Post
+ [T]?CSH ( & in some rarely cases : SH)
As much as I love TCSH for my login shell (interactive use), I probably wouldn't use it for any serious shell scripting (though it will work for a simple quick and dirty - one time use - script).

I think someone posted here the link to why (t)csh isn't a good choice for shell scripting. But here's one reason off the top of my head - portability. Not a problem if you are the only one going to use it, but if you want to distribute your script you have a much higher probability of it being able to run with (ba)sh than with (t)csh (though, in all honesty I can't imagine a modern desktop install not having at least one variant of sh, csh, and ksh).
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 25th November 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,071
Thanked 198 Times in 156 Posts
Default

Csh Programming Considered Harmful
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 27th November 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

^^Thanks for posting the link.


But, I still like TCSH for my login shell.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 27th November 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,071
Thanked 198 Times in 156 Posts
Default

Quote:
But, I still like TCSH for my login shell.
So do I, but programming in it is a definite no-no.

Only the lack of proper output redirection bothers me sometimes, other than this, I have no problems with tcsh as a login shell.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Tags
programming, programming language

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Favorite Programming Tools JMJ_coder Programming 15 28th March 2012 01:40 PM
your 3 favorite games welkin FreeBSD Ports and Packages 17 5th June 2010 08:26 PM
Best Web Application Language JMJ_coder Programming 24 25th November 2008 12:25 PM
The language here scottro Feedback and Suggestions 11 19th May 2008 11:54 PM


All times are GMT. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick