Welcome, Guest. Please login or register.
April 28, 2024, 09:14:04 AM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: What programming languages should I learn? 0 Members and 1 Guest are viewing this topic.
Pages: 1 [2] 3 Go Down Print
Author Topic: What programming languages should I learn?  (Read 18870 times)
Samwise
Moderator
Posts: 19224

sentient yeast infection


WWW
Reply #35 on: October 12, 2007, 07:08:00 PM

Basically programming is by no means arcane magic and I seriously never understood the focus on specific languages that many colleges nowadays have.

This.  None of the required computer science courses I took in college were about "learn this language".  You usually learned a language or two or three as you went along, but that was almost incidental.  Taking a class in a particular language always strikes me as putting the cart before the horse.

It's like... I want to get better at typing.  What finger should I practice with first?

"I have not actually recommended many games, and I'll go on the record here saying my track record is probably best in the industry." - schild
Margalis
Terracotta Army
Posts: 12335


Reply #36 on: October 12, 2007, 09:13:35 PM

The important thing is developing a methodology and good habits.

You'd be amazed at how many engineers are not good problem solvers. Simple things like eliminating variables and starting with simple test-cases are beyond many people, as is writing code that fits together properly.

If I had to give one piece of advice to any programmer, it would be that for each block of code (function, piece of a function, etc) understand what you are trying to accomplish very clearly. With large applications many people end up with tiers of code that do something but they aren't sure of exactly what, which makes it impossible to fit them together or debug.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Yoru
Moderator
Posts: 4615

the y master, king of bourbon


WWW
Reply #37 on: October 13, 2007, 03:58:19 AM

Jesus, yes, everything Margalis just said.

When just starting out, it's a pitfall for many newbies to pick a single language and focus on that to all exclusion of anything else. I see this a lot in people who come out of trade schools or degree-mill programs - they "know how" to program in C# or VB or Java, sometimes C++. And by "know how" I mean "they can generally describe the syntactical and occasionally semantic structures of the language to an intermediate level, but have no idea why the fuck anything is structured like it is."

Maybe it's just me being an elitist oldschool dorkwad, but the real value, I find, is in someone who knows not just how to work the tools, but really more why the tools work as they do. When you understand your tools, you can figure out how to apply them properly in a given situation with some experience and brain-grease.

So. Yes, starting out, learn one of the New Hotness languages like C#, Java, Python, Ruby. Any of them. Just get into programming. And fucking Jesus, do it for the love of it, not for the money - if you love it, you'll learn to do it right; if you want to get paid, go get an MBA or sell real estate or something.

However, after 6-12 months, you should be looking at picking up a second, reasonably similar language. You won't even fully understand your first language by this point, but the real value in learning two alike languages is having a basis for comparison. See how they're similar. See how they're different. Compare. Contrast. Figure out what one does better than the other, and try to find out why. This is the point at which you realize that programming languages are just tools to get a job done, and there's a shitton of tools out there. Anyone who claims that a single language is the proper fit for all applications is merely a Tool, capital T.

You should also be learning about various basic computing concepts. Learn how a compiler works, learn how an operating system works, learn the basic math behind Turing machines and automata. Learn algorithm analysis. Why? This is all basic B.Sc. level shit that will help you immeasurably if you really understand it; it helps you understand why computers (and languages) operate as they do, and gives you good models and points of reference to base future work on.

Learn how to debug well. Learn to isolate problems and learn to construct good tests. Learn to construct batteries of tests that you can subject you code to. Learn rigor, in the mathematical and engineerological sense of the word.

Eventually you're going to want to peek at Assembly, in some form, to get an idea of what the compiler is building for you. You'll want to eventually know a very low-level language, like C, since pretty much all of UNIX is built in it, and unless you're living purely in a Consumer Desktop Apps world, you'll bump into UNIX at some point. You'll eventually need to learn about memory management without garbage collection, if only in an academic sense (depending on your future occupation).

And here's the thing about real work - a lot of the real work isn't greenfield coding. It's fucking around with libraries, tinkering with existing shit. Learn how to read and deconstruct other people's code and systems, learn how to document your own to prevent whoever comes after you from tearing their hair you.

Uh... and learn to drink. :)
WindupAtheist
Army of One
Posts: 7028

Badicalthon


Reply #38 on: October 13, 2007, 04:22:55 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.

"You're just a dick who quotes himself in his sig."  --  Schild
"Yeah, it's pretty awesome."  --  Me
Yoru
Moderator
Posts: 4615

the y master, king of bourbon


WWW
Reply #39 on: October 13, 2007, 04:34:10 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.

Java. You can get Java compilers for free, hell, there's even a free IDE if you want one (Eclipse). They can deal just fine with commandline I/O, if that's what you want, and it has a reasonably complete set of basic UI tools (Swing/AWT - last ones I used, several years ago).

C# costs moneys, in general. Although I think XNA Game Studio Express is all C#-driven, I don't know how suitable it is for commandline stub programs. It does game stuff though. :)

Edit: As for "compile and send to other people", I know there's ways to package compiled Java into Windows executables, but damned if I remember how. C#/XNA GSE might be what the doctor ordered though.
Krakrok
Terracotta Army
Posts: 2189


Reply #40 on: October 13, 2007, 05:14:25 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.

Use this:

http://www.lazarus.freepascal.org/
tkinnun0
Terracotta Army
Posts: 335


Reply #41 on: October 13, 2007, 05:58:36 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.

Javascript, it's in your browser. Find a small script from the web, save it to your desktop and click reload to compile. The rest just follows from there.
Quinton
Terracotta Army
Posts: 3332

is saving up his raid points for a fancy board title


Reply #42 on: October 13, 2007, 06:01:00 AM

From an actual making money point of view learning ANSI C is probably a dead end (not really but there are a LOT of very good C coders already in those positions), from an understanding what the hell everything is doing at a fundamental level though it's golden.  The problem is that it takes years of work with ANSI C to actually be any good at it and I would never do a complex project on a limited time schedule in it given a choice.

Ahaha...  I *love* that nobody bothers learning system levels languages or skills any more from a job security point of view.  It does make it really hard to hire more qualified kernel engineers in my group, which kinda sucks though.

I am a bit amazed at the kids these days coming from programs where they only learn Java who have absolutely no clue what the machine is actually doing under the hood and are utterly dependent on their fancy IDEs to have any hope of doing anything.  Nobody has ever been able to teach effective debugging, from what I've seen.  Not now, not ten years ago, not long before my time.

- Q
Quinton
Terracotta Army
Posts: 3332

is saving up his raid points for a fancy board title


Reply #43 on: October 13, 2007, 06:16:34 AM

As a point of reference, here's what worked for me.  I did grow up with 6502 based microcomputers though -- the world has moved on in a number of ways since then:

BASIC was a nice place to get started with programming -- these days something like Python might make more sense though.  A friendly environment where you can get used to general concepts and do useful stuff but have a bit of a safety net.  Interactive modes and not needing to muck about with compilation make this sort of thing extra beginner-friendly.

6502 Assembly was a fantastic way to wrap my head around what the machine actually does -- I'd suggest ARM these days as a nice clean instruction set which has the advantage of being used in virtually every mobile/embedded device shipped now.  Lots of practical uses for it and little dev boards available for cheap.

I spent a lot of time exploring C / Pascal / x86 assembly / C++ / other random languages.  A number of people have made the (very good) point that programming (or software engineering for that matter) is not about a particular language so much as a set of problem solving skills that can be used with a wide variety of tools (languages, libraries, debuggers, etc) as appropriate for the situation at hand.
I wrote a lot of C and C++ stuff in college with a fair bit of assembly intermixed.

What you use will be colored a lot by the kind of projects you want to work on and on what level.  I do OS engineering stuff and tend to work in C or Assembly mostly, sometimes dealing with higher level bits in C++/Java and a whole host of scripting and domain specific tools (Python/Lua/Make/Awk/sh/etc) to glue things together. 

Theoretical background is good stuff but don't wait too long to get your hands dirty.  Best way to learn how to write software is to write software.  Experiment.  Try things outside of just simple coursework exercises.  Find a small-midsize project that's interesting and try to make something that does something interesting to you.  Find a middle ground between being too ambitious (being able to actually complete the projects you try is a nice thing) and too cautious (you're not going to learn a lot if you don't push your limits).

- Q
bhodi
Moderator
Posts: 6817

No lie.


Reply #44 on: October 13, 2007, 06:42:19 AM

