programmer-problems

Month

March 2012

53 posts

Mar 30, 201278 notes
#submission #leonsbuddydave #programming #coding #command line #unix #windows #pc
The art of debugging → blog.corollarium.com

corollarium:

Pesky bugs. How I smack them:

  1. Code review. After writing anything I check it myself (don’t waste someone else’s eyes before you reviewed the code yourself). This catches most typos (things like = for ==, variables with typos in interpreted languages, etc). I also simulate code in my head, which makes sure simple logic errors that may have been made are caught early, before even running anything.
  2. Plenty of logs. I start any project by having a good Log class, with multiple log levels with filtering, information about the line and file that called the log, sometimes even automatic backtracing in cause of errors (in Python I automatically fall into a . I usually can get a pretty good idea of what went wrong just by checking these logs. Many times adding a few extra log() calls with detailed information about variables is quicker and simpler than using a debugger. And in some cases (websites, for example) setting up a debugger is not trivial, so this has to solve the problem.
  3. Tests. This is 2a), in fact, because you can only test properly if you have a test suite. I’ll write someday about how I write test suites, but the basic needs are universal:
    1. tests should be as simple as possible;
    2. should cover all of the code;
    3. should be completely automatic when viable (3D graphic applications are not that easy to write automatic tests, however);
    4. and should test for both the “good cases” and the “bad cases”.
  4. If things are looking complicated and logs did not help enough, call that faithful debugger. These days my use of debuggers is quite simple: I often set breakpoints in the code itself (debugger for javascript, raise(SIGINT) for C/C++ and gdb), since it’s usually faster than navigating through the code in the debugger if I know where I want to stop. When the breakpoint is hit, I print all variables to check if their values are correct, and if necessary I step through a few calls.
  5. Stack traces are your friends. In C/C++ I let the program run until it crashes, run a backtrace (bt) and start to move up in the call stack until I get to the culprit — usually it is pretty obvious.
  6. In JavaScript and Python you can fall into an interactive terminal when the debugger stops that is just as good as the real program: so you can pretty much type any code there, which is run instantly. Then you see immediately if it fixes the code. I’ve come to love this: interactive programming can be extremely useful (great for testing complicated selectors in javascript, for example!). gdb can do some of that, but has several limitations due to C++ being compiled. But use STL support at least for decent printing of STL structures.
  7. After the bug is fixed, make sure it becomes a test in your suite!
Mar 26, 201213 notes
#debugging
computer science TAs → alexwpratt.tumblr.com

alexwpratt:

90% of computer science TAs are the same.  They hear your problem.  They smirk.  They lean back and release a hearty laugh.  They say big words to make sure you understand how stupid and ignorant you are.  They speak loudly to make sure the whole room know you’re dumb and they are the most intelligent, attractive, and perfect specimen to walk the Earth.  They grab your keyboard, kick you out of your chair, and fix the problem, pulling a few lean-and-demean looks along the way.

Then they run the program.  

Seg fault.

What was that you were saying earlier??

lol, gpoy my freshman year.

I usually just ask one of the compsci bros in my class who’ve been programming long before uni. They’re the best. XD;

Mar 26, 20129 notes
#compsci
Play
Mar 26, 201211 notes
Brogramming → brogrammingdays.blogspot.com

neonspandex:

MOST BADASS BLOG EVER.

i wish it were a tumblr; i’d follow the shit out of it.

lmfao, same here! XD

Mar 26, 20127 notes
#brogramming #okay back to database #yay SQL~
Robocode: A fun way to learn java. → programmer-problems.tumblr.com

cjbrowne:

programmer-problems:

Hi, guys. :D
I just found an interesting simulation program IBM made. It’s a free simulator that teaches you how to program a robot and simulate it to battle robots made by other people!

Here’s the link: http://www.ibm.com/developerworks/java/library/j-robocode/

Learning to code with fun…

Those screenshots are really, really old.  Better to go straight to the sourceforge site: http://robocode.sourceforge.net/

There’s also a wiki to help newbie robocoders find their feet: http://robowiki.net/

It now supports eclipse and netbeans integration too, by the way, there are articles on the wiki about it; it’s much easier to use eclipse/netbeans than their built-in “IDE”.

But yeah, this thing is awesome.  Bloody difficult to get anything worthwhile to happen though, so probably not as great an introduction to Java as it first seems.  Mind you, I am the sort of person who always starts on “hard mode” and therefore I wrote my first AdvancedRobot before I’d touched the BasicRobot class (still haven’t touched that class) - I eventually got it Wave Surfing and Pattern Matching but my implementations of those were so terrible that it was hardly worth it.

Anyway, if anyone has any questions for an intermediate robocoder, my ask is always open :)

Mar 26, 201231 notes
#robocode #thanks! :D
Robocode: A fun way to learn java.

Hi, guys. :D
I just found an interesting simulation program IBM made. It’s a free simulator that teaches you how to program a robot and simulate it to battle robots made by other people!

Here’s the link: http://www.ibm.com/developerworks/java/library/j-robocode/

Learning to code with fun things like this in your spare time is a great way to learn programming languages. Once you get the basics down, you’ll definitely be able to move on into more interesting and challenging projects with code.

Hope this helps some of you.

Mar 24, 201231 notes
#programming #coding #compsci #robocode #robotics #engineering #java
Mar 24, 201235 notes
#programming #software #compiler #coding #update #submission #charles5
Hi! I run a tumblr for novice programmers -- lifeandcode. Thanks for posting the mini-list of other programming tumblrs, I'm following them now!

No problem! Thank you for making that blog!

EVERYONE, FOLLOW http://lifeandcode.tumblr.com! She has many awesome programming tutorials and posts. :D

Mar 24, 2012
#programming #promo #lifeandcode
Any other programming tumblr you recommend?

Yup! :3 Well, a lot of these are blogs run by programmers, but they do talk about programming a lot. mrlinux xplusplus syntaxcoloring codus jdeveloperblog 42codes mkstl Hope this helps. :D *If anyone runs any programming/design blogs, feel free to message me and I can add you on a blogroll or promote you. Thanks! <3

Mar 23, 201210 notes
#coding #programming #question #qa
200 Followers! Thanks, everyone!!!!

I LOVE YOU ALL.

deliarious, congrats on being the 200th follower! :D

Mar 23, 20122 notes
#omg you guys are awesome #no really #this blog gained 100 followers in two weeks #no seriously #thanks!! #programming #so many feels man #so many feels
“Give a computer program to somebody and you’ll frustrate them for a day. Teach them a computer language and how to program, and you’ll frustrate them for the rest of their lives.” —Random computer joke found on the internet (via jbwarrior)
Mar 23, 201246 notes
Mar 23, 20125 notes
#submission #1garysan #java #c #c++ #programming #generic verbosity
Do people really have these problems? Recursion, Linked Lists, Bubble Sorts, Null Termination, Pointers? These things rule. I mean yeah, pointers and null take a little bit of time but in a couple of Assembly labs you'll figure it out. As for the first three things I mentioned, those are all language independent concepts. They're not hard. Somebody should just make a C/C++/Java/Python (for all the mid levels) tutorial page for these people. lol.

“Problems” vary according to the person.

Usually it’s just something sentimental everyone experiences while programming. The concepts may seem simple, but applying them to certain assignments/exercises in class are what can make them difficult. I personally am not a fan of using recursion in Java. It’s not efficient at all, and most developers avoid using it.

Well, you seem pretty knowledgeable. Maybe you should make a tutorial site for all of us. ;D

Mar 22, 20121 note
#c #c++ #java #programming #question #shitmyblogsays #qa
Mar 22, 20123 notes
#submission #codus #unicode #programming #coding #binary #java #c #c++ #compsci
Mar 22, 201212 notes
#submission #the-reapers-are-here #java #programming #import #coding #I hate it when I did that sometimes too lol
Mar 22, 201219 notes
#submission #thisbethekris #public #typo #programming #string #java #c #c++ #variables #coding
Mar 21, 201211 notes
#submission #c-string #programming #coding #skittycatz #c #c++
Mar 20, 201210 notes
#submission #tumblrite #programming #debugging #java #c #return statement
Mar 20, 20123 notes
#submission #lovablegeek #python #programming #coding #I love your username! :D

“We’re switching to Waterfall next week…”

“Time to upgrade Eclipse!”

“3+ years of experience with Visual Basic, 3+ years of…”

“public static void ….”

“On the whiteboard, show me how you’d do [unlikely problem] in [unfamiliar language]”

“We’re gonna need you guys to work on some in-house software.”

“Can’t you use Java?”

Mar 20, 20122 notes
#java #python #php #perl #errors #life #submission
Mar 20, 201214 notes
#submission #charles5 #programming #documentation #coding
Stack Overflow

Q: Can anyone help me with this problem? 

A: nvm, I figured it out.

Mar 20, 20129 notes
#java #python #php #perl #errors #life #submission
Mar 20, 201210 notes
#submission #wartomakepeace #programming #coding #java #c #ide #debugging #compsci
Mar 20, 20125 notes
#submission #wartomakepeace #programming #java #c #coding
Mar 20, 20125 notes
#submission #wartomakepeace #programming #coding #api #compiler #c #java #lolcode
Mar 20, 201226 notes
#submission #wartomakepeace #programming #debugging #code #c #c++ #java
Mar 20, 20124 notes
#submission #wartomakepeace #programming #spaghetti code #coding #debugging #flow
Mar 20, 201216 notes
#submission #wartomakepeace #programming #arrays #c #java #coding
Mar 18, 20124 notes
#submission #wartomakepeace #coding #programming #hobby #posers #compsci #engineering #'being a nerd' #gpoy a lot of girls in my sorority #all of them
Mar 18, 20123 notes
#submission #wartomakepeace #mySQL #database #omg gpoy me in Database Systems #gpoy my life
Mar 18, 201211 notes
#programming #coding #python #submission #wartomakepeace
Mar 17, 201230 notes
#submission #charles5 #google #college #uni #coding #compsci #compe #this is so damn true.
True Story

Mar 17, 201256 notes
#social #life #submission
Oh man, I agree with pretty much every submission. In relation to the language tutorial page, I'm watching the Stanford U videos as I type and have already forced myself to unlearn some bad practices. I highly recommend them to anyone looking to learn not just a language, but also good practices. There's also the second series that follows on from it, which delves a bit deeper.

I know, right?

When I was a freshman in compsci in Algorithms class, my professor was awful. The guy in the Stanford U videos taught me everything I needed to know. I also linked his videos in the tutorial section on this site, but maybe I should link the playlist. :D

Glad to know it helps!

Mar 17, 20123 notes
#compsci #question #stanford #qa
A Programmer's Day

1. Wake up with an idea. Mull over it during breakfast brunch.

2. By 1 P.M., you’ve decided it’ll be a great way to get into that new language you’ve been wanting to try.

3. Hack out a few basic components. Get excited when they work beautifully.

5. Time for actual lunch. Come up with an extension to your idea that’s even more exciting than the original idea.

6. Get started on the extension, which spawns three more amazing ideas.

7. It’s 2 P.M., and the extension has become its own project.

8. It’s 4 P.M. and the components you hacked out before won’t play nice together. Ask Stack Overflow.

9. Incorrectly copy/paste your code into SO such that you’re missing a brace and the community thinks that’s your problem. It’s 6 o’clock. Tumblr break.

10. Read all the articles linked from the #programming tags. Read the articles they link to.

11. It’s 8:30 P.M., and you’ve got 11 tabs open. Not including Reddit and Tumblr.

12. Finish arguing over IRC about how Scala is the next big thing and oh maybe I should get back to that project.

13. 10 P.M., dinner ramen should be sufficient.

14. Open up vim and get back to that project.

15. *multiple “what the fuck” moments while reacquainting yourself with your 4-hour-old code*

16. “This is idea isn’t really that great anyway. I’m sure tons of people have tried and failed.”

17. Read xkcd/Cracked articles/TV Tropes.

18. “I’ll just get back to that project in the morning.”

19. It’s 3 A.M. and maybe sleep or something I guess but ycombinator and

20. goto 1

Mar 16, 201228 notes
#java #python #php #perl #college #life #submission
Mar 15, 20129 notes
#submission #wartomakepeace #java #c #programming #commenting #copy
Mar 15, 201220 notes
#submission #wartomakepeace #programming #c #java #compiler
Mar 15, 201215 notes
#submission #wartomakepeace #java #programming #arrays #arraylist
Mar 15, 20125 notes
#submission #wartomakepeace #java #c #bubble sort
Mar 15, 20122 notes
#submission #wartomakepeace #programming #c #java
Mar 15, 201231 notes
#submission #wartomakepeace #java #programming
Mar 15, 20122 notes
#submission #wartomakepeace #programming #java
Mar 15, 20124 notes
#submission #wartomakepeace #c #java #Eclipse #compiler #error #code #programming
Mar 15, 20123 notes
#submission #wartomakepeace #c #programming #null terminator
Mar 14, 201230 notes
#charles5 #submission #programming #coding
Mar 14, 201238 notes
#beta-winston-churchill #submission #semicolon #coding #programming #java #C #grammar
awesome blog! love it! i always thought i was the only person who did this (;

image

lol, thanks!

I thought so too at first! Glad I can unite all of us~ XD

Mar 14, 2012
Oh, programming bros.

charles5:

programmer-problems:

I love how all of our sleeping patterns (or lack thereof) are alike.

I usually get submissions between 2:00AM - 4:00AM EST. :D

Sleep? WTF is that?

SLEEP IS FOR THE WEAK. >:D

Mar 14, 20126 notes
#life #or lack thereof
Oh, programming bros.

I love how all of our sleeping patterns (or lack thereof) are alike.

I usually get submissions between 2:00AM - 4:00AM EST. :D

Mar 14, 20126 notes
#personal #programming #lol sorry I just thought it was interesting~
Next page →
2012 2013
  • January 1
  • February
  • March
  • April
  • May
  • June 8
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January
  • February
  • March 53
  • April 1
  • May 41
  • June 21
  • July 3
  • August 2
  • September 1
  • October 1
  • November
  • December
2011 2012
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August 19
  • September 4
  • October 2
  • November 2
  • December 4