# Hi again!



## BSDAppentic3 (Mar 9, 2018)

This time i ask for some tips. I want to start to learn some language of programation, which would you recommend me? Which are the best programs for make a program? I don't have very clear where to start.
Another thing: there's some languages which can work best in this system, or they are all the same. I mean, all they have the same performance?
One more ask: I want to create a simile of a program that i cannot found in this OS. The program in question it's from another OS, but it isn't free-source. So in view of that i can't use this program without a license, and i can't edit the code of the original, i decided to create one which can accomplish the same task.
Thanks all you for any help that you can give me.
Waiting for your suggests.
Bye.


----------



## Snurg (Mar 10, 2018)

https://forums.freebsd.org/threads/its-all-about-jokes-funny-pics.286/post-374038


----------



## ShelLuser (Mar 10, 2018)

Snurg that was hilarious, thanks for sharing that with us, otherwise I'd have totally missed it! 

Programming languages...  The big important part, in my opinion, is what the eventual goal is. Is it to learn "programming" or do you actually want to do something with your gained knowledge? The reason I ask: if there are problems to be solved then you might not necessarily need a programming language perse.

But ok...  First: anything will do. If this is only about "programming" then seriously.. It's your call.

I am (well, was ) quite an enthusiastic and vivid (Sun) Solaris user. Sun is the creator of the Java language, and boy did it show! If you installed Solaris using the regular installer then it would actually help to become a little familiar with Java error messages because it was definitely possible to run into a few of those. I'm quite convinced that I'll never be using Solaris again (definitely not for personal use, FreeBSD more than filled in the gap) but my servers still heavily rely on Java. All my servers have OpenJDK + Ant installed and although I definitely prefer using an IDE such as Netbeans I also heavily rely on plain old vi for some basic programming. Usually specific (not too complicated) system tools which I use on my servers.

So here's my take on this.

First: scripting can be a good way to get into programming. What is scripting? Something one tier "lower" than programming. For example: shell scripts. _Never_ underestimate the kind of stuff you can do with them, especially in combination with all your userland tools (test(1) (also known as [), file(1), awk(1), date(1) to name but a few). Just check out sh(1) and you'll soon see that there's much more to your command line ('shell') than merely typing in ls.

Next programming itself..  languages really come in all shapes and sizes. From Perl, PHP, Python right down to Java, C and perhaps even VB.NET. The main problem: with so many languages also come many preferences. We all have our favorites so to speak, my personal ones being Java, C#, VB.NET, C and Perl.

When it comes to learning a language then my recommendation would be a language which is well documented and isn't too low level. For starters I would recommend either Java or Perl.

*Java*

Java is quite well documented (look here for a good example) and also decently popular. What could be a benefit for your learning experience is that it doesn't really matter if you use it on BSD, Windows, Linux, OS X, etc. Java will run almost everywhere, so you could work your way up on Windows (if that's your desktop for example) and then try out your newly gained expertise on FreeBSD.

*Perl*

This language can be a bit tricky to get into, in my opinion it isn't as well documented as Java is (sort off, hear me out!) but once you get your fingers behind the way things work then boy can it deliver! Note that I'm not claiming that it lacks documentation or anything, most certainly not, but it is my personal experience that not all of that documentation is as easy to follow and newbie friendly as it could be. But of course... my experiences are dated.

Although Perl can also run on Windows it'll do you much more good on FreeBSD. Now, the reason why you might want to learn Perl is that it's actually being heavily used in many software projects throughout FreeBSD (if you want to):


```
unicron:/home/peter $ pkg info -rx perl5
        mc-4.8.20_2
        kvirc-qt4-4.2.0_8
        bugzilla50-5.0.4
        inn-2.6.1
        irssi-1.1.1,1
        squid-3.5.27_3
        vim-8.0.1539
        apache24-2.4.29
        git-2.16.2
        postgresql95-client-9.5.12
```
(I trimmed the list a bit for obvious reasons)

All these projects don't necessarily depend on Perl in order to work, but they rely on Perl to provide you ways to control their behavior using the Perl language. And yes, some will refer to that as scripting, true enough, but even so.. If you want to call it scripting or programming, Perl is definitely something worth considering.

And finally, last but certainly not least, there's C.

I'm not too sure about C being a good language to start with, but if you set your mind to it then nothing is impossible I suppose. The reason I mention this is because FreeBSD is pretty much fully build upon C. Just take a look around /usr/src and you'll see.

So if your goal is also to build upon FreeBSD and expand on it with your own toolset.. then this could be an option.

Of course it might be more beneficial to use shell scripts and/or other languages (such as Perl) but if your main goal is "programming" then this is a sure way to give into that.

And that's my 2 cents.


----------



## ralphbsz (Mar 10, 2018)

I agree with everything ShelLuser said about first being clear about your goals.  For example, if you want to become a kernel programmer, you will have to learn C and C++ (but few people want to become kernel programmers, and fewer succeed).  If you want to put things into web pages, then these days there sadly doesn't seem to be a way around Javascript (sadly because my experience with Javascript is that it so full of incompatibilities between versions that you can't get any real work done).  If you want to deal with real-life databases, you will learn SQL (which is nearly a full-fledged programming language).  If you want to do micro controllers, assembly used to be mandatory (today, much can be done in higher-level languages, at least C).  And so on and so on: different problem domains use different languages.  If you become a professional software engineer, then programming language is not the issue: You will know 2 or 3 really well, a half dozen so-so, and every few years add a new one.

On the other hand, if your initial goal is not a job at hand, but the general skill, then I agree with the suggestion of Java as the best full-fledged language to learn.  However, it has a bit of a steep learning curve.

For a language that's a better compromise between scripting and full-function, I disagree slightly.  I think python is better documented, simpler to learn (fewer weird things that have to be explained from historical context), and a better organized library.  Perl is getting large, and it has zillions of libraries, but for many things there are too many libraries, which are often not well "curated", meaning organized and cleaned up.  Python is less troublesome here.

Also: Most computer teaching programs in college these days use Java and/or Python, so learning one of those is more likely to fit into classes.  Matter-of-fact, if you can find a nearby class and can do the learning in a structured setting, that might help you.  I don't know where you are located; in the US "community colleges" often teach these classes, and it is very easy to get in; in Germany there is the "Volkshochschule".  Look around.


----------



## Snurg (Mar 10, 2018)

ShelLuser said:


> *Perl*
> 
> This language can be a bit tricky to get into, in my opinion it isn't as well documented as Java is (sort off, hear me out!) but once you get your fingers behind the way things work then boy can it deliver! Note that I'm not claiming that it lacks documentation or anything, most certainly not, but it is my personal experience that not all of that documentation is as easy to follow and newbie friendly as it could be. But of course... my experiences are dated.
> 
> And that's my 2 cents.


As ralphbsz said, it depends what you want to do.

For texts and web stuff I really love Perl.
What I like with Perl is that it's easy as BASIC. (Very important for retards like me!)
And it can deliver, as ShelLuser correctly stated!

The documentation is excellent. But it supposes that the readers are no retards.
That makes it sometimes hard to grok for a retard like me.
But imho it is very beginner-friendly.

For example, what I particularly like with Perl is its good integration of regular expressions.
For beginners, there is a tutorial to grok the basics of regular expressions.
Once you grokked that, you'll refer more to the normal regular expression reference documentation.
When you grasped that, there is documentation for advanced users, like this or that.

In addition, Perl community is very friendly.

On the other hand, Perl isn't the language of choice if you are into bit fiddling or low level stuff.
Then C is a great tool, as ralphbsz stated.

Just my 2 cents, too.


----------



## BSDAppentic3 (Mar 10, 2018)

Snurg said:


> https://forums.freebsd.org/threads/its-all-about-jokes-funny-pics.286/post-374038


