Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Which program language to choose?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
MD.Angelov
Posts: 9
Joined: 2014-10-02 06:30

Which program language to choose?

#1 Post by MD.Angelov »

Hi,

i was thinking to spent some time on building control panel and logout screen for fluxbox. I want also to make them look lika a native part of fluxbox. I have no experience (well... a little bit, but I can't call it real experience) so thats why I ask this question here. Will python suit my needs? I also want to use pyGTK to build some cool interface.

Greets,
Angelov

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Which program language to choose?

#2 Post by dasein »

MD.Angelov wrote:Will python suit my needs?
Yes. Python is an excellent choice for what you're looking to do.

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Which program language to choose?

#3 Post by schnuller »

No, pyhton is not a good choice.

Now try to figure out which of the both arguments is better ...

MD.Angelov
Posts: 9
Joined: 2014-10-02 06:30

Re: Which program language to choose?

#4 Post by MD.Angelov »

Haha...a good one. Because I am totally noob in programming I first checked what are the pros and cons of python and 2 other languages (C and C++). C and C++ are very different (and somehow more difficult to manage) than python... so I thought lets do it in python as the things I want to do are not that complex. Anyway... can you tell me what are the benefits if I write this two apps in C/C++ instead of python ?

Greetz,
Angelov

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Which program language to choose?

#5 Post by schnuller »

I just do chat:
pyhton is said to be more easy. It is rather hip too (many use it), and many do recommend it too. It also is kind of a one-size-fits-all-solution (but then: of what programming language isn't that said? ...)

I guess, but am not sure, that fluxbox is written in C. I for one would choose C for that reason. It also has a very high reputation (most languages today are based on it ... and most are even written in it).

python is an interpreted language, C is a compiled one. It might be interesting to see the difference between both approaches.

-
In short: I am pretty sure you will be very fine with python (it does what you want, you will get help by a big community and it is easy to learn, it will also suit the needs of your further projects, as long you don't plan to write an operating system ... :-) ).
But if you learn C, then it will help you to understand other (less basic) programming languages like python. To say: "Python is easy" doesn't mean much, as long one hasn't seen C.

Really just a bit of chat from a non-programmer.

Hralgmir
Posts: 48
Joined: 2012-07-16 01:05

Re: Which program language to choose?

#6 Post by Hralgmir »

I worked through a C++ tutorial, but then found that to do anything useful I needed to then learn C, as most real world applications use parts of C in C++.
So it was interesting, but so far I mostly now just use C. The Gnu C Tutorial is a good place to start, but you would need to go through it so it would take a while. The GNU C library reference manual is also useful. C is quite a stable language, what you learn now should be relevant for many years it would seem. I haven't used Python so can't compare that, but from what I have seen from looking at the odd Python file it looks quite like old BASIC. I think Grub is written in Python if I recall correctly. A lot of Linux software is in C though.
If you want to do graphical stuff like make windows, then after learning the language you need to learn a graphical library, which is almost like another language used as well.
GTK is common but currently the documentation is outdated as it has been recently altered quite a lot, so the old tutorials describe functions that have been deleted and so forth.
If anyone knows of a good up to date GTK tutorial then I would be interested in that myself. Having done a bit with the old GTK tutorial when it still worked, when you use this a lot of the details of the windows are created fairly simply, so you don't need to get down to controlling pixels, rather you call a function to make a window, then add a button with another function call and so forth. There are other graphical libraries too, some of which are related mostly to certain desktops.
Also you could look at Glade if you wanted an easy answer. Glade supposedly provides a simpler way to make graphical applications although I have not used it myself.
I think Python would probably be as good a choice as C although I doubt it would be easier. The performance advantages of C are only going to matter if you write huge projects, providing you compile the Python to a binary before using it.

twoflowers

Re: Which program language to choose?

#7 Post by twoflowers »

LISP is the only truth!The rest is for mueslieaters :mrgreen:
... there is a variant called Racket that comes with a great IDE, too http://racket-lang.org/ - you might want to take a look if you are new to programming.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Which program language to choose?

#8 Post by RU55EL »

schnuller wrote:No, pyhton is not a good choice. [...]
I agree. Python is a better choice.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: Which program language to choose?

#9 Post by tomazzi »

RU55EL wrote:
schnuller wrote:No, pyhton is not a good choice. [...]
I agree. Python is a better choice.
I agree. Java is a better joice: It has that woderfull, state-of-the-art "garbage collector", so even if some uneducated, clueless programmer will write the most shitty code under the SUN, then still java runtime can handle it...
Next generation programmers will have to just learn few pictograms, and all the 9 available combinations will allow to make a wonderful game in just 3 clicks... I just can't wait untill this happen to be truth... ;)

... but seriously:
Hralgmir:
I'm mostly agree with what You've said, with few exceptions:
1. C++ is an extension of C, so naturally C++ programs are written using mostly C syntax.
2. The performance of C programs does not come from the fact that they're writen in C, but due to a fact that they're not written in C++ ;) But speaking seriously: C++ exceptions and automatic object constructors/destructors are adding significant overhead in both size of an executable and the speed of execution. From my experience, the overhead can be as big as 20-30% in executable size (and more than 60% in debug builds), and depending on the code, over 10% in execution speed.
But in fact, this would be completely irrelevant, if no other factors would exist. But they do exist, f.e.: rather low portability between compilers and platforms, due to various reasons, like f.e much bigger C++ runtime lib size (comparing to C/uC), higher requirements for stack size, much higher memory requirements, much more harder/complicated creation of libs (due to problems with exporting classes), etc, etc... just to name few.

Regards.
Odi profanum vulgus

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Which program language to choose?

#10 Post by schnuller »

RU55EL wrote:
schnuller wrote:No, pyhton is not a good choice. [...]
I agree. Python is a better choice.
:-)

I saw the typo myself, but didn't bother correct it. Slightly confused to find people who actually read what others post
(for what it's worth: In German there barely is a "th" to be found, besides in words "Mathematik", latin origin words?, hence i always got hard times with it).

Hralgmir
Posts: 48
Joined: 2012-07-16 01:05

Re: Which program language to choose?

#11 Post by Hralgmir »

MD.Angelov wrote:Hi,

i was thinking to spent some time on building control panel and logout screen for fluxbox. I want also to make them look lika a native part of fluxbox. I have no experience (well... a little bit, but I can't call it real experience) so thats why I ask this question here. Will python suit my needs? I also want to use pyGTK to build some cool interface.

Greets,
Angelov
In terms of performance I was thinking that this project was interfacing on a human timeframe (quoting the planned project above!). A lot of the time to open the app would come from the graphical library side, and whatever language managed the rest would be running once, not in a loop, for the most part. So for projects like this it is going to execute effectively instantaneously whatever you used, unless you got into seriously long code files. After going through a C++ tutorial and learning how to use cout, I later looked at the wxwidgets graphical library. Almost straight away I found odd things like printf that I was supposed to know about, which are C language functions, although they can be used in C++ too, but are not really part of C++ (I think!), so that's why I'd suggest looking at C before C++ as it is a more logical way to do that, even if you wanted to learn C++. You don't have to of course, I didn't, but I remember being a bit disappointed to find out I had to learn C as well after learning all the C++ basics so thought I should mention it.
My current personal preference is C over C++ as it's simpler but can do the things that C++ can too if you really want to implement them. Also I think the syntax in C is more logical in terms of the use of * and &, despite C++ needing fewer operators. But then I don't know much C++ and there are aspects of C I haven't even looked at so it's all an unfinished concept for me.
If you were running at boot, interfacing with other electronics or programs, doing long calculations, running frequently or in loops or probably many other situations, then performance might be more of an issue, but sometimes it would not be much of a concern.

sirfer
Posts: 32
Joined: 2013-05-15 23:13
Location: Auckland, New Zealand
Has thanked: 14 times
Been thanked: 2 times

Re: Which program language to choose?

#12 Post by sirfer »

Java is great, but not for OS/Windowing stuff, just for high-level apps.

My 2 cents

Post Reply