Use Perl!
Signe
Terracotta Army
Posts: 18942

Muse.


Reply #45 on: October 13, 2007, 07:26:30 AM

I don't even know why you'd want to learn one anyway.  BORING!  Do something exciting and profitable, instead.  Be a spy or a rent boy.

My Sig Image: hath rid itself of this mortal coil.
Morat20
Terracotta Army
Posts: 18529


Reply #46 on: October 13, 2007, 09:36:42 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.
C# is free as well -- just get Microsof'ts C# visual studio. Their free version offers you anything you're really likely to need. Java, as I noted before, is also free and has a mertic shit-ton of open-source solutions and modules for practically anything. Lately I've been playing with Java's native security packages (admittedly for an otherwise boring class called "Shit you already knew about security, plus cryptography which you didn't know") and that's been fun. I've been meaning to see what C# has in terms of security options.
Samwise
Moderator
Posts: 19224

sentient yeast infection


WWW
Reply #47 on: October 13, 2007, 11:06:18 AM

*pokes head into thread*

Is there a reasonably modern language I can get for free, write shittly little programs with like it's the eighties and I'm a kid with a Commodore 64, compile, and send to other people?  I haven't coded shit since I *was* that kid.

All of the languages you could use back then are still around and freely available, if you don't want to bother learning any new ones.  If you've still got any of those old books that had programs you could type in, they'll probably still work on "modern" versions of those languages.  This looks like a decent free version of BASIC.  LogoFORTRAN 77.

The more "modern" free equivalents would be scripting languages like Perl, Ruby, Python, PHP, etc.  Those are so easy to find free interpreters/compilers for that I won't even list them here.   smiley

"I have not actually recommended many games, and I'll go on the record here saying my track record is probably best in the industry." - schild
Murgos
Terracotta Army
Posts: 7474


Reply #48 on: October 13, 2007, 12:05:27 PM

I'm actually having trouble coming up with a popular language that costs money atm.  As was mentioned earlier even C#/VB.NET/ASP.NET is free, as in beer, and a MS C# IDE is freely available.  I think every language mentioned so far in this thread is free.

The tools to effectively use many of these languages require a fee of some sort but as far as just banging out some code and watching it run, just takes some download time.

"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
Baldrake
Terracotta Army
Posts: 636


Reply #49 on: October 13, 2007, 12:57:04 PM

As others have said, you should learn an OO language, C, a scripting language and a functional language. You will then be able to pick up pretty much any other language quickly.

The reason to learn C is that it requires you to know the underlying machine model (heap, stack, pointers, etc.), and has no safety net.

Having said all that, I believe it is still true that the majority of the world's commercial codebase is written in COBOL, and a lot of engineering applications are still written in FORTRAN. It's surprising, but there's a big shortage of people who can program mainframes these days. So learn all of the above, but don't automatically write off the older languages.
Quinton
Terracotta Army
Posts: 3332

is saving up his raid points for a fancy board title


Reply #50 on: October 13, 2007, 03:15:46 PM

I'm actually having trouble coming up with a popular language that costs money atm.  As was mentioned earlier even C#/VB.NET/ASP.NET is free, as in beer, and a MS C# IDE is freely available.  I think every language mentioned so far in this thread is free.

The tools to effectively use many of these languages require a fee of some sort but as far as just banging out some code and watching it run, just takes some download time.

Yeah, there's not much of a market for selling people fancy compilers / development environments these days.  The quality of the freely available tools is pretty great.  One of the things I love about software as a hobby or career is the cost of entry is so insanely low.  Anyone who can scare up a computer (not even a particularly new or fancy computer) can be hacking on stuff in no time at all.

- Q
Viin
Terracotta Army
Posts: 6159


Reply #51 on: October 13, 2007, 04:09:00 PM

I know no one has mentioned these, and I don't recommend them as first languages, but if you like to build web apps then learning ActionScript and Flex is pretty neat. ActionScript would be second nature to you if you know Java. Flex is just an extra framework that helps you build a nice GUI for Flash-based apps without hardly any grunt work (especially if you use Eclipse or Flex Builder).


As for learning a programming language .. this has been said above, but I'll say it again. Only do it if you like it. Otherwise, if you think it'll get you a job, yah you might get one but you are going to hate it. And you will probably be a junior/mid-level programmer your whole life working 60-80hr weeks and you'd get stuck with all the crap work because it's the pros who get to work on the fun stuff. Only if you truly enjoy programming will you be happy with a career as a programmer.

Personally, I'd recommend that you learn programming on your own. Go to school if you want a CS degree, but learn programming on your own first (then you'll breeze through the poorly taught classes and maybe pickup on some of the logical skills and practices).

I'd recommend getting into one of the web languages, such as Ruby or PHP. At least then you can build yourself something and have it out there easily.. such as a photo album, your own blog system, a tool to calculate your trade stuff in Eve, etc. Since HTML is easy to learn, you can super easily create an interface for the app - learning GUI stuff in Java is the pits. And, you'd get to learn about working with databases (setup a mySQL instance) and learn how to push/pull/query/optimize so that your app does something useful.

Once you are comfortable with a purely HTML based interface, start working on AJAX/Javascript.. expand it out and learn how those languages work and interface with applications and your browser. Web 2.0+? is the future of consumer apps, and that's where it starts today - Along with flex/actionscript too of course.

Edits for clarity.
« Last Edit: October 13, 2007, 04:13:05 PM by Viin »

- Viin
Yoru
Moderator
Posts: 4615

the y master, king of bourbon


WWW
Reply #52 on: October 13, 2007, 10:32:39 PM

As a precaution, if you want to do web stuff, "Flex" also refers to a tool that helps you build compilers. So make sure you clarify your Googling if you're looking for the web-facing Flex.
CharlieMopps
Terracotta Army
Posts: 837


Reply #53 on: October 14, 2007, 05:55:47 AM

Actually, I already know Apple Basic fairly well. I made a paint program in it in highschool. I didn't know how to store my data properly though and it ended up needing 4 floopys to save 1 image... lol

Another kid in class was a computing genius and is probably making a shit ton of money now. He made a "save the maiden" game, where there was a girl up in a tower and you had to shoot an arrow into the tower with a rope attached. Then you'd climb the rope to save her... at the time, it was as good as any game you could get at a retail outlet.
Murgos
Terracotta Army
Posts: 7474


Reply #54 on: October 14, 2007, 06:41:25 AM

Since I'm not fully awake yet I think I will hand out more advice.

Programming is an iterative and incremental process.  Open your debugger and the languages help files at the same time you open whatever editor you are using for your coding (if you have an IDE that does it all, great!  Learn to use it well).  Use both the debugger and the language guide continuously while you code, double check your assumptions religiously.  Stop at every reasonable point you can and compile.  Figure out where you can do an incremental build that should run and do something and work towards that and then run it and test it!

Does this system sound like more work?  WRONG!  Following those simple guidelines is, in every way imaginable, less work than not doing following it.

Once you are used to that you should be in a state where you are almost never unable to run your code, even if it's just to produce some debug text.  This will save you more time coding and will make you a better coder than 95% of the other advice in this thread and is applicable to all languages.

The debugger is your friend, if you love it, it will give you cake.

"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
Stephen Zepp
Developers
Posts: 1635

InstantAction


WWW
Reply #55 on: October 14, 2007, 11:06:03 AM

Since I'm not fully awake yet I think I will hand out more advice.

Programming is an iterative and incremental process.  Open your debugger and the languages help files at the same time you open whatever editor you are using for your coding (if you have an IDE that does it all, great!  Learn to use it well).  Use both the debugger and the language guide continuously while you code, double check your assumptions religiously.  Stop at every reasonable point you can and compile.  Figure out where you can do an incremental build that should run and do something and work towards that and then run it and test it!

Does this system sound like more work?  WRONG!  Following those simple guidelines is, in every way imaginable, less work than not doing following it.

Once you are used to that you should be in a state where you are almost never unable to run your code, even if it's just to produce some debug text.  This will save you more time coding and will make you a better coder than 95% of the other advice in this thread and is applicable to all languages.

The debugger is your friend, if you love it, it will give you cake.

Amen brothah. I don't think I've heard more actually useful advice when learning programming. From personal experience, the compiler can actually teach you a lot as well if you pay attention: If it won't compile or link, pay attention as to why--and if it's not something trivial (missing brace, typo), then spend the time to learn exactly what the problem is before moving on.

I can't describe how many years of C/C++ programming where I've said "well shit, char * string; didn't work, let's try char string[128] and see if it compiles". Not a good way to learn.

Rumors of War
CharlieMopps
Terracotta Army
Posts: 837


Reply #56 on: October 15, 2007, 10:16:35 AM

I think my biggest problem is going to be lack of knollege of complex functions. For example: Often we have to tell field enginers to wire things, and listed in our database they will be wired via a numbered pair: Like pair 1424, etc... The field tech however sees a bundle of colored wire and says "Which one?" So we had to look it up on a 20 page chart. SILLY! I said... so I went about writing a script. There are 24 repeating colors, so I figured out a formula that would leave me with a uniqe number for each color. 1 for White, 2 for black, etc... The problem was it would always give me a remainder. Like 1.2, 1.6, 1.7 were all = to white... I wanted there to be no remainder, but I couldn't just remove the decimal because it was an integer... I couldn't find a "Round off" feature in my scripting language (it either rounded up or down, and 1.9 would have equaled 2)

In the end someone mentioned "Modulus" to me... I searched the net and:
Modulus
(1) : the number (as a positive integer) or other mathematical
      entity (as a polynomial) in a congruence that divides the
      difference of the two congruent members without leaving a
      remainder.

And there I was... I'm going to have to take some math classes or something.
Murgos
Terracotta Army
Posts: 7474


Reply #57 on: October 15, 2007, 11:07:35 AM

Uh, yeah, not to scare you but programming is all math, mostly algebra.  The more comfortable you are with math the more comfortable you will be as a programmer.  Generally, the math needed is pretty simple though, of course, it depends on what you are doing.  For example at this moment I am supposed to be writing a simulation to verify the bit train input to a second order sigma-delta modulated DAC against the sine wave on the output end but for five years I did web development and hardly ever did anything more complex than the above mentioned modulo arithmetic.

"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
CharlieMopps
Terracotta Army
Posts: 837


Reply #58 on: October 15, 2007, 11:11:45 AM

Uh, yeah, not to scare you but programming is all math, mostly algebra.  The more comfortable you are with math the more comfortable you will be as a programmer.  Generally, the math needed is pretty simple though, of course, it depends on what you are doing.  For example at this moment I am supposed to be writing a simulation to verify the bit train input to a second order sigma-delta modulated DAC against the sine wave on the output end but for five years I did web development and hardly ever did anything more complex than the above mentioned modulo arithmetic.

I'm not afraid of math... I just lacked the knowledge that there was even such a thing as "Modulus" once I knew, I could use it.

What you're talking about sounds like you are doing some sound editing software, and using calculus to do it. I'm very rusty on Calculus =(
Murgos
Terracotta Army
Posts: 7474


Reply #59 on: October 15, 2007, 11:15:34 AM

What you're talking about sounds like you are doing some sound editing software, and using calculus to do it. I'm very rusty on Calculus =(

Similar concepts but it's to drive a series of three-phase motors in a specific pattern and the theory is calculus but in practice it's look-up tables and Taylor series expansion.

"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
Yegolev
Moderator
Posts: 24440

2/10 WOULD NOT INGEST


WWW
Reply #60 on: October 15, 2007, 11:50:49 AM

As far as I could ever determine, no one "does" calculus in the real world.  There isn't really a reason to do it in an established field.

Why am I homeless?  Why do all you motherfuckers need homes is the real question.
They called it The Prayer, its answer was law
Mommy come back 'cause the water's all gone
Morat20
Terracotta Army
Posts: 18529


Reply #61 on: October 15, 2007, 12:07:33 PM

Uh, yeah, not to scare you but programming is all math, mostly algebra.  The more comfortable you are with math the more comfortable you will be as a programmer.  Generally, the math needed is pretty simple though, of course, it depends on what you are doing.  For example at this moment I am supposed to be writing a simulation to verify the bit train input to a second order sigma-delta modulated DAC against the sine wave on the output end but for five years I did web development and hardly ever did anything more complex than the above mentioned modulo arithmetic.

I'm not afraid of math... I just lacked the knowledge that there was even such a thing as "Modulus" once I knew, I could use it.

What you're talking about sounds like you are doing some sound editing software, and using calculus to do it. I'm very rusty on Calculus =(
It's those little tidbits that make the actual formal "How to program a language" class come in handy. :) Any junior college teaching a Pascal (ugh!) or C# or whatnot course will cover a bunch of little functions like that -- ones that are common to most languages, but that you generally won't stumble across in teaching yourself.

Then again, if you're already elbow deep into something, not generally worth it. Just buy a book and skim it.
Salamok
Terracotta Army
Posts: 2803


Reply #62 on: October 15, 2007, 02:02:54 PM

I think my biggest problem is going to be lack of knollege of complex functions. For example: Often we have to tell field enginers to wire things, and listed in our database they will be wired via a numbered pair: Like pair 1424, etc... The field tech however sees a bundle of colored wire and says "Which one?" So we had to look it up on a 20 page chart. SILLY! I said... so I went about writing a script. There are 24 repeating colors, so I figured out a formula that would leave me with a uniqe number for each color. 1 for White, 2 for black, etc... The problem was it would always give me a remainder. Like 1.2, 1.6, 1.7 were all = to white... I wanted there to be no remainder, but I couldn't just remove the decimal because it was an integer... I couldn't find a "Round off" feature in my scripting language (it either rounded up or down, and 1.9 would have equaled 2)

In the end someone mentioned "Modulus" to me... I searched the net and:
Modulus
(1) : the number (as a positive integer) or other mathematical
      entity (as a polynomial) in a congruence that divides the
      difference of the two congruent members without leaving a
      remainder.

And there I was... I'm going to have to take some math classes or something.

This is the one reason why learning a 2nd computer language goes much faster than learning the 1st.  Once you know what functions should be available it takes no time at all to look up the syntax and use them.  Knowing what you are looking for and how to find it are major accomplishments, before there was google-fu there was help-fu.
bhodi
Moderator
Posts: 6817

No lie.


Reply #63 on: October 15, 2007, 02:32:23 PM

I think my biggest problem is going to be lack of knollege of complex functions. For example: Often we have to tell field enginers to wire things, and listed in our database they will be wired via a numbered pair: Like pair 1424, etc... The field tech however sees a bundle of colored wire and says "Which one?" So we had to look it up on a 20 page chart. SILLY! I said... so I went about writing a script. There are 24 repeating colors, so I figured out a formula that would leave me with a uniqe number for each color. 1 for White, 2 for black, etc... The problem was it would always give me a remainder. Like 1.2, 1.6, 1.7 were all = to white... I wanted there to be no remainder, but I couldn't just remove the decimal because it was an integer... I couldn't find a "Round off" feature in my scripting language (it either rounded up or down, and 1.9 would have equaled 2)
You may have been served better with large intergers, bitwise operations, and bitmasking...

For example, if you have Red Green Blue White represented as first, second, third, fourth bits on a binary number, you can easily toggle them individually and then get a number that can easily be broken down into it's component parts. It's a pretty efficient way of storing a lot of boolean (yes or no) values inside one number where space is a premium. If you use a bigint or long, that should give you all the space you need. No need to develop or discover weird mathematical formulae.

A trivial example, using the value above, 1110 in binary, 14 in decimal can be reversed (using a bitmask) and it's component pieces can be siphoned back out very easily to mean that it contains one red, one green, one blue.

I may be misunderstanding your problem, of course, but this is still handy to know.
Sauced
Terracotta Army
Posts: 904

Bat Country '05 Fantasy Football Champion


Reply #64 on: October 15, 2007, 03:17:56 PM

The sooner you start working with unit testing, the better off you'll be long-term.  If you decide to try Java, look into J Unit.  I'm not as familiar with similar tools for other languages, but I'm sure they are out there.

Things you might also look into are source code control and build systems.  Subversion seems to be the defacto SCC system of choice these days, and Maven is being used more and more for builds.  The build system suggestion is just that, you won't need it for a while, but source code control is your friend.
« Last Edit: October 15, 2007, 03:20:30 PM by Sauced »
raydeen
Terracotta Army
Posts: 1246


Reply #65 on: October 15, 2007, 07:59:17 PM

I'm a child of the '80's so BASIC is still my first love. Anything you throw at me I can eventually do in BASIC. It won't be fast, pretty or efficient, but I can do it. For my personal taste, FreeBASIC fits my bill.

http://fbide.freebasic.net/

Contains FreeBASIC + a nice IDE. You can program in line numbers if you so need along with doing QBASIC style syntax. And compile .EXEs. Nice.

I'm futzing about with C/C++ and Python. I used to think Delphi/Object Pascal was the Second Coming but I'm over that now. 1992 has come and gone.

Java? Never could get my head around that one. It just seemed complicated for the sake of being complicated.

</2 cents>

Edit: after reading all the other posts I realize I'm the least qualified to lend any advice here. I only 'code' for recreational sake, not professional. I wish I could code like the big boys but math has always hated me and I probably couldn't code my way out of a wet paper bag. Sooooo....disregard my stupidity unless you like BASIC. If you do, let's GOSUB the night away!
« Last Edit: October 15, 2007, 08:11:38 PM by raydeen »

I was drinking when I wrote this, so sue me if it goes astray.
CharlieMopps
Terracotta Army
Posts: 837


Reply #66 on: October 16, 2007, 05:19:43 AM

Hey, if I can get up to $50k a year I'll be happy. I've pretty much capped out my salary for a self-taught network monkey. Even if I get all my certs the pay doesn't get much better with becoming a manager. There's just too many people in my field, and most of them don't know what they're doing. On top of that, it's only a matter of time before Cisco starts automating a lot of this crap (I've written scripts that do a lot of the work for me so I'm sure Cisco can) and then I'll REALLY be screwed.
Shavnir
Terracotta Army
Posts: 330


Reply #67 on: October 16, 2007, 05:42:24 AM

Since this seems the most appropriate thread to ask, anyone able to help me with a little perl regex I'm trying to cook together?

Basically I want to get the information inside a <li> </li> set of tags, and I want to add
Code:
<a href="http://whatever.com/name">  </a>
inside the li tags.  I've figured out roughly how I can add the href once I've got the variable filled with the name of whatever the item is but I can't quite figure out how to easily extract that.

Edit by Trippy: fixed link
« Last Edit: October 16, 2007, 07:27:39 AM by Trippy »
Murgos
Terracotta Army
Posts: 7474


Reply #68 on: October 16, 2007, 07:35:13 AM

Since this seems the most appropriate thread to ask, anyone able to help me with a little perl regex I'm trying to cook together?

Basically I want to get the information inside a <li> </li> set of tags, and I want to add   inside the li tags.  I've figured out roughly how I can add the href once I've got the variable filled with the name of whatever the item is but I can't quite figure out how to easily extract that.

Well formed HTML is an XML document.  I would look at using the Perl XML parser (XML::Parser) to manipulate your tree than using a cludgy regex.  What you want to do is load the XML (your HTML code) into a data structure, such as a hash, navigate to the <li></li> node(s) in question and then insert a new <a>[/url] node into it.

Not only will this method be more robust (the content of your lists or the structure of the page will disappear as issues) but it will teach you more about what you are really doing when you create an HTML document and how the server sees it which should make you more efficient and more capable for future projects.

"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
Trippy
Administrator
Posts: 23623


Reply #69 on: October 16, 2007, 07:40:40 AM

Since this seems the most appropriate thread to ask, anyone able to help me with a little perl regex I'm trying to cook together?

Basically I want to get the information inside a <li> </li> set of tags, and I want to add
Code:
<a href="http://whatever.com/name">  </a>
inside the li tags.  I've figured out roughly how I can add the href once I've got the variable filled with the name of whatever the item is but I can't quite figure out how to easily extract that.

Edit by Trippy: fixed link
Your question is too vague to give you an exact answer cause you didn't explain where you want to put the contents within the <li> tag but if you wanted to do this with a regular expression you would use ( ) and \1. E.g.:

Code:
$my_var = "<li>blah blah blah</li>";

$my_var =~ s/<li>(.*)<\/li>/<li><a href="some_url">\1<\/a><\/li>/;
would give you:

Code:
$my_var = "<li><a href="some_url">blah blah blah</a></li>";

In other words ( ) "capture" whatever pattern is within them and \1, \2, \3, etc. is used in the replacement section to reference those captured patterns.
« Last Edit: October 16, 2007, 07:46:01 AM by Trippy »
Pages: 1 [2] 3 Go Up Print 
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: What programming languages should I learn?  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC