This forum is in permanent archive mode. Our new active community can be found here.

Weekend coding

1202123252639

Comments

  • I was gonna download it but it's still in alpha.
  • PyCharm isn't free.
  • Andrew said:

    I'm really hoping atom becomes a modern successor to vim/emacs. Lightweight but just powerful enough to do all the annoying bits for me.

    Atom is anything but lightweight. It's sluggish as all hell in the little bit I tried and if you look at the implementation, each line of code is rendered as something like a half dozen lines of HTML and CSS behind the scenes in order to display properly.

    The closest thing to a modern vim/emacs successor out there is probably Sublime Text. There is also an attempt at an open source Sublime clone called LimeText, but that's still in its early stages.
  • I imported a 4,000 line python file into PyCharm and it coughed at a single case of indenting. Otherwise clicking run in the IDE worked just as well as running the script from the terminal. Only I didn't have to switch programs or windows to do it.

    Up until now I've been using two text editors, MacVim for some stuff because it has highlighting for Python, and another Mac program TacoHTML Edit, because it has good features for web stuff, and is as good as any other text editor (but with only highlighting for HTML and web stuff).

    I tried Eclipse with Python stuff added, and clicking run didn't work in ways I didn't get interested enough in to solve. I tried IDLE and, as Scott said, it hung up on something with the code that it insisted was wrong but for the life of me I couldn't understand what. It said Bad Syntax but not what was wrong, and the same code has never not worked from Terminal.

    PyCharm worked exactly as I expected, so I'm going to work in the world if code completion and other goodness for a while to see what I can learn/improve on.
  • Apreche said:

    PyCharm isn't free.

    They have a lite edition that's free as in beer. Full version costs the moneys.

    Scott, what do you use to debug stuff? pdb is great and all, but having a nice interface sure helps.
  • I have no problem paying for good software. Logic Pro, Final Cut Pro X, Pixelmator, text expander, loads and loads of others for jobs both big and small. There are a very few free applications I use regularly, and I have nothing against them, but paying for tools is what I do.
  • Starfox said:

    Apreche said:

    PyCharm isn't free.

    They have a lite edition that's free as in beer. Full version costs the moneys.

    Scott, what do you use to debug stuff? pdb is great and all, but having a nice interface sure helps.
    I don't need a nice interface. I use pdb, print statements. There is almost never something so hard to debug that I need advanced tooling.
  • What is Swift and why should I care?
  • Apreche said:

    Starfox said:

    Apreche said:

    PyCharm isn't free.

    They have a lite edition that's free as in beer. Full version costs the moneys.

    Scott, what do you use to debug stuff? pdb is great and all, but having a nice interface sure helps.
    I don't need a nice interface. I use pdb, print statements. There is almost never something so hard to debug that I need advanced tooling.
    I used to do the same thing. I would add a series of print statements in any section of code that was giving me trouble and have it all dumped into a text file. Took some extra time but was well worth it.
  • edited July 2014
    Apreche said:

    I don't need a nice interface. I use pdb, print statements. There is almost never something so hard to debug that I need advanced tooling.

    I'll have to look into pdb next time I need to debug Python stuff. Right now I use a mix of print statements and logging. For C/C++ stuff, it's gdb and logging as well. Okay, well, not always straight gdb. I usually try to use cgdb just because it has a nice split screen UI (based on vim's UI!) that shows the code in the top pane while providing the standard gdb command line in the bottom pane. It's easier than having to flip back and forth between my debugger and editor windows.
    HMTKSteve said:

    What is Swift and why should I care?

    Swift is Apple's new language for developing iOS and MacOS X applications. If you're developing for either of those platforms, you definitely should care about it as it's where their foreseeable future lies.

    If you're a programming language geek, you should care if only because they've done some neat things with it, such as full Unicode source support (so you can write your entire program except for standard library calls using Japanese characters, the Greek alphabet, heck, even emoji or Klingon [I think Klingon is in the Unicode character set now] if you want), automatic reference counting as the standard memory management model, interoperability with Objective C without the mishmash of C and Smalltalk syntax, neat features from functional languages like closures, a REPL for a compiled language (the only one I know of, at least so far), compiles to native code for maximum performance, etc. If nothing else, it's worth comparing it to some of the other next-generation compiles-to-native systems languages such as Go, Rust, etc., as many of them do the same things just crooked slightly so.
    Post edited by Dragonmaster Lou on
  • Apreche said:

    MATATAT said:

    code completion plugins can be awesome but they are usually pretty jenk.

    Yes.

    Whenever I see a coding tool, such as code completion, I ask these questions. Is feature X (code completion) something that helps an amazing programmer code even more efficiently than would otherwise be possible without it, or is it something that is useless to a great programmer, but helps crappy programmer get by?
    I had no idea these existed till halfway into last semester and virtually all the other students knew about this in the starter IDE (I was writing in Notepad++).

    It resulted in some of the laughably stupid and incorrect conclusions to problems or tasks because they wouldn't read the documentation.

    Unfortunately the crappy programmers are easy to spot out early on.
    Apreche said:


    I don't need a nice interface. I use pdb, print statements. There is almost never something so hard to debug that I need advanced tooling.

    I was docked 5% on my first Java project because I didn't demonstrate use of the built in debugger to solve a problem yet still debugged it using print statements

    I found this really stupid as my solution was just as fast.
  • sK0pe said:


    I was docked 5% on my first Java project because I didn't demonstrate use of the built in debugger to solve a problem yet still debugged it using print statements

    I found this really stupid as my solution was just as fast.

    Er, what? They're grading you based on the debugging technique you used? Sheesh, that doesn't sound legit to me... All that mattered in my CS classes were that you debugged the program sufficiently well enough to finish the assignment. The exact technique you used (debugger, print statements, sacrificing a goat to the ghost of Charles Babbage) didn't matter so much as it didn't needlessly clog up your output when you submitted your final program.
  • sK0pe said:


    I was docked 5% on my first Java project because I didn't demonstrate use of the built in debugger to solve a problem yet still debugged it using print statements

    I found this really stupid as my solution was just as fast.

    Er, what? They're grading you based on the debugging technique you used? Sheesh, that doesn't sound legit to me... All that mattered in my CS classes were that you debugged the program sufficiently well enough to finish the assignment. The exact technique you used (debugger, print statements, sacrificing a goat to the ghost of Charles Babbage) didn't matter so much as it didn't needlessly clog up your output when you submitted your final program.
    That's what I assumed, apparently on complaint and talking to other members of faculty, that professor is odd in that way. I got 95% for the assignment but it was more the principal.

    However I know having been to University and working in the real world, there is a large disconnect between what matters in real life versus a solely academic environment.
  • As much as being able to use a debugger is beneficial in the "real world," sometimes you gotta use every last technique you got to figure something out. It's even better with multithreaded code as often using a debugger can affect the timing of your program just enough so that the bug doesn't appear when running under a debugger. Print/log statements, while they also can throw off the timing of the program, generally don't throw it off quite as much and give you a better (though still not perfect) shot of catching your bug.

    Every real world program I've worked on used a combination of print/log statements with or without a debugger in order to diagnose bugs.
  • Can someone point me towards an optimal site or online text for learning C?

    I want to get a jump start on this language as the basics I've looked up seem very powerful / efficient compared to Java and Python plus I have a fairly easy semester and no new language to learn this semester.
  • Kerninghan and Ritchie's The C Programming Language. It's basically the original C textbook, and it's still more or less the best.
  • Kerninghan and Ritchie's The C Programming Language. It's basically the original C textbook, and it's still more or less the best.

    It's just a tad outdated due to changes introduced with C99 and later, but it still covers at least 90% of the language as it currently stands, so it's still the best starting point.

    I'd suggest starting with that one and then just looking up C99 and such online to see what other changes were added to the language since that book was published.
  • sK0pe said:

    I want to get a jump start on this language as the basics I've looked up seem very powerful / efficient compared to Java and Python plus I have a fairly easy semester and no new language to learn this semester.

    I'm not really sure what exactly you mean by "very powerful / efficient", but it's true that C is most definitely worth learning.
  • You probably already know everything that c has. Slight syntactical stuff and some std function calls are all you need. It's not that difficult of a language. C++ gets kinda confusing but that's because of their crazy class reference structure.
  • MATATAT said:

    You probably already know everything that c has. Slight syntactical stuff and some std function calls are all you need. It's not that difficult of a language. C++ gets kinda confusing but that's because of their crazy class reference structure.

    One think he doesn't know when it comes to C is memory management. All the languages he mentioned previously do it automatically. Oh, and let's not get into some of the memory related security implications of buffer overruns, use after frees, format strings (okay, technically not a memory issue, but still a big one), etc. :P
  • People always talk about memory how in C you have to handle memory management by hand. It's true, but only to some extent.

    It's possible to write many many programs using only variables that live on the stack. If all you ever do is create boring variables that don't outlive the scope of their parent function, you will never have to even know that malloc exists. If you stick to programs like this C is just about as easy as languages like Python and such.

    Even as you branch out into some variables that change size, like strings, it is possible to avoid memory management. There are enough tools in strings.h you might be able to still avoid malloc.

    And if you program C++, or bother other people's code, you can borrow someone else's data structure implementations to use Lists/Queues still without ever having to write the words malloc or free on your own.

    Obviously any reasonably complex program will require you to allocate some memory on the heap at some point, but you would be surprised how far you can go without ever having to do it.

    Also, The C Programming Language, 2nd Edition is only the second best book on programming C. The best, IMHO, is Pointers on C. The only reason I know about this book is because it was written by an RIT professor. He retired in my last, or second to last, year of school. I was never in his class, but I did have his wife's Operating Systems class. I got it from the RIT bookstore. I'm glad I did, because it's rather difficult to get a copy nowadays. Despite programming C since middle school, I didn't truly grok pointers until reading this book.

    Bonus: this book is also quite useful. If your brain thinks in an object oriented way, this can teach you to write in C in a way that matches how you think.

    21st Century C: C Tips from the New School
  • Yeah that's true. I sorta consider those somewhat of a concept and not really a language feature. You don't need to understand that stuff to write a program. But they should be known.

    There is some stuff that you can get away with in C that you can't do in C# (and probably Java/Python too). This sorta stuff threw me for a loop when I was first learning to program/learn c.
  • Apreche said:

    People always talk about memory how in C you have to handle memory management by hand. It's true, but only to some extent.

    It's possible to write many many programs using only variables that live on the stack. If all you ever do is create boring variables that don't outlive the scope of their parent function, you will never have to even know that malloc exists. If you stick to programs like this C is just about as easy as languages like Python and such.

    Even as you branch out into some variables that change size, like strings, it is possible to avoid memory management. There are enough tools in strings.h you might be able to still avoid malloc.

    And if you program C++, or bother other people's code, you can borrow someone else's data structure implementations to use Lists/Queues still without ever having to write the words malloc or free on your own.

    Obviously any reasonably complex program will require you to allocate some memory on the heap at some point, but you would be surprised how far you can go without ever having to do it.

    If you count alloca and are an insane person, very very far indeed.

    In any case, the main point to make here is that even if you don't need to deal with memory allocation yourself, it's still quite crucial to know and understand what's going on.
  • If you count alloca

    I didn't know about alloca. Wow, what a mostly terrible idea!

    In any case, the main point to make here is that even if you don't need to deal with memory allocation yourself, it's still quite crucial to know and understand what's going on.

    Choosing the right tool depends on what you're doing. Everything has tradeoffs.
  • Apreche said:


    The best, IMHO, is Pointers on C. The only reason I know about this book is because it was written by an RIT professor. He retired in my last, or second to last, year of school. I was never in his class, but I did have his wife's Operating Systems class. I got it from the RIT bookstore. I'm glad I did, because it's rather difficult to get a copy nowadays. Despite programming C since middle school, I didn't truly grok pointers until reading this book.

    This book is already one of the recommended texts I'll probably pick it up.

    I find object orientation not difficult nor easy. If find it becomes tedious when you need to write a quick little program though.

    sK0pe said:

    I want to get a jump start on this language as the basics I've looked up seem very powerful / efficient compared to Java and Python plus I have a fairly easy semester and no new language to learn this semester.

    I'm not really sure what exactly you mean by "very powerful / efficient", but it's true that C is most definitely worth learning.
    I've just been heavily informed by senior students that it is the best language in the entire universe, at the same time they are unable to write in anything else. They also impressed upon me that it allows for greater efficiency however I can't decide that with out testing programs.

    I assumed it was powerful because OS are written in C.

    I messed around with malloc and found the manual memory allocation really interesting.

    I read a few programs written in C from a "hello world" program to browsing through a few algorithms and it seems quite readable but it could just be written well.

    I'll check all these out, thanks for the suggestions.
  • edited August 2014
    sK0pe said:

    sK0pe said:

    I want to get a jump start on this language as the basics I've looked up seem very powerful / efficient compared to Java and Python plus I have a fairly easy semester and no new language to learn this semester.

    I'm not really sure what exactly you mean by "very powerful / efficient", but it's true that C is most definitely worth learning.
    I've just been heavily informed by senior students that it is the best language in the entire universe, at the same time they are unable to write in anything else.
    For any language X, you can find someone who will tell you X is the best language in the entire universe. If X happens to also be the only language they know, well...
    sK0pe said:

    They also impressed upon me that it allows for greater efficiency however I can't decide that with out testing programs.

    Well, that's true. C is about as fast as you can get short of being an assembly wizard, although other languages will beat it under certain circumstances. However, quite a lot of the time you don't really need the extra speed you get from C compared to higher-level languages.
    sK0pe said:

    I assumed it was powerful because OS are written in C.

    Again, I'm still not really sure what you mean by "powerful". The reason OSes are written in C is that the language gives you direct access to hardware stuff that is abstracted away by many other languages, and that direct access is essential for an OS.

    Of course, you also have that kind of access with assembly language, but unlike assembly C is not limited to a specific processor architecture, and it's also easier to write.
    Post edited by lackofcheese on
  • edited August 2014
    It's not so much powerful as it is necessary unless you want to write some assembly instruction shit.

    EDIT: yeah what cheese said :P
    Post edited by MATATAT on
  • I get 100 times better advise on this forum than a tertiary place of education.
    Time to look for a new University.
  • sK0pe said:

    I get 100 times better advise on this forum than a tertiary place of education.
    Time to look for a new University.

    Oh please tel your uni that when you leave I want to hear about the reaction to that statement.
  • You learn more about actual development in the real world (I learned basically everything during my internship) but school (should) give you the tools you need to think through those problems and consider the choices you make.

    Sure people learn programming by themselves but more often than not those people are fucking terrible programmers when it comes to real world commercial development.
Sign In or Register to comment.