You know what?.... It's funny and tragic at the same time, but i am,well, just a little like that sister


----------



## BSDAppentic3 (Mar 10, 2018)

ShelLuser 


> The big important part, in my opinion, is what the eventual goal is. Is it to learn "programming" or do you actually want to do something with your gained knowledge?


Both. Firstly, i want to do something basic. As i said, a little program that can make *almost* the same than the original. You told me, not here but in another thread, that the practice makes a master. That's what i want to do: first start with some little program, then go ahead.
But for now, i need to tell, that i want to learn some basic and make some basic.
And yes, i have a remotely idea of what is a script. It's created by the user, its function it's do the kind of job for why it was wrote. I'm near, i think.
Look, the languages that i have a barely idea, are: PHP, Java, C, C++, C#, Python, and SQL i think. Those came to my mind now. But even i have books about some of it, i didn't read it too much, so, i barely have an idea about what they are.
Sorry, i saw about Perl in this and others OS, but i never i tried to go further into what is it.
I mentioned that languages because i read, i saw some of it, heard about, or recently discovered. Not because i have created some example. Maybe I'm a bit lazy XD....DX....but if i want to do something, the best then there will be that i even try to learn of what is it about.


----------



## BSDAppentic3 (Mar 10, 2018)

ralphbsz 


> For a language that's a better compromise between scripting and full-function, I disagree slightly.  I think python is better documented, simpler to learn (fewer weird things that have to be explained from historical context), and a better organized library.  Perl is getting large, and it has zillions of libraries, but for many things there are too many libraries, which are often not well "curated", meaning organized and cleaned up.  Python is less troublesome here.


Yes, i have tried with Python. My first experiences with it were in a netbook that the ministry of education in my country that gave to us. I'm not kidding, i think it was the first serious contact that i ever had with a language of programming.
When i saw it, I'm not joking, i felt like "what is this"? "why it's showing me letters and no GUI"? Note: in that time, i didn't have the concept of GUI.
But as time went by, i was linking more and more it. If i didn't almost nothing of languages, i think it was in part because of ignorance, laziness, and because i haven't been thinking logically.


> Also: Most computer teaching programs in college these days use Java and/or Python, so learning one of those is more likely to fit into classes.  Matter-of-fact, if you can find a nearby class and can do the learning in a structured setting, that might help you.  I don't know where you are located; in the US "community colleges" often teach these classes, and it is very easy to get in; in Germany there is the "Volkshochschule".  Look around.


I know nothing of what you're saying about the countries that you're speaking in the quote of above. And I'm not gonna blaming you for not knowing which is my country. No problem. But even in my country, there are courses of what you're speaking. So, again, no problem 
I just need time for go to one of those, or find an university where which i can learn about it.


----------



## BSDAppentic3 (Mar 10, 2018)

Snurg
LOL
Why are you saying you're a retard? I see that you figure as an "aspiring daemon", so I do not think that.
If you are that, then i am a freak. Cause my final objective, at least for now, it's


> For example, if you want to become a kernel programmer, you will have to learn C and C++ (but few people want to become kernel programmers, and fewer succeed)


Yes, call me a freak or a guy who thinks that can do everything, but honestly, i see programming like something basic. Something initial, something that you're mandatoried to learn. I am learning about electro-mechanics, in a future planning to dip into informatic-electronics, maybe learn some of chemistry...and another careers.
Let me tell you, i am not a genius. But i want to study it. That and much more.
So, maybe i want to learn some *hard* programming: kernel programmer, for example. Obviously, when i have a remotely idea of what it is. That's why I called myself a weird. You said that it is difficult, leave that to me. 
That's was one reason why i installed FBSD: while some people they settle for some OS that is "easy-use" i want not the worst, but yes some more advanced.
God...what I'm talking about??? Sorry, i need to write it 


> For texts and web stuff I really love Perl.


I said that i want some more advanced. But for now, need to start with something. I know something of web things, but, as i said, mmm...isn't my favorite, but it's necessary.


----------



## Snurg (Mar 10, 2018)

BSDAppentic3 said:


> Why are you saying you're a retard?


Because there are so many intelligent people that I feel really stupid.
Look, I cannot even do shell programming.
(I guess I could learn it if I would need to do. SirDice says "Experience is something you do not get until you need it" and he is right imho.)

Compared to shell, Perl is easy as BASIC. Just the right thing for guys like me.
Imagine the overhead you would have to do to just add 2 to 2 in languages other than BASIC or Perl.

```
% perl -e 'print 2 + 2'
```
Do you see any difference to BASIC? Imagine doing that in C, Java or such... *ouch! complicated!* 

Quoted from `man perl`:


> The three principal virtues of a programmer are Laziness, Impatience,
> and Hubris.  See the Camel Book for why.


The Camel book explains the pathology very well and in a humorful manner...


----------



## ShelLuser (Mar 11, 2018)

At the risk of going offtopic...  but hey, this is the weekend and all (for me anyway) and oh well. For the record: I'm going to play the "arrogant" card and I won't be diving into this subject in public. Sorry, but we are in tech forum after all. But sometimes.. you need to break a few rules. As long as you don't overdo it.



Snurg said:


> Because there are so many intelligent people that I feel really stupid.
> Look, I cannot even do shell programming.


But is that a reason to talk down on yourself? I have to agree with BSDAppentic3's concerns on this one, there really is no need.

This is just me mind you and my post has already been dubbed an opinionated one by yours truly but seriously... Realizing that you don't know as much as you can does not make you stupid. I dare say it's quite the contrary. I really doubt people would look down on you for not knowing stuff. But.. be careful because there are specific aspects to keep in mind.

There is a huge difference between not knowing or not wanting to know. You don't know shell scripting, who cares? I don't. It would become a different issue however, at least for me, if you'd pretend as much. Or we'd run into issues which would require this expertise, I'd tell you: "look at this link, it shows you how to do it" and you'd start "can't you just tell me how to do it?". Yah.. that would translate to me: "I cannot be bothered to look at that URL, I didn't even try, just shut up and tell me what I need to know". Bzzzzt. From that point on it'll be silence from me.


```
I looked at the link and it didn't do shit:

if [ a = b ] then
   echo a is b!
fi
```
And I'd still have you back. Because you may not have the experience to see through the error here (it's an obvious one for shell users like myself (hey! I like to have fun too!)) you sure as heck tried. Better yet: we've all been here once before and shared those frustrations. So even that wouldn't tick me off (what? you thought I used strong words just for fun? ).

You're no retard. Illiterate perhaps, but nothing stronger than that. Retards would be the guys who don't (or won't) even realize that they still have much to learn.

But yet, whatever rocks your boat   just as this is merely my idea on the whole take.



Snurg said:


> The Camel book explains the pathology very well and in a humorful manner...


I'll just leave this here because I also sometimes like to play favorites


----------



## Snurg (Mar 11, 2018)

You made me curious and this made me read the sh man page thoroughly. I guess there is a 'test' missing?

And, thank you very much for encouraging me!
I sometimes need some motivation to get the desire to learn things I am not really pressed to learn 
Maybe I'll try to write a shell script soon to do some string handling (with filenames) instead of using Perl for that, and learn a bit.
Shell is so cryptic, it will be a challenge for sure, but maybe fun 

But, one thing stays valid... I admire these really intelligent people who grok such things by reading just once or twice and not multiple times... when I look at such people I feel (comparatively) stupid.


----------



## fernandel (Mar 11, 2018)

Because is a weekend:
"Stupidity is a gift of the nature but it is not necessary to emphasize!"
Above is from the Alan Ford comics (older people from European countries* and Brasil maybe remember, or I am too old  ).
*Italy, France,...[FONT=Book Antiqua]Oko[/FONT]


----------

