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

0 Members and 1 Guest are viewing this topic.

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Get better at C or at Python
« Reply #25 on: July 08, 2012, 05:27:23 am »
If you really want to vomit look under the hood of Python. The way the Python libs are implemented in Python makes you throwing up. Python has the strange tendency to attract  incompetent programmers. Not only for applications (when was the last time you saw a large Python application not writing a bunch of error messages to the console when started? Right, looking at console messages is for old people ...). But the language implementers don't seem to be the sharpest knives in the drawer.

Will Python go away? I fear not. To many idiots out there clinging to it as it is the second coming. And to many code is written in it right now that needs to be maintained for a long time.
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
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9950
  • Country: nz
Re: Get better at C or at Python
« Reply #26 on: July 08, 2012, 06:31:39 am »
3) what is this boneheaded idea of using TAB and indentation to define subroutines.

aww, that's one of its awesome features.
I really like it, it just feels like the way everything should work.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #27 on: July 08, 2012, 08:30:22 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 ....

What do you use as general purpose language?
 

Offline paf

  • Regular Contributor
  • *
  • Posts: 91
Re: Get better at C or at Python
« Reply #28 on: July 08, 2012, 08:52:41 am »
The standard line is: "If a programming language doesn't affect the way you think, then it is not worth learning."

Some "weird" suggestions:

1) Erlang - someone  already mentioned it. You compile for one processor, but after if you have 16 processors, your program takes advantage of it.
      http://learnyousomeerlang.com/

2) TCL
     It is a very old scripting language, but Tk ( used in Perl and in Python ) for graphics is the original graphics toolkit of Tcl.
     It is cross platform, and all the big name Electronic CAD/CAE software packages  use it as a scripting language.
     
     Will you use FPGAs? The software from Xilinx, Altera, Aldec, Lattice can be automated using TCL.

     Will you work with software from Cadence, Synopsys, Synplicity, Mentor Graphics, Magma ?
     Some of them have been bought by others, and may be badly spelled, but all use TCL...       
     
    http://www.tcl.tk/

   3) Forth
       A strange very small language, made by old grumpy guys, in the 70s.
     
       It is completely different from everything you know, but it can run on very small targets (for instance on an Arduino).

       At least read this book (one of the best programming books for any language):
       http://thinking-forth.sourceforge.net/
 
       You have also online the book Starting Forth :
        http://www.forth.com/starting-forth/

       And Amforth ( forth for Arduino or other AVR boards) can be found at:
      http://amforth.sourceforge.net/

  My best regards
  paf 
 



     
   

   

 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Get better at C or at Python
« Reply #29 on: July 08, 2012, 10:14:08 am »
Quote
In my opinion Python is a big steaming turd of a language
Fairly accurate view of Python.
Agree with all your points too except maybe 1.

I did one embedded project on Python, and it actually did work, but there was a large amount of wasted time due to typos and miss aligned loops discovered at run time.
What annoyed me the most was dealing with a weakly typed piece of crap and thinking about that web page http://www.python.org/dev/peps/pep-0020/ and the hype that goes along with this language.
It's like a fashionable version of vbscript, albeit with more useful libraries.




 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3719
  • Country: us
Re: Get better at C or at Python
« Reply #30 on: July 08, 2012, 11:29:17 am »
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.
Uh, python doesn't require ; to end lines.  Not sure where you got that idea.  The only thing similar is the ':' that signifies the opening of a block.

Quote from: Psi
aww, that's one of its awesome features.
I really like it, it just feels like the way everything should work.

The indent based blocking works OK if you are working in a decent editor, but it causes all sorts of problems in more chaotic environments.  Cut-and-pasting code from web sites, emails, or code inlined in other documents often leads to trouble when those other forms of communication don't respect Python's obsession with whitespace.

I understand the motivation for requiring the whitespace to match the indentation -- it does prevent some class of error.  The real solution is quite simple.  Add an end keyword to designate closing a block, but have the parser reject any code where the whitespace doesn't match the syntax.  That way, if the whitespace is corrupted or you mistake a dangling else, you force the programmer to fix the mess.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Get better at C or at Python
« Reply #31 on: July 08, 2012, 03:13:55 pm »

What do you use as general purpose language?
It depends..

Note that what i a, saying here may not apply to everyone. I have different goals.
Microcontrollers (arm/8051/pic/avr)

Either C or assembly PL/M which is optimized and profiled the snot out of it for real work.
Or Swordfish basic on Pic, Bascom on , mikroe basic on pic,avr,arm for quick and dirty minimal effort.

If i'm on pc ?
 I don't do full blown applications. Programs for me are something that drive test instruments, collect data and plunk output in excel. They are there to save me time, make life easy make me lazy.
