Author Topic: Get better at C or at Python  (Read 18708 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Get better at C or at Python
« on: July 07, 2012, 07:03:11 am »
Im a Comp Eng student, and i have about 2 month of vacation, but i really got nothing to do.. I know C better than python, just wonder if in this 2 months, what you guys recommend i should get better at C or at python?

Note: those are the only two languages i know so im open to other recommendations.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10340
  • Country: nz
Re: Get better at C or at Python
« Reply #1 on: July 07, 2012, 07:12:02 am »
C is more useful for business/job
python is more fun :D

I say python, then you can put both on your CV as languages you know well.
And its your vacation, so fun programming is relaxing :)
« Last Edit: July 07, 2012, 07:36:43 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Get better at C or at Python
« Reply #2 on: July 07, 2012, 07:34:18 am »
Learn a third language.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline tnt

  • Regular Contributor
  • *
  • Posts: 241
Re: Get better at C or at Python
« Reply #3 on: July 07, 2012, 07:36:53 am »
Learn how to write python module in C if not already done.

This way you can have the higer level logic of your project in python but when you need fasts or low level stuff in C, you can still integrate them.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: us
Re: Get better at C or at Python
« Reply #4 on: July 07, 2012, 12:36:20 pm »
I agree with B@W.  Unless you have a specific reason to become an expert in a specific language you are better off learning about different languages and techniques.  Eventually you don't think of learning a new language as a task by itself, you just pick up whatever language is required.  There are plenty of languages to choose from, and it doesn't have to be something you ever expect to be useful: the key is to gain new perspectives that will help you in whatever programming language you actually have to use in the future.
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #5 on: July 07, 2012, 05:14:19 pm »
3rd language? Like???

I was thinking c++ or java but not sure if it's worth it
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: us
Re: Get better at C or at Python
« Reply #6 on: July 07, 2012, 05:47:05 pm »
C++ or Java are fine, but make sure you learn to program them idiomatically, don't just program in C with a bit of extra syntax.
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12476
  • Country: us
Re: Get better at C or at Python
« Reply #7 on: July 07, 2012, 05:57:32 pm »
I don't think you should try to "learn a programming language", but rather you should try to "learn how to program".

Many people can speak English, but few can write good literature (novels, short stories, magazine articles, blog articles, technical manuals, whatever).

Similarly, knowing one or more programming languages is scarcely the point. If you know one language, that's enough to get started. Now learn how to write good programs. Choose a project and work on it (like, maybe, learn how to create something like the Spice circuit simulator?).

Design your project so that it is nicely separated into functional parts. Make sure that each part and each unit has tests so you can verify their correct operation before you assemble them into larger pieces. Investigate programming methods like test driven development. Try to arrange your project so you can start out with bare bones functionality and add to it as you go without needing to redesign the whole thing to add a new feature. Learn about interfaces and abstraction and separation of concerns. Learn how to manage dependencies so you can swap out one component for another that uses the same interface.

Given the above thoughts, I suspect you will find Python a better tool to work with than C. It will let you focus more clearly on the functional requirements of your program and less on the laborious details.
 

Offline PedroDiogo

  • Regular Contributor
  • *
  • Posts: 62
  • Country: pt
  • EE Student
Re: Get better at C or at Python
« Reply #8 on: July 07, 2012, 07:55:54 pm »
I agree with Bored@Work, but I have a suggestion. You should probably learn something different like a Functional Programming language. Something like Haskell, Clojure or Scala can really boost your CV and can differentiate you from other applicants and most importantly will teach you a different way to program.

Or you could learn node.js which should be a bit easier.

 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #9 on: July 07, 2012, 08:19:28 pm »
I agree with Bored@Work, but I have a suggestion. You should probably learn something different like a Functional Programming language. Something like Haskell, Clojure or Scala can really boost your CV and can differentiate you from other applicants and most importantly will teach you a different way to program.

Or you could learn node.js which should be a bit easier.

CV??

I never heard of those languages... what are they used for?
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12476
  • Country: us
Re: Get better at C or at Python
« Reply #10 on: July 07, 2012, 08:23:51 pm »
CV??

CV = curriculum vitæ = "the story of my life" = résumé

CV is more common outside America.
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12476
  • Country: us
Re: Get better at C or at Python
« Reply #11 on: July 07, 2012, 08:29:59 pm »
Haskell, Clojure or Scala

I never heard of those languages... what are they used for?

They are specialist languages used by a very small number of people in particular domains, such as the financial and banking industries. Places where people can afford to go off the beaten track and do things differently. They are very intellectual languages that are quite hard to use unless you have a capable mind. They can be fun to play with and can be productive if you are able to master them, but they will bite back if you are not up to the challenge.
 

Offline _Sin

  • Regular Contributor
  • *
  • Posts: 247
  • Country: gb
Re: Get better at C or at Python
« Reply #12 on: July 07, 2012, 08:44:23 pm »
I agree with pretty much everything IanB said a few posts up. Learn to program, don't worry so much about languages. With the caveat that I don't think it matters whether you go with Python or C.

I'd caution about sticking stuff you've spent a couple of months playing with on a CV as if you're fluent in it. Nothing wrong with mentioning you've dabbled in something, but making out like you're an expert could go very wrong in an interview.

Plus I personally *hate* reading CVs which are just a lot of bullet-pointed lists of 'things'. Tells me nothing about the candidate other than that they've heard of a bunch of stuff.

As for functional languages - they have a reputation for being a bit 'academic', but they're becoming a bit more popular/relevant as things shift towards heavy parallelism. Functional languages lend themselves a bit more to that.
Programmer with a soldering iron - fear me.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3987
  • Country: us
Re: Get better at C or at Python
« Reply #13 on: July 07, 2012, 08:56:29 pm »
They can be fun to play with and can be productive if you are able to master them, but they will bite back if you are not up to the challenge.

That is why learning them is useful even if you never use them for anything productive.  If a programming language doesn't change the way you think about programming learning it is a waste of time.  That said, popular "business" languages like C#, C++, and Java also have plenty to teach you even if they aren't as exotic and fun as haskell or assembly.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Get better at C or at Python
« Reply #14 on: July 07, 2012, 08:58:31 pm »
uhm... go on vacation and have fun?

Go to the jungles of Brazil... you'll be able to 'C' the pythons. :)

 take it from someone who was like you, always working , studying, no fun.... enjoy your life while you're still young !

but if you still want to study, then increase your breadth of knowledge like Bored@Work and others have said. Learn a new language.

I suggest Haskell or Erlang.  I prefer Erlang myself, as it has built-in concurrency, but Haskell has recently got concurrency extensions too, so that point is moot now.  There are efforts underway to use these for programming embedded platforms too, and this is where I would like to see them making inroads. Forget C on the embedded devices, we should use a language that actually helps you write good, useable code.

Both of these languages are both used extensively in the real world, mostly in the financial sector and anywhere that benefits from thousands of real-time concurrently communicating processes (i.e. data networks, telecoms).   Having these on your resume will certainly help you stand out from the rest of the graduates.

 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #15 on: July 07, 2012, 10:01:56 pm »
as a broke ass student cant even afford to out sometimes... So instead of stay home crying ill try to get my gf pay if she is broke ill stay home studying or something
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: Get better at C or at Python
« Reply #16 on: July 07, 2012, 10:04:44 pm »
Go with C. Python is a fad that will be gone in a few years.
Good enough is the enemy of the best.
 

Offline Jad.z

  • Regular Contributor
  • *
  • Posts: 83
  • Country: 00
Re: Get better at C or at Python
« Reply #17 on: July 07, 2012, 10:18:23 pm »
Go with C. Python is a fad that will be gone in a few years.

Two words: Completely Disagree.
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #18 on: July 07, 2012, 10:21:31 pm »

Forget C on the embedded devices, we should use a language that actually helps you write good, useable code.


Most embedded devices use C, why would i forget it?
 

alm

  • Guest
Re: Get better at C or at Python
« Reply #19 on: July 07, 2012, 10:25:55 pm »
I agree that the focus should be on learning other paradigms, not just cramming the syntax of another language in your head. A completely different language like Haskell, ML or LISP will teach you much more than learning another procedural language. These ideas will make you a better programmer, regardless of the language.
 

Offline McMonster

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: pl
    • McMonster's blog
Re: Get better at C or at Python
« Reply #20 on: July 08, 2012, 12:21:39 am »
I'll just repeat what some people said. Learn programming, not programming language. You would be surprised how many different languages share the same common concepts. I don't think you really need a multiparadigm or some odd language to do that, but they help to understand this. Anyone really interested in how this works should try OCaml and stay away from frankenstein languages like Oz. I was programming in more strange languages than I can remember, I would completely fail if I were trying to actually learn each language.

And I also disagree, Python will not die in the forseeable future.
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #21 on: July 08, 2012, 01:07:58 am »
I'll just repeat what some people said. Learn programming, not programming language. You would be surprised how many different languages share the same common concepts. I don't think you really need a multiparadigm or some odd language to do that, but they help to understand this. Anyone really interested in how this works should try OCaml and stay away from frankenstein languages like Oz. I was programming in more strange languages than I can remember, I would completely fail if I were trying to actually learn each language.

And I also disagree, Python will not die in the forseeable future.

How does one learn programming? not learning the language?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10340
  • Country: nz
Re: Get better at C or at Python
« Reply #22 on: July 08, 2012, 04:43:00 am »
I'll just repeat what some people said. Learn programming, not programming language. You would be surprised how many different languages share the same common concepts. I don't think you really need a multiparadigm or some odd language to do that, but they help to understand this. Anyone really interested in how this works should try OCaml and stay away from frankenstein languages like Oz. I was programming in more strange languages than I can remember, I would completely fail if I were trying to actually learn each language.

How does one learn programming? not learning the language?

What he means is learn how to code correctly, which is language independent.
Learn how to write code that is modular, readable and easy to debug/upgrade in the future.

The language is really just the syntax of how to declare variables, write conditions, loops, function etc..
Give a good programmer a A3 sheet showing all the syntax for a new language and they can usual start coding in the new language right away. Obviously they are quite slow at first because they have to keep looking at the sheet to see how to express something in code, but they can write code just fine.

That's because coding is about breaking a problem down into logical steps, and the steps are the same in pretty much all languages, they just have different syntax.
There are of course a few exceptions, where commands used in one language don't exist in the other, but they are easy to get around by just coding the step in a different way.  Also the approach languages take to solving problems can be a little different but it usually doesn't take long to "get" a new language.
« Last Edit: July 08, 2012, 04:49:00 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1316
  • Country: us
Re: Get better at C or at Python
« Reply #23 on: July 08, 2012, 04:49:52 am »
Go with C. Python is a fad that will be gone in a few years.

Google has a big hardon for it, so it's doubtful.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: Get better at C or at Python
« Reply #24 on: July 08, 2012, 05:02:20 am »

Google has a big hardon for it, so it's doubtful.
Except google uses their own version of python , without giving back to the community and they crosscompile it ti 'C' to jank it through an ANSI c compiler that spits out machine language....

In my opinion Python is a big steaming turd of a language, Before you start flaming let me explain why :

I look at it from the perspective as writing embedded code on microcontroller , or things like test and measurement automation.

1) They broke it between 2.xx and 3.0 to the point you had to rewrite a bunch of code to keep going forward. This is unacceptable for any language ..
2) Any modern language that still needs to rely on ; to find the end of a line is not worth it. ; are a relic from the PDP-era. there is a <CR> char there placed by the editor. use that one.
if a line needs continuation then use a deliberate charactor to tell the compiler the line goes on. Not the other way around. lines are short anyway
3) what is this boneheaded idea of using TAB and indentation to define subroutines. One misplaced space or tab character and the code does not execute as you think it does. Email a chunk of code or send it through another editor and it becomes a mess.
4) no enumerated lists ( constants )
5) if something doesn't exist the runtime creates an empty object instead of throwing a fit. This makes debugging code very hard. One typo and you are screwed.

I really tried using python but i gave up after a few months. Too many problems. Like not having true constants. you need to kludge around with a lot of typing to make a class and then create hidden functions to return ... too much work too cumbersome.

Now, python does have its place and that is for any kind of web programming. But for usage as an ambedded programming language ? or general purpose language ? No . Thanks. Too awkward , too much trouble. And who knows what will be broken in Python 4.0 ....
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf