The Big Programming Thread - Page 141
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
![]()
tofucake
Hyrule18980 Posts
| ||
tzenes
Canada64 Posts
On June 02 2012 01:03 sluggaslamoo wrote: What do you expect? you gotta stop trying to explain things you don't even understand, that's what makes me angry. You are trying to find holes in my argument, but you sound silly trying to do it and trying to sound smart by making contrasts that don't even make sense. It would make me a lot more happy if you actually didn't keep putting words in my mouth, requiring me to say the same thing, over and over just to make it clear. If you find yourself repeating yourself to communicate is that a failure to comprehend or a failure to communicate? What's more if it didn't work the first time why would repetition help? This paragraph makes no sense whatsoever. What does interfaces have to do with the definition of duck typing? The definition of duck-typing is simply this, "if it quacks like a duck, it is a duck", interfaces serve a completely different role, a much better name for it is Protocol, which is what obj-C calls it, because that's what it is, a protocol. Duck-typing and interfaces do not serve the same purpose. The paradigm is completely different. In fact the one thing I miss in Ruby is "interfaces". I would love the ability to have both protocols and duck-typing. The definition of ducktyping is "object's current set of methods and properties determines the valid semantics." This is as opposed to its type. Or to translate: "if it can quack, you should be able to quack it." In a world without late binding the way you achieve this is by either creating a duck class (which you have all object you want to quack inherit from) or a duck interface (which has a quack method). The former requires that you fundamentally change the nature of all objects you want to be included and all predecessors (when you don't have multiple inheritance, eg. Java), where as the latter lets you just "quack" all your objects which have a quack method. It's not runtime, but it does let you have the method determine the semantics. C# does not have mixins or duck-typing. It has traits, and some really uglified form of duck-typing but I don't know what to call it, I wouldn't call it ducktyping though, more like duck-type-casting. Just because someone tells you 2+2=5, doesn't mean its true, even if its Microsoft. C# traits are supposed to provide the support of mixins. C# has ducktyping:
In python this code would look like:
Notice the only real difference here is the usage of the "dynamic" keyword which bypass compile-time type checking and resolves at runtime. All along you have been implying that monkey patching is bad. I have never once said it is bad (in fact I said just the opposite), If monkey patching is bad, then RSpec must be bad, but you love RSpec. Double standards, for some reason when a library does it right, its great, but otherwise the feature is bad. Makes no sense. Go use only Ruby libraries that don't use Open Classes, so basically none of the good ones. Don't use RSpec, don't use Cucumber, don't use RR, don't use Haml, don't use ActiveRecord. What the hell do you have left? Your first assertion is false. Because a thing is bad does not mean everything it creates is bad. But even if it did, I've stated more than once I don't think monkey patching is bad. What I think it is is an admission of guilt. These are the functionality the Ruby language failed to provide. They are demonstrations that the language is insufficient so we had to change it. RSpec doesn't need monkey patching. We could implement its features in the core Ruby language (and probably in a less intrusive way). Ruby is a fascinating and powerful language, one of my favorites, but that doesn't mean it's not deeply flawed in many ways. Denying these flaws won't make our lives better, what we should do is learn from them. Then you aren't doing your TDD/BDD right. One time me and my pair, spent a week refactoring a subset of a gigantic website, kept going until all tests were passed, we only had 87% code-coverage, no bugs. If we had bugs we would have been notified immediately (we had millions of users per day). So your proof that TDD/BDD always works is a single anecdote? Here's the strange thing though, I actually think TDD/BDD reduces bugs and outages. It's not 100% prefect, but its a lot better than most other approaches. However, even with 100% code-coverage, integration tests, and a slew of acceptance tests, bugs still get through. It's not because they "aren't doing it right," it's just an imperfect system. There is no panacea for bugs or bad code. Sometimes your tests don't fully exercise a use case (as you can easily run into an intractable number of acceptance tests); sometimes there is a faulty assumption or your blend of calls shifts; sometimes you're under-scaled and your EC2 instances just don't spin up fast enough and it takes down your database; sometimes your tests just have bugs. Let's not pretend that TDD will fix all your problems when you and I both know it won't. On June 02 2012 01:03 sluggaslamoo wrote: I don't understand your vehemence. It sounds mostly like you and I are very similar developers with similar preferences. All I ask is that you be a little more pragmatic about Ruby and a little less vindictive to Java (et al). | ||
Millitron
United States2611 Posts
On June 02 2012 03:47 tofucake wrote: VBA is extremely useful, actually. I know, I just had some bad experiences with it. When I wasn't having problems with it, it was extremely cool. | ||
billy5000
United States865 Posts
On June 02 2012 01:19 ZappaSC wrote: Im trying to learn java before beginning my studies at a universtity. I have written quite a lot of things in C, but my experience with classes is limited. So anyone have some tips/a good resource for using classes the right way? try thinking in java. it begins by introducing the reader to object oriented programming, and since you already have some programming knowledge, it should be a good starting point. | ||
billy5000
United States865 Posts
as of now, i have a pretty good grasp of the fundamentals having learned basic programming in my java class (tbh, it really didn't feel like a language-specific course as we sort of skipped the java specifics--didn't bother with switch, foreach, etc, and we didn't even go over a single package outside of java.lang, they were all created by the textbook author sedgewick). oh yeah i love his textbook btw. cannot believe his textbook isn't among the top recommendations for beginning programmers also, i finished my object oriented programming class last semester, and just started reading algorithms so i could prep up for this online class taught by the man himself. and halfway through this book, i'm wondering what my next step should be. what should my next step be? i've been going to projecteuler's and doing some problems here and there, and had some really small projects of my own, but i can always do these for fun. should i learn some math specifically for programming? i kind of bs'ed my discrete mathematics course yet managed an a (can't say i remember much lol); should i look over that again or maybe a different math? or should i start learning a second language? i've always wanted to learn c, but i think java will keep me busy for a while. suggestions? | ||
manloveman
424 Posts
On June 04 2012 14:39 billy5000 wrote: i have a question regarding progression as a programmer. as of now, i have a pretty good grasp of the fundamentals having learned basic programming in my java class (tbh, it really didn't feel like a language-specific course as we sort of skipped the java specifics--didn't bother with switch, foreach, etc, and we didn't even go over a single package outside of java.lang, they were all created by the textbook author sedgewick). oh yeah i love his textbook btw. cannot believe his textbook isn't among the top recommendations for beginning programmers also, i finished my object oriented programming class last semester, and just started reading algorithms so i could prep up for this online class taught by the man himself. and halfway through this book, i'm wondering what my next step should be. what should my next step be? i've been going to projecteuler's and doing some problems here and there, and had some really small projects of my own, but i can always do these for fun. should i learn some math specifically for programming? i kind of bs'ed my discrete mathematics course yet managed an a (can't say i remember much lol); should i look over that again or maybe a different math? or should i start learning a second language? i've always wanted to learn c, but i think java will keep me busy for a while. suggestions? Where do you wonna go with your programming? Here are 2 suggestions. Are you into theoretical topics? If so, look into getting more depth in your problem perception. Complexity classes, P, NP and NPC gives a good background on what can be solved practically and how you can prove otherwise. Check it out. Are you into 3d graphics. The opengl api is (as far as I know) only directly available in C. However, here is a framework that implements all the c api 1 to 1 into java: http://www.lwjgl.org/ Bonus info: Notch used this to implement minecraft. Warning: opengl uses extensive matrix and vector abstraction. You will need your linear algebra. Other than that. Just work work and work. The more you work on it, the less effort it will take. Practice makes perfect, and programming is ofcourse no exception. The being fast and effecient comes from working at it. There is no magic trick here sadly. | ||
billy5000
United States865 Posts
hmm any suggestions on the path to becoming a database developer or something similar? as far as i'm concerned, my school is fairly limited when it comes to databases. maybe a book or a website to get me in the right direction. | ||
manloveman
424 Posts
On June 04 2012 17:43 billy5000 wrote: actually, i've always want to get into databases. but what i really want is a solid foundation before i specialize (i know a little sql, but that's about it). i thought there would be more fundamentals to learn after algorithms and whatnot, but it doesn't really seem like it based on your post. hmm any suggestions on the path to becoming a database developer or something similar? as far as i'm concerned, my school is fairly limited when it comes to databases. maybe a book or a website to get me in the right direction. i thought there would be more fundamentals to learn after algorithms and whatnot How did you get that from my post? Algorithms and their run time complexity is an absolutely huge subject and a very large field of research to boot. P=NP is even on the million dollar problems list. I suggest getting and reading this bad boy: http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844 Best programming book ever written imho. | ||
sluggaslamoo
Australia4494 Posts
On June 04 2012 14:39 billy5000 wrote: i have a question regarding progression as a programmer. as of now, i have a pretty good grasp of the fundamentals having learned basic programming in my java class (tbh, it really didn't feel like a language-specific course as we sort of skipped the java specifics--didn't bother with switch, foreach, etc, and we didn't even go over a single package outside of java.lang, they were all created by the textbook author sedgewick). oh yeah i love his textbook btw. cannot believe his textbook isn't among the top recommendations for beginning programmers also, i finished my object oriented programming class last semester, and just started reading algorithms so i could prep up for this online class taught by the man himself. and halfway through this book, i'm wondering what my next step should be. what should my next step be? i've been going to projecteuler's and doing some problems here and there, and had some really small projects of my own, but i can always do these for fun. should i learn some math specifically for programming? i kind of bs'ed my discrete mathematics course yet managed an a (can't say i remember much lol); should i look over that again or maybe a different math? or should i start learning a second language? i've always wanted to learn c, but i think java will keep me busy for a while. suggestions? Here is a list of books I own that I would recommend, that may help you. Design: Design Patterns - Gamma Helm Johnson Vlissides (only for OOP) Object Design - Wirfs-Brock & McKean (OOP) Object Oriented Programming in C++ - Jossutis GPL/DSL creation: Language Implementation Patterns - Terence Parr The Definitive ANTLR Reference - Parr ^ I started out just wanting to create a LOLcode parser, but eventually ended up prototyping quite a potentially useful language. Graphics: OpenGL Programming Guide 7th Edition "The Red Book" Testing: Working Effectively with Legacy Code - Michael C Feathers Test Driven Development - Kent Beck The Rspec/Cucumber Book/Rails+Rspec Recipes (Ruby) Other topics that you can learn on which I don't have books on, or borrowed books for and forgot the name for ![]() ![]() Paradigms: Structured Programming (if you haven't learned this already, I'd recommend learning this before anything else, functional decomposition is probably the most neglected fundamental skill in the world, I can't count the amount of developers I've wanted to punch because they don't know how to break things down into functions/procedures properly) Functional Programming (best place to start is Haskell for this) Algorithms: (Probably my least learned topics, better ask someone else about these) Big O Notation Data Structures (Important if you wanna learn about databases as asked above ![]() Genetic Algorithms Fun Languages: Lisp Haskell Scala | ||
KainiT
Austria392 Posts
In this case it's especially regarding c++ but you could translate it to every other language as well i guess, Everybody is telling me that it is not possible to create grafical interfaces(gui's) with the pure c++ standard and that I have to use libraries, but how exactly are those libraries able to extend c++ to being able to tell my pc to make a gui when the libraries are written in c++ themselves? Wouldn't they need to be written in a language that is one step closer to the hardware in order to be able to extend c++? thx in advance | ||
Mstring
Australia510 Posts
On June 07 2012 06:39 KainiT wrote: I have a question that I have problems finding sufficient answers for: In this case it's especially regarding c++ but you could translate it to every other language as well i guess, Everybody is telling me that it is not possible to create grafical interfaces(gui's) with the pure c++ standard and that I have to use libraries, but how exactly are those libraries able to extend c++ to being able to tell my pc to make a gui when the libraries are written in c++ themselves? Wouldn't they need to be written in a language that is one step closer to the hardware in order to be able to extend c++? thx in advance What they likely mean is that the language itself does not give you any features to help you with a gui. The most basic functions such as printing text to a console requires linking with a library. Libraries closer to hardware may use inline assmebly in c++ code or simply include objects written entire in assembly language. You could write all of this yourself in a .cpp file, but it would be a colossal waste of time when you could simply #include <opengl.h> and be on your merry way to creating a gui. | ||
tehemperorer
United States2183 Posts
On June 04 2012 17:43 billy5000 wrote: actually, i've always want to get into databases. but what i really want is a solid foundation before i specialize (i know a little sql, but that's about it). i thought there would be more fundamentals to learn after algorithms and whatnot, but it doesn't really seem like it based on your post. hmm any suggestions on the path to becoming a database developer or something similar? as far as i'm concerned, my school is fairly limited when it comes to databases. maybe a book or a website to get me in the right direction. Speaking from personal experience the demand for a pure database "developer" is declining sharply; your skillset needs to be more rounded since a lot of different technologies (Java in my case) are typically used in conjunction with databases to achieve business results. You need to know, for example, T-SQL, but you need to also know how to work with those transactions in a programming language since typically the data tier should only be used to retrieve data rather than work on it (for performance reasons). | ||
ObliviousNA
United States535 Posts
http://code.msdn.microsoft.com/windowsapps/DirectX-Marble-Maze-Game-e4806345 which looked new and interesting, but it requires development in windows 8, and frankly I don't want to mess with a VM when I'm just beginning dx. So, a) any recommendations on beginning dx9,10,11 first? Will I be missing out on any functionality by starting with 9? Major API changes? and b) What's the best tutorial or site for tutorials? thanks- | ||
findingthelimit
Hong Kong219 Posts
I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: | ||
Herper
501 Posts
On June 10 2012 16:51 findingthelimit wrote: aye- i have a question. I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: Up to you, I am messing around with android. You could try to learn C# with XNA game development for fun | ||
morty
Germany38 Posts
On June 10 2012 16:51 findingthelimit wrote: aye- i have a question. I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: do what is interesting for you ![]() webdevelopment? -> go ruby and javascript ... HTML is not really a language you have to learn coming from java ruby is a pleasure to learn and write just check out www.reddit.com/r/ruby im not so good in the other areas ![]() all you need is a project to work on and start doing something. (https://github.com/giving/giving.github.com/issues?page=1&state=open is a project for "charity" programming, probably not for the very beginner) if you have problems finding a job a github account with your work will help you with that. so start coding ![]() | ||
heishe
Germany2284 Posts
On June 10 2012 16:51 findingthelimit wrote: aye- i have a question. I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: If you want to pick up a purely programming-technical skill, then you should go with C (not C++). Writing a working application in C should give you a decent understanding of memory layout, as well show you how much work higher level languages actually save you. | ||
blug
Australia623 Posts
On June 10 2012 16:51 findingthelimit wrote: aye- i have a question. I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: Javascript is a bad language no offence to anyone who uses it. It's essential but by no means should you learn it if you want to get an understanding of other programming languages. Also, don't be mislead, javascript has no relation to java. I would totally suggest learning the language though if you do want to get an understanding of Web Development. If you have a solid understanding of java, then making a jump to C or C++ shouldn't be to difficult, the major differences between the languages are philisophical or structural. | ||
Mstring
Australia510 Posts
On June 10 2012 15:39 ObliviousNA wrote: Does anyone have good recommendations for beginning DirectX programming? I just finished up a class on OpenGL, and I'm looking into the DX framework. I've only been able to find a few limited examples/tutorials online. MSDN has this http://code.msdn.microsoft.com/windowsapps/DirectX-Marble-Maze-Game-e4806345 which looked new and interesting, but it requires development in windows 8, and frankly I don't want to mess with a VM when I'm just beginning dx. So, a) any recommendations on beginning dx9,10,11 first? Will I be missing out on any functionality by starting with 9? Major API changes? and b) What's the best tutorial or site for tutorials? thanks- Simply download the full DirectX SDK from Microsoft. It contains a solid reference manual with tutorials, and plenty of example programs (or at least it did when I last fiddled with DX back in 9.0c). | ||
ForgottenOne
Romania236 Posts
On June 10 2012 16:51 findingthelimit wrote: aye- i have a question. I'm a potential computer science major in college. It's summer time, and i'm not doing shit, because i don't have an intern. Partially because i'm lazy, but also partially because i know close to nothing so i'm quiet intimidated about applying for any position. i don't want my summer to rot away again next year. I would like to do something useful now to prepare for next year. WHAT SHOULD I DO? i know java, and i have a very good understanding of abstract data structures. should i learn a new langauge? If so, what should i learn? C or C++? Seems like the next logical step to me, as OP said C is the backbone to most langauges. Or should I learn javascript / HTML? advice needed D: I'll asume you want to become a software developer. You don't say what your long term goal is but the questions hints towards this. Assuming this, if you would live in my city I would tell you that you will have a lot opportunities for working in C++, C#, Java and very few in other languages. So I would recomend to be decided if you want to work in this field and to research what kinds of languages are used in your area. I gave the example with my city because for this case, the advice is clear: stick to Java. Learn it really well and you will find jobs and satisfaction doing it. Programming in Java is a completely different mindset than programming in C++ (or C). If you'll get to the point of being awesome at Java, you will be an awesome developer. Just read Effective Java (Joshual Bloch), some design patterns, try using various api's right and build some application(s). | ||
| ||