1c6bf I want to start coding - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, Shell, Perl, Sed & Awk

Reply
 
Thread Tools Display Modes
  #1  
Old June 29th, 2012, 21:28
Grell Grell is offline
Junior Member
 
Join Date: Mar 2011
Location: New Jersey, US
Posts: 59
Thanks: 4
Thanked 2 Times in 2 Posts
Default I want to start coding

Hey, I was wondering, how did you guys start off coding? I myself used to do a little C programming years back but have drifted away from it. I tried to get back into programming (I can't tell you how many Python books I bought, to no avail) but just can't seem to stick with it which is a shame because I used to really enjoy it back in the day, the excitement of finally working out all the bugs and having a functional program cannot be understated. Anyway I was wondering what the best course of action to take would be. I want to study computers, mainly *nix and programming, in college and will be soon. So thanks in advance for any pointers.
Reply With Quote
  #2  
Old June 30th, 2012, 11:54
drhowarddrfine drhowarddrfine is offline
Member
 
Join Date: Nov 2008
Location: St. Louis, Missouri
Posts: 643
Thanks: 30
Thanked 125 Times in 73 Posts
Default

It always helps to have a purpose and motivation. I have trouble learning anything new if I don't have something useful to apply it to. For me, even if I make something up, I can't get into it unless I or someone else will really use it.

For example, there were some new techniques and languages I wanted to try for the web. I dreamed up an imaginary web site and started tinkering with it. Months went by. I struggled with it. Progress was very slow. Then my son needed a web site using those same techniques. I put the whole thing together using all those new things in four weeks.

So the motivation is that someone would actually use the thing along with the praise and adulation you get.
Reply With Quote
The Following User Says Thank You to drhowarddrfine For This Useful Post:
oops (July 2nd, 2012)
  #3  
Old June 30th, 2012, 13:26
throAU throAU is offline
Member
 
Join Date: Jan 2012
Location: Perth, Western Australia
Posts: 561
Thanks: 92
Thanked 78 Times in 72 Posts
Default

I'd download GNUstep, play with objective C and GORM.

This will give you a half decent background to start developing IOS or Mac apps, and also give you a background to help with Etoile development.


But yes, as above - find a problem to solve, and then work towards it. Trying to learn to code without an itch to scratch is pretty difficult.
__________________
I use: FreeBSD, Mac OS X, Windows, Netapp, Cisco UCS, Cisco CUCM, Cisco IOS, Cisco ASA, vSphere 5.1, Cisco ISE, Orion NPM

Last edited by DutchDaemon; June 30th, 2012 at 19:14.
Reply With Quote
  #4  
Old July 2nd, 2012, 13:23
roddierod's Avatar
roddierod roddierod is offline
Member
 
Join Date: Nov 2008
Location: On my Slingerlands!
Posts: 639
Thanks: 29
Thanked 72 Times in 62 Posts
Default

To add to drhowarddrfine's response: another thing is program something that you can use or is related to something you like. For example, I collect records/CDs and I created an app for myself to keep track of my records. I used that to learn WxPython a few years ago. To learn Django and PostgreSQL I created a web application for my wife to store her recipes.

Last edited by DutchDaemon; July 2nd, 2012 at 15:11.
Reply With Quote
  #5  
Old July 2nd, 2012, 19:49
neilms's Avatar
neilms neilms is offline
Member
 
Join Date: Jun 2010
Location: Cydonia
Posts: 125
Thanks: 17
Thanked 2 Times in 2 Posts
Default

Like you I started trying to learn C but after a few months stopped. I then started trying C++ and bought loads of books - but same problem, I stopped and started trying to work all the exercises in a book. The thing is that the answer was given by the inventor of C++, Stroustrup wrote that the best way to learn C++ was to use it. I did not understand fully what this meant until very recently.

In simple terms, you will find it hard to learn to program without trying to solve a real problem. Sure, you need to know the basic syntax but to understand it - you must apply it in the context of a real problem that strech your ability. Then you can go to the books for reference. At the end of your work, you will be surprised what you have learned not only about coding, but the system generally.

Recently I decided to put together a simple game - which has been done before by many others. But I wanted to try it myself and this has helped me a lot even though I have not finished as yet.

hth

Last edited by DutchDaemon; July 2nd, 2012 at 22:41. Reason: It's "I": http://en.wikipedia.org/wiki/Capitalization#Pronouns
Reply With Quote
The Following User Says Thank You to neilms For This Useful Post:
Grell (July 2nd, 2012)
  #6  
Old July 6th, 2012, 01:32
TheDreamer TheDreamer is offline
Junior Member
 
Join Date: May 2012
Location: Manhattan, KS
Posts: 32
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Well, I started out my programming career by finding a program that I used regularly, that was incomplete and had bugs. So, I fixed various bugs and made various enhancements to it. (A 4.x version of Directory Util for the Amiga, someone at a users group meeting referred to my program as 'duV'...and that became its name.)

I also spent some time rewriting other programs in other programming languages. Like in high school for extra credit, I translated a BASIC programming class into a PASCAL programming class. The following semester the teacher taught PASCAL programming. I then started translating the same programming class into C, while I was learning it myself. I hear the year after I graduated high school, they were offering C programming classes. In college, for no useful reason, I spent time translating a collection of FORTRAN subroutines into C (and RPL).

But, in my first job, I ended up being the guy to translate FORTRAN programs into C. The company I was with had decided that Unix and C (and X/Motif) would be the direction to go in with its Engineering software. But, the company had started out with time bought on a Honeywell mainframe and FORTRAN, and early versions of the software were FORTRAN on x86. Plus research codes being developed at various Universities were FORTRAN. Reimplementing our algorithms in C was one thing, but not so easy when we needed to integrated algorithms written in FORTRAN by other entities. And, this was well before ADA was the required programming language with the DoD.

Though I got to do a DoD project where I had C++ classes generated from the ADA design tool, and I filled large portions of the member functions from the older C program...and newer algorithms that started out life on bar napkins.

Later in my programming career. I worked fixing bugs in other people's programs, including some written in languages that I was learning as I was fixing. Of course, new product development is much more lucrative. And, companies go through phases where they need to streamline their new product development....so software maintenance types get the door.

First two jobs, I started primarily as a software developer, but gradually doing more and more system administration. Second job, I was officially laid off as a software engineer, but kept on for a while long as a full-time system administrator. And, now that's my current job.

But, I still find myself occasionally poking around inside other people's codes.

The Dreamer
Reply With Quote
  #7  
Old July 29th, 2012, 04:07
AdviceNeeded
Guest
 
Posts: n/a
Default Which Programming Language?

I have about 30 QuickBasic programs, with the QuickPak Professional extensions, that I wrote about 15 years ago. I still use the same tools to write new programs. These programs require MS-DOS. So you see the problem. MS-DOS will become unavailable as soon as my last remaining computer with Windows XP goes dead. These programs are fairly sophisticated, and use bitmapped graphics. I use them for my investing, so they are important and valuable.

I would like to translate them to something modern, with "staying power", so I don't have to do another translation in the next 10 to 20 years. What programming language should I learn to accomplish this? I can probably learn most anything, as I have experience in everything from assembly language to PASCAL. But I want to spend as little time on this project as possible, so something similar to QuickBasic would be nice.

Or any other constructive advice would be appreciated.

Thanks!
Reply With Quote
  #8  
Old July 29th, 2012, 05:05
qsecofr qsecofr is offline
Member
 
Join Date: Mar 2009
Location: PDX
Posts: 198
Thanks: 27
Thanked 8 Times in 8 Posts
Default

What are some of the functional aspects of the investing programs do you want to port? It might make for an easier transition to port to another language offering similar functional elements, rather than port to a syntactically similar language in which you might be reinventing the wheel.
Reply With Quote
  #9  
Old July 29th, 2012, 11:28
plamaiziere plamaiziere is offline
Member
 
Join Date: Jan 2009
Location: Rennes, France
Posts: 174
Thanks: 1
Thanked 39 Times in 29 Posts
Default

Quote:
Originally Posted by AdviceNeeded View Post
But I want to spend as little time on this project as possible, so something similar to QuickBasic would be nice.
There are several BASIC interpreters in the ports tree (ports/lang).

Regards.
Reply With Quote
  #10  
Old July 29th, 2012, 12:53
xibo xibo is offline
Member
 
Join Date: Dec 2010
Location: Germany
Posts: 300
Thanks: 13
Thanked 61 Times in 50 Posts
Default

It's almost impossible to correctly predict whether or not a language will still be frequently used in 10-30 years from now.

<troll>Although I do hope Java will be dead by then.</troll>
Reply With Quote
  #11  
Old July 29th, 2012, 13:51
kalle97 kalle97 is offline
Junior Member
 
Join Date: Jul 2012
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Lua is easy to learn, good documentation on the net as well as some great books, I really recomend WROX's lua book.
Reply With Quote
  #12  
Old July 29th, 2012, 16:50
zhoopin zhoopin is offline
Junior Member
 
Join Date: Nov 2011
Posts: 60
Thanks: 5
Thanked 14 Times in 14 Posts
Default

The Roadmap (Beginner to Advanced!)
that I was/am following - Not Precisely, but Idealistically - That's works.

Abbreviation
CS: Computer science
AI: Artificial Intelligence
EEE: Electrical and Electronics Engineering

  1. OS - FreeBSD Handbook & FAQ
  2. Basic FreeBSD tools such as awk, sed, ...
  3. SHELL Programming - SH shell
  4. C Language
  5. Math
    • Calculus
    • Differential Equation
  6. perl Language
  7. Internet, Web and Markup Language
    • HTML5
    • Apache
    • PHP
    • MySQL
  8. Math
    • Engineering Mathematics
    • Discrete Mathematics
  9. CS
    • Algorithm
    • Data Structure
  10. OS - FreeBSD Developers' Handbook
  11. XML
  12. SQLite
  13. CS
    • Database
    • Data mining
  14. Math
    • Numerical Analysis
  15. Computer Networks
  16. C++
  17. Software Engineering
    • SE (Software Engineering)
    • OOP (Object-oriented Programming)
    • XP (Extreme Programming)
  18. CS
    • Parallel computing
    • Distributed computing
  19. AI
    • AI (Artificial Intelligence)
    • Expert system
    • NN (Neural Network)
  20. EEE
    • Computer Architecture
    • Assembly Language
  21. Operating Systems Architecture
  22. FreeBSD Architecture Handbook
  23. EEE
    • General Physics (Electromagnetism)
    • Circuits (Electronics & Logic)
    • Microprocessors
  24. .
  25. .
__________________
Zhoopin (ʒuːpiːn) - Meri - Mehrshad Moslehi
Reply With Quote
  #13  
Old July 29th, 2012, 17:10
mwatkins mwatkins is offline
Member
 
Join Date: Apr 2009
Location: Vancouver
Posts: 121
Thanks: 3
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by AdviceNeeded View Post
These programs require MS-DOS. So you see the problem. MS-DOS will become unavailable as soon as my last remaining computer with Windows XP goes dead.
Have you explored any of the MS-DOS compatible operating systems? Something like FreeDOS, perhaps running in a VirtualBox environment (on Windows or FreeBSD or ...) could allow you to delay porting your application.

As far choosing a language with staying power to replace the Basic you are used to, I'd suggest trying on Python for size to see if it fits your brain.

While it certainly isn't a twin of Basic, compared to some other popular languages Python might feel closer to what you are used to but also offer much more power when you are ready for it. Python is small (syntactically) and as a result many find it easy to pick up. The Python community is large and self-sustaining - the language isn't going to disappear.

I'm aware of some investment houses which use Python internally (regular postings on the Python jobs page at http://python.org/ ) but then again lots of languages get used in big firms.

Two investment related link collections:
http://vermeulen.ca/python-stock-market.html
http://stackoverflow.com/questions/4...ysis-in-python

You'll find plenty of third party package support for your needs (NumPy / SciPy, matplotlib, Python wrappers for Google Chart,and many others). SQLAlchemy offers an object relational mapper to SQL database engines; ZODB or Durus are two Python object databases worth checking out too.

Sometimes overlooked is the power of an interactive prompt. I have data for analysis and performance tracking maintained in a Python object database (my preference but my investment analysis system easily could have been developed using a SQL database) and often I'll fire up an interactive Python prompt to execute short commands or "queries" against the data. I source data from some free web sources but also rely on subscription real time and end of day providers.
Reply With Quote
  #14  
Old July 29th, 2012, 19:48
UNIXgod's Avatar
UNIXgod UNIXgod is offline
Senior Member
 
Join Date: Nov 2008
Location: pwd
Posts: 1,089
Thanks: 112
Thanked 194 Times in 158 Posts
Default

Ruby is a very nice and elegant language which follows the UNIX paradigm( awk, sed, grep, c and shell). It's a completely object oriented programming language with regular expressions built in. It's also a very fun language to work with.

I could see it being a very good language to start with. Much the way we had BASIC as kids; or people use python now.
__________________
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/freebsd-stable/2011-January/061078.html
Reply With Quote
  #15  
Old July 30th, 2012, 09:47
mwatkins mwatkins is offline
Member
 
Join Date: Apr 2009
Location: Vancouver
Posts: 121
Thanks: 3
Thanked 14 Times in 13 Posts
Default

Either Ruby or Python would be good first choices to look at. Both have vibrant lasting communities around them. Invariably one or the other will fit one's brain a little better - go with whichever feels good.
Reply With Quote
The Following User Says Thank You to mwatkins For This Useful Post:
UNIXgod (July 30th, 2012)
  #16  
Old July 30th, 2012, 20:10
UNIXgod's Avatar
UNIXgod UNIXgod is offline
Senior Member
 
Join Date: Nov 2008
Location: pwd
Posts: 1,089
Thanks: 112
Thanked 194 Times in 158 Posts
Default

Quote:
Originally Posted by mwatkins View Post
Either Ruby or Python would be good first choices to look at. Both have vibrant lasting communities around them. Invariably one or the other will fit one's brain a little better - go with whichever feels good.
This is the best advice!
__________________
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/freebsd-stable/2011-January/061078.html
Reply With Quote
  #17  
Old July 31st, 2012, 04:00
AdviceNeeded
Guest
 
Posts: n/a
Default

Thanks to all of you who replied. You have saved me a bunch of time. Here is my to-do list based on your advice.

1. Look into FreeDOS or other MS-DOS compatible opsys., per MWatkins' suggestion. That would be ideal - no rewriting at all!!

2. Search (ports/lang) for BASIC interpreters that would run independently of MS-DOS, using my current code. I suspect this will not work because my main program uses graphics pages that are not supported in WINDOWS. Or at least that's my impression. But I'll look at this approach since it might allow me to keep most of my current code and just rework the graphics.

3. Explore Python (most votes), Ruby and Lua as alternatives to BASIC.

4. Look into the other resources mentioned by MWatkins.

Again, thanks much!
Reply With Quote
  #18  
Old August 1st, 2012, 04:33
UNIXgod's Avatar
UNIXgod UNIXgod is offline
Senior Member
 
Join Date: Nov 2008
Location: pwd
Posts: 1,089
Thanks: 112
Thanked 194 Times in 158 Posts
Default

I ran across the old Norvig post on beginning programming. It's a very good read:

http://norvig.com/21-days.html
__________________
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/freebsd-stable/2011-January/061078.html
Reply With Quote
Reply

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
PHP won't start Alex4108 Web & Network Services 6 September 7th, 2011 13:26
Atmail coding whilst driving around OZ johnblue Off-Topic 0 December 21st, 2009 08:01
Contribute in to a Coding,? Yes, How ..? internisiti FreeBSD Development 12 November 8th, 2009 07:47
To start my X session first I must start as root user titoernano X.Org 3 August 14th, 2009 20:38
[Solved] How to Start KDE? ViceRoy16 KDE 7 June 14th, 2009 06:46


All times are GMT +1. The time now is 17:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0