Either vba in excel. So all i need to do is open spreadsheet and launch the macro i wrote.
Or, for larger setups. Vb express. It's free , any 6 year old can program in it, any non-programmer who can read english can understand it and it has an excellent ide.  The autocomplete and intellisense is superb.

There is nothing more frustrating than a programming langue with an editor that comes to tell you : you forgot a closing quote here .. Well , since you know exactly where i forgot it .. WHY DONT YOU PUT IT THERE . STUPID PIECE OF COMPILER ! I hate that. Vb saves me from that. Forget to close a string ? It gets closed. Forget a ) in an equation , it tells you or closes it for you.  I am a bad and sloppy typist. Never learned typing properly. I got my nose on a board with 50 cables , 10 instruments and a piece of silicon that doesn't behave... I am trying to coax some data out of it. The last thing i need is a smug smartass programming language that tells me i forgot a semicolon . I don't want semicolons, i don't need em . Use the cr character that was placed there when i hit enter at the end of the line. And if the compiler keeps whining about its colon it will be given an enema. Forcefully , by overwriting all the sectors it was installed on. Flush !

Plus vb has an interactive environment. I can put the program in break ,minvoke any function or routine from the immediate window , examine or change the content of variables or objects. And in debug i can add lines of code, remove lines of code, change the excution pointer without having to stop and recompile. This is extremely practical. Lets say you have a sequence that sets up the chip and takes 10 minutes to run. And then something happens. I. Break and can interactively test things out. With a traditional compiler this doesn't work.. Its stop, alter code, rerun... And wait another 10 minutes to hit that point of investigation.. Some are better because you can examine data with watchpoints and you can singlestep. But none let's you add code , and try things on the fly. You always need a recompile/restart . Which costs you another 10 minutes....
That is why i tried python for a while .. But it kept interfering with its tab obession and other annoyances... So i threw it back out.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Get better at C or at Python
« Reply #32 on: July 08, 2012, 11:30:24 pm »
Quote
Quote
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.
Uh, python doesn't require ; to end lines.  Not sure where you got that idea.  The only thing similar is the ':' that signifies the opening of a block.

I missread that, I love my semicolons for end statement.
Python and VB.net should get some.
Much better for cutting and pasting from the web, much better for long lines of long named parameters, better for long string formatting, including SQL queries.
And cutting and pasting from the web is fine, it's called reusable code.

Code Complete is a good book on high level programming http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670

I think Visual Studio is a great tool and a great place to start. There is hardly any difference between C# and VB.net.
Python is actually ok on low resouce processors, but finding typos at runtime is very frustrating.
Avoid ObjectiveC and Xcode if possible, what a crock of shit.

If you want a challenge try http://en.wikipedia.org/wiki/Brainfuck

 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Get better at C or at Python
« Reply #33 on: July 08, 2012, 11:31:54 pm »
Ook ? Ook !
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Get better at C or at Python
« Reply #34 on: July 08, 2012, 11:44:12 pm »
I really do like python for whipping something up really quick. I've been writing shell scripts and later bash scripts since the early 80's.  I'm one of the few awk and sed experts left on the planet  ;D

Today, I've moved away from shell scripting for most things more complicated then a few lines of script, as I can usually do what I want to do faster and better in python.

But Guido truly blew it when he made white space significant. That's just wrong.

 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Get better at C or at Python
« Reply #35 on: July 08, 2012, 11:52:09 pm »
Ook! Ook.

Have a bananna,
That's awesome, especially when you read it out loud.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Get better at C or at Python
« Reply #36 on: July 09, 2012, 01:17:33 am »
Ha! I'd heard of Brainfuck before, never heard about Ook!  until today.
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #37 on: July 09, 2012, 01:41:33 am »
Ha! I'd heard of Brainfuck before, never heard about Ook!  until today.

picture hangers =)
http://www.ooks.com/
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Get better at C or at Python
« Reply #38 on: July 09, 2012, 01:41:55 am »
Ook! runs perfectly on Hex. But beware , you may need the assistance of the Librarian to check over you code unless you want to get messages like this :

+++Error At Address: 14, Treacle Mine Road, Ankh-Morpork+++
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++

Hex. Anthill inside (tm)
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline PeteInTexas

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: us
Re: Get better at C or at Python
« Reply #39 on: July 09, 2012, 03:43:19 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.

Assembly.  Higher level languages are intended for you to forget about the machine being programmed.  Which is a shame and a waste for a Comp Eng student, IMHO.
 

Offline krenzo

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Re: Get better at C or at Python
« Reply #40 on: July 09, 2012, 04:10:51 am »
Assembly.  Higher level languages are intended for you to forget about the machine being programmed.  Which is a shame and a waste for a Comp Eng student, IMHO.

I second this.  If you don't know assembly, then you don't really know what is going on under the hood, and that's something you need to know, especially if you ever have to do any multithreading.  I also suggest learning VHDL or verilog for programming FPGAs.
 

Offline dfnr2

  • Regular Contributor
  • *
  • Posts: 240
  • Country: us
Re: Get better at C or at Python
« Reply #41 on: July 09, 2012, 04:14:24 am »
Your question is not really answerable as stated.  You probably won't just "learn" a language.  Learning "another language" is meaningless, unless you are picking up a whole new way of thinking as part of the process.  Otherwise, you're just learning syntax.

If you really want to learn something, pick a challenging project.  Something with a challenging software architecture.  Something you care about, and are willing to beat your brains out to complete.  Perhaps find an internship or a lab at your university working on something interesting, and take on a project.  The point will be not to do something someone you are supposed to do, but to bring your own idea in, or find one that mesmerizes you.

And then, instead of focusing on using whatever language in the most rudimentary way needed to brute-force your problem into submission, find the language best matched to the problem.  I would guess that between C and Python, you may cover 90% of the stuff out there.   Whatever language you pick, try to figure out what secret powers that language confers on you in order to make this particular code understandable, concise, and efficient.

Say--for the sake of exposition-- that you plan to work on a project for which C is a good mapping.  If you know any C, you probably know all of C.  It's a pretty simple language.  However, that is a far cry from mastering C.  That involves the trick of writing clear, easy to understand code that is robust to memory leaks, bad function parameters, unexpected conditions, and random perturbations, and produces clean assembly.  It involves knowing when you can use what optimizations and when you can't, or knowing how to figure it out on the fly.  And, for embedded systems, it requires knowing the assembly for the target processor, and how the C maps to the call structure, stack structure, registers, and peripherals.  By the way, I don't think any assembler would count as a language--It's a code, and you will need to know it for any embedded processor you compile to.

You could start by looking at a good coding standard.  MISRA C 2004 (or C++ 2008) is with the $20 or so for the PDF.  Look it over.  It's not gospel--there's plenty in there that's debatable, but the reasoning is all spelled out, and much of it is interesting food for thought.  Copy it and write your own coding standard, and then modify it as your career progresses.  Write one for every language you use more than casually. 

A coding standard, BTW is not a style standard.  For C, you want to have one of those as well.  Browse the net and see what you like, and write up your own.  Refine it for the rest of your career.  Do that for any language you use more than casually.

Learn what it feels like to code to a standard.  It will change the way you look at your own code, and anyone else's code. 

If you don't already do so, pick a version control system (like GIT) and get used to using it for all but throwaway code.  Get used to what it feels like to work with a version control system inside your development environment (IDE, Emacs, etc.) and outside (command line).  Then learn what it feels like when you don't have it set up.

Since you're asking this question in the first place, I'm guessing you'll be around computers a lot in the future, and will need a decent tool language to accomplish tasks from routine scripting crud to durable utilities.  Although this forum is skewed towards embedded, the whole software world is not embedded or web programming (only the vast majority of it is.)  Pick a general purpose tool, and start using it for all your utility tasks, scripting, etc.  You will eventually get pretty good at using it.  If you pick one tool and learn it well, you will be able to do almost anything with it quickly.

As far as general purpose utility languages go, Python is about as good as any, despite some knocking it has received in this thread.  It's a good, powerful, rich language, neat, easy to read, concise, with a wealth of utilities.  It has a great facilities for numerical / scientific coding and more.  If you use Python, learn how to set up your editor and environment to handle the indentation, etc. for you, let you move easily between your file under development and interactive environment, etc.



 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #42 on: July 09, 2012, 04:23:09 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.

Assembly.  Higher level languages are intended for you to forget about the machine being programmed.  Which is a shame and a waste for a Comp Eng student, IMHO.

I looked into assembly i actually tried it few days ago(68k), was able to add few numbers, do some loops and some compares.. But thats about it... Tough it wasnt really worth learning.. Is assembly even used any more? if it is where?

btw: that Code Complete 2 book looks interesting
« Last Edit: July 09, 2012, 04:40:14 am by SuperMiguel »
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Re: Get better at C or at Python
« Reply #43 on: July 09, 2012, 04:43:18 am »
Your question is not really answerable as stated.  You probably won't just "learn" a language.  Learning "another language" is meaningless, unless you are picking up a whole new way of thinking as part of the process.  Otherwise, you're just learning syntax.

If you really want to learn something, pick a challenging project.  Something with a challenging software architecture.  Something you care about, and are willing to beat your brains out to complete.  Perhaps find an internship or a lab at your university working on something interesting, and take on a project.  The point will be not to do something someone you are supposed to do, but to bring your own idea in, or find one that mesmerizes you.

And then, instead of focusing on using whatever language in the most rudimentary way needed to brute-force your problem into submission, find the language best matched to the problem.  I would guess that between C and Python, you may cover 90% of the stuff out there.   Whatever language you pick, try to figure out what secret powers that language confers on you in order to make this particular code understandable, concise, and efficient.

Say--for the sake of exposition-- that you plan to work on a project for which C is a good mapping.  If you know any C, you probably know all of C.  It's a pretty simple language.  However, that is a far cry from mastering C.  That involves the trick of writing clear, easy to understand code that is robust to memory leaks, bad function parameters, unexpected conditions, and random perturbations, and produces clean assembly.  It involves knowing when you can use what optimizations and when you can't, or knowing how to figure it out on the fly.  And, for embedded systems, it requires knowing the assembly for the target processor, and how the C maps to the call structure, stack structure, registers, and peripherals.  By the way, I don't think any assembler would count as a language--It's a code, and you will need to know it for any embedded processor you compile to.

You could start by looking at a good coding standard.  MISRA C 2004 (or C++ 2008) is with the $20 or so for the PDF.  Look it over.  It's not gospel--there's plenty in there that's debatable, but the reasoning is all spelled out, and much of it is interesting food for thought.  Copy it and write your own coding standard, and then modify it as your career progresses.  Write one for every language you use more than casually. 

A coding standard, BTW is not a style standard.  For C, you want to have one of those as well.  Browse the net and see what you like, and write up your own.  Refine it for the rest of your career.  Do that for any language you use more than casually.

Learn what it feels like to code to a standard.  It will change the way you look at your own code, and anyone else's code. 

If you don't already do so, pick a version control system (like GIT) and get used to using it for all but throwaway code.  Get used to what it feels like to work with a version control system inside your development environment (IDE, Emacs, etc.) and outside (command line).  Then learn what it feels like when you don't have it set up.

Since you're asking this question in the first place, I'm guessing you'll be around computers a lot in the future, and will need a decent tool language to accomplish tasks from routine scripting crud to durable utilities.  Although this forum is skewed towards embedded, the whole software world is not embedded or web programming (only the vast majority of it is.)  Pick a general purpose tool, and start using it for all your utility tasks, scripting, etc.  You will eventually get pretty good at using it.  If you pick one tool and learn it well, you will be able to do almost anything with it quickly.

As far as general purpose utility languages go, Python is about as good as any, despite some knocking it has received in this thread.  It's a good, powerful, rich language, neat, easy to read, concise, with a wealth of utilities.  It has a great facilities for numerical / scientific coding and more.  If you use Python, learn how to set up your editor and environment to handle the indentation, etc. for you, let you move easily between your file under development and interactive environment, etc.

Thanks, i know what you guys are saying by learn how to program not the syntax.. I agree 100%, C is very small, i know most of it, but most of the time when i look at some one else code i have no idea whats going on, Im at the point in C, where i can make simple games using what i think could be the most complicated things in C (like pointers, structs, anda linked list), but i dont know how to keep going forward, seems like im stuck making simple blackjack/tic tac toe games, and im not sure how to go forward (and start thinking/building something more advance), so i some times think that by learning/going to another language that will make me a better programmer... (thats probably the reason i opened this thread)
« Last Edit: July 09, 2012, 04:50:00 am by SuperMiguel »
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Get better at C or at Python
« Reply #44 on: July 09, 2012, 05:00:09 am »

I looked into assembly i actually tried it few days ago(68k), was able to add few numbers, do some loops and some compares.. But thats about it... Tough it wasnt really worth learning.. Is assembly even used any more? if it is where?

Guess where all the compiler code-generations come from?

And if you need cycle-exact control over some piece of code. Which you typical need when someting needs to be exact or fast, near the limit what the CPU can do.

Or if you work with a CPU where there is just not any kind of compiler availiable. Maybe because the CPU is so exotic no one wrote a compiler, or so small no one can write a compiler.

Or you need to do something the compiler can't do. Like switching the stack to switch between tasks. Or like writing special CPU registers or IO ports, in case your compiler has no extension for accessing them.
« Last Edit: July 09, 2012, 05:03:24 am by Bored@Work »
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 dfnr2

  • Regular Contributor
  • *
  • Posts: 240
  • Country: us
Re: Get better at C or at Python
« Reply #45 on: July 09, 2012, 05:07:28 am »

I looked into assembly i actually tried it few days ago(68k), was able to add few numbers, do some loops and some compares.. But thats about it... Tough it wasnt really worth learning.. Is assembly even used any more? if it is where?

Or if you work with a CPU where there is just not any kind of compiler availiable. Maybe because the CPU is so exotic no one wrote a compiler, or so small no one can write a compiler.


Or if you *are* using a compiler for an embedded system.  But wait until you are, then pull out the manual for that chip.  And, "Assembly" is not a language. 
« Last Edit: July 09, 2012, 05:53:01 am by dfnr2 »
 

Offline dfnr2

  • Regular Contributor
  • *
  • Posts: 240
  • Country: us
Re: Get better at C or at Python
« Reply #46 on: July 09, 2012, 05:12:03 am »
Thanks, i know what you guys are saying by learn how to program not the syntax.. I agree 100%, C is very small, i know most of it, but most of the time when i look at some one else code i have no idea whats going on, Im at the point in C, where i can make simple games using what i think could be the most complicated things in C (like pointers, structs, anda linked list), but i dont know how to keep going forward, seems like im stuck making simple blackjack/tic tac toe games, and im not sure how to go forward (and start thinking/building something more advance), so i some times think that by learning/going to another language that will make me a better programmer... (thats probably the reason i opened this thread)

The point is, you shouldn't be asking yourself how to get beyond tic-tac-toe in C.  You should find something you want to do, then figure out what it will take.  If you are stumped, then do some research and how others have approached the problem.  Then, as you go, load your personal toolkit with more and more techniques.

If you can't find anything you actually want to make the computer do, then why are you bothering with any of this in first place?

One other option, in addition to my earlier suggestions--Pick an open source project you think is cool.  It could be a dead one, or an active one.  Pick a minor improvement you would like to do--something that can't be accomplished without understanding how the code works.  Then study the code to figure out how the relevant portion works.  If you see something that stumps you, try to model it in a simple test routine, then try playing with it.  If it's not clear, then try to figure out if it could be written more clearly.  Ask a more experience programmer.  A lot of the code you will see out there is pretty crappy, but you can still learn from it.

« Last Edit: July 09, 2012, 06:01:07 am by dfnr2 »
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Get better at C or at Python
« Reply #47 on: July 09, 2012, 06:38:31 pm »
Thanks, i know what you guys are saying by learn how to program not the syntax.. I agree 100%, C is very small, i know most of it, but most of the time when i look at some one else code i have no idea whats going on, Im at the point in C, where i can make simple games using what i think could be the most complicated things in C (like pointers, structs, anda linked list), but i dont know how to keep going forward, seems like im stuck making simple blackjack/tic tac toe games, and im not sure how to go forward (and start thinking/building something more advance), so i some times think that by learning/going to another language that will make me a better programmer... (thats probably the reason i opened this thread)

The point is, you shouldn't be asking yourself how to get beyond tic-tac-toe in C.  You should find something you want to do, then figure out what it will take.  If you are stumped, then do some research and how others have approached the problem.  Then, as you go, load your personal toolkit with more and more techniques.

If you can't find anything you actually want to make the computer do, then why are you bothering with any of this in first place?

One other option, in addition to my earlier suggestions--Pick an open source project you think is cool.  It could be a dead one, or an active one.  Pick a minor improvement you would like to do--something that can't be accomplished without understanding how the code works.  Then study the code to figure out how the relevant portion works.  If you see something that stumps you, try to model it in a simple test routine, then try playing with it.  If it's not clear, then try to figure out if it could be written more clearly.  Ask a more experience programmer.  A lot of the code you will see out there is pretty crappy, but you can still learn from it.

Will try, just not sure how to even start, I mean I can go to surgeforce or github and look for c open source projects but not sure if that's the right move
« Last Edit: July 09, 2012, 07:17:09 pm by SuperMiguel »
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: my
  • reassessing directives...
Re: Get better at C or at Python
« Reply #48 on: July 10, 2012, 01:20:02 am »
sigh! ok! buy a book on data structure. linked list, trees, table, arrays etc. read it during holiday at your hotel facing the beach. then you'll know why one language is dumber than the other. and why c is the god among the languages.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline SuperMiguelTopic starter

  • Regular Contributor
  • *
  • Posts: 205
Get better at C or at Python
« Reply #49 on: July 10, 2012, 01:37:49 am »
sigh! ok! buy a book on data structure. linked list, trees, table, arrays etc. read it during holiday at your hotel facing the beach. then you'll know why one language is dumber than the other. and why c is the god among the languages.
Can you recommend one